47 lines
1.8 KiB
Diff
47 lines
1.8 KiB
Diff
|
|
From ad727933a766e952b5054bfd53c93ad43fdb6dec Mon Sep 17 00:00:00 2001
|
|||
|
|
From: Yang Zhong <yang.zhong@linux.intel.com>
|
|||
|
|
Date: Thu, 6 Apr 2023 02:40:41 -0400
|
|||
|
|
Subject: [PATCH] target/i386: Change wrong XFRM value in SGX CPUID leaf
|
|||
|
|
MIME-Version: 1.0
|
|||
|
|
Content-Type: text/plain; charset=UTF-8
|
|||
|
|
Content-Transfer-Encoding: 8bit
|
|||
|
|
|
|||
|
|
commit 72497cff896fecf74306ed33626c30e43633cdd6 upstream.
|
|||
|
|
|
|||
|
|
The previous patch wrongly replaced FEAT_XSAVE_XCR0_{LO|HI} with
|
|||
|
|
FEAT_XSAVE_XSS_{LO|HI} in CPUID(EAX=12,ECX=1):{ECX,EDX}. As a result,
|
|||
|
|
SGX enclaves only supported SSE and x87 feature (xfrm=0x3).
|
|||
|
|
|
|||
|
|
Intel-SIG: commit 72497cff896f target/i386: Change wrong XFRM value in SGX CPUID leaf
|
|||
|
|
Backport i386/cpu bugfixes
|
|||
|
|
|
|||
|
|
Fixes: 301e90675c3f ("target/i386: Enable support for XSAVES based features")
|
|||
|
|
Signed-off-by: Yang Zhong <yang.zhong@linux.intel.com>
|
|||
|
|
Reviewed-by: Yang Weijiang <weijiang.yang@intel.com>
|
|||
|
|
Reviewed-by: Kai Huang <kai.huang@intel.com>
|
|||
|
|
Message-Id: <20230406064041.420039-1-yang.zhong@linux.intel.com>
|
|||
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|||
|
|
Signed-off-by: Jason Zeng <jason.zeng@intel.com>
|
|||
|
|
---
|
|||
|
|
target/i386/cpu.c | 4 ++--
|
|||
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|||
|
|
|
|||
|
|
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
|
|||
|
|
index 6b098cc832..9ab8ef3bd1 100644
|
|||
|
|
--- a/target/i386/cpu.c
|
|||
|
|
+++ b/target/i386/cpu.c
|
|||
|
|
@@ -5951,8 +5951,8 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
|
|||
|
|
} else {
|
|||
|
|
*eax &= env->features[FEAT_SGX_12_1_EAX];
|
|||
|
|
*ebx &= 0; /* ebx reserve */
|
|||
|
|
- *ecx &= env->features[FEAT_XSAVE_XSS_LO];
|
|||
|
|
- *edx &= env->features[FEAT_XSAVE_XSS_HI];
|
|||
|
|
+ *ecx &= env->features[FEAT_XSAVE_XCR0_LO];
|
|||
|
|
+ *edx &= env->features[FEAT_XSAVE_XCR0_HI];
|
|||
|
|
|
|||
|
|
/* FP and SSE are always allowed regardless of XSAVE/XCR0. */
|
|||
|
|
*ecx |= XSTATE_FP_MASK | XSTATE_SSE_MASK;
|
|||
|
|
--
|
|||
|
|
2.27.0
|
|||
|
|
|