diff mbox series

[SRU,o/n:linux-azure,1/1] Revert "UBUNTU: SAUCE: x86/hyperv: temporarily disable CET SS on SEV-SNP due to a paravisor bug"

Message ID 20240906160926.750390-2-john.cabaj@canonical.com
State New
Headers show
Series Revert fix for "Kernel fails to enable XSAVE when running in a “v5” AMD SEV-SNP VM" | expand

Commit Message

John Cabaj Sept. 6, 2024, 4:09 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2079841

This reverts commit 8ce273422c040ec77c8bfa58c7d7dbbb570710d0.

Signed-off-by: John Cabaj <john.cabaj@canonical.com>
---
 arch/x86/kernel/cpu/mshyperv.c | 21 ---------------------
 1 file changed, 21 deletions(-)

Comments

Thibault Ferrante Sept. 6, 2024, 4:33 p.m. UTC | #1
On 06-09-2024 18:09, John Cabaj wrote:
> BugLink: https://bugs.launchpad.net/bugs/2079841
> 
> This reverts commit 8ce273422c040ec77c8bfa58c7d7dbbb570710d0.
In oracular:linux-azure it should be 29fa1211e69aa9a21be5517e795b99156a4df78e
> 
> Signed-off-by: John Cabaj <john.cabaj@canonical.com>
> ---
>   arch/x86/kernel/cpu/mshyperv.c | 21 ---------------------
>   1 file changed, 21 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
> index c9dee20fa8a9..82a356fbde4e 100644
> --- a/arch/x86/kernel/cpu/mshyperv.c
> +++ b/arch/x86/kernel/cpu/mshyperv.c
> @@ -581,27 +581,6 @@ static void __init ms_hyperv_init_platform(void)
>   	if (!(ms_hyperv.features & HV_ACCESS_TSC_INVARIANT))
>   		mark_tsc_unstable("running on Hyper-V");
>   
> -	/*
> -	 * Mask CET Shadow Stack on SEV-SNP due to a CPUID emulation bug in
> -	 * the paravisor on old Azure SEV-SNP hosts, e.g., 10.0.20348.2867-2-0.
> -	 * Due to the bug, paranoid_xstate_size_valid() in a v6.6 or newer
> -	 * kernel prints a warning "XSAVE consistency problem: size 848 != kernel_size 832"
> -	 * and the kernel disables XSAVE completely; the early 'init' program or
> -	 * any later program may get core-dumped due to "invalid opcode", if
> -	 * they assume XSAVE is available (e.g., it looks like
> -	 * libgnutls.so.30.27.0 tries to unconditionally use XSAVE.
> -	 *
> -	 * Note: the SNP paravisor bug only affects a v6.6+ Linux kernel
> -	 * (CET Shadow Stack is firstly enabled in v6.6) when the VM is a "v5"
> -	 * SNP VM on Azure. A "v6" SNP VM is not affected, and a TDX VM is also
> -	 * not affectd since the versions of paravisor for them are already
> -	 * fixed. The fix for the "v5" VMs would roll out around September or
> -	 * October, 2024.
> -	 */
> -       if (ms_hyperv.paravisor_present &&
> -	   hv_get_isolation_type() == HV_ISOLATION_TYPE_SNP)
> -                setup_clear_cpu_cap(X86_FEATURE_SHSTK);
> -
>   	hardlockup_detector_disable();
>   }
>
diff mbox series

Patch

diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index c9dee20fa8a9..82a356fbde4e 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -581,27 +581,6 @@  static void __init ms_hyperv_init_platform(void)
 	if (!(ms_hyperv.features & HV_ACCESS_TSC_INVARIANT))
 		mark_tsc_unstable("running on Hyper-V");
 
-	/*
-	 * Mask CET Shadow Stack on SEV-SNP due to a CPUID emulation bug in
-	 * the paravisor on old Azure SEV-SNP hosts, e.g., 10.0.20348.2867-2-0.
-	 * Due to the bug, paranoid_xstate_size_valid() in a v6.6 or newer
-	 * kernel prints a warning "XSAVE consistency problem: size 848 != kernel_size 832"
-	 * and the kernel disables XSAVE completely; the early 'init' program or
-	 * any later program may get core-dumped due to "invalid opcode", if
-	 * they assume XSAVE is available (e.g., it looks like
-	 * libgnutls.so.30.27.0 tries to unconditionally use XSAVE.
-	 *
-	 * Note: the SNP paravisor bug only affects a v6.6+ Linux kernel
-	 * (CET Shadow Stack is firstly enabled in v6.6) when the VM is a "v5"
-	 * SNP VM on Azure. A "v6" SNP VM is not affected, and a TDX VM is also
-	 * not affectd since the versions of paravisor for them are already
-	 * fixed. The fix for the "v5" VMs would roll out around September or
-	 * October, 2024.
-	 */
-       if (ms_hyperv.paravisor_present &&
-	   hv_get_isolation_type() == HV_ISOLATION_TYPE_SNP)
-                setup_clear_cpu_cap(X86_FEATURE_SHSTK);
-
 	hardlockup_detector_disable();
 }