[PATCH] target/i386: add feature dependency for XSAVE

Paolo Bonzini posted 1 patch 6 months, 2 weeks ago
Failed in applying to current master (apply log)
target/i386/cpu.c | 4 ++++
1 file changed, 4 insertions(+)
[PATCH] target/i386: add feature dependency for XSAVE
Posted by Paolo Bonzini 6 months, 2 weeks ago
The XSAVEOPT, XSAVEC, XGETBV1, XSAVES features make no sense if you
cannot enable XSAVE in the first place.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/cpu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index f2ea6899e39..6f5ff71c6ee 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1550,6 +1550,10 @@ static FeatureDep feature_dependencies[] = {
         .from = { FEAT_8000_0001_ECX,       CPUID_EXT3_SVM },
         .to = { FEAT_SVM,                   ~0ull },
     },
+    {
+        .from = { FEAT_1_ECX,               CPUID_EXT_XSAVE },
+        .to = { FEAT_XSAVE,                 ~0ull },
+    },
     {
         .from = { FEAT_7_0_ECX,             CPUID_7_0_ECX_WAITPKG },
         .to = { FEAT_VMX_SECONDARY_CTLS,    VMX_SECONDARY_EXEC_ENABLE_USER_WAIT_PAUSE },
-- 
2.45.0
Re: [PATCH] target/i386: add feature dependency for XSAVE
Posted by Zhao Liu 6 months, 2 weeks ago
On Thu, May 09, 2024 at 05:39:52PM +0200, Paolo Bonzini wrote:
> Date: Thu,  9 May 2024 17:39:52 +0200
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH] target/i386: add feature dependency for XSAVE
> X-Mailer: git-send-email 2.45.0
> 
> The XSAVEOPT, XSAVEC, XGETBV1, XSAVES features make no sense if you
> cannot enable XSAVE in the first place.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  target/i386/cpu.c | 4 ++++
>  1 file changed, 4 insertions(+)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>