All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Yang Zhong <yang.zhong@intel.com>, Jing Liu <jing2.liu@intel.com>
Subject: [PULL 16/22] x86: Add XFD faulting bit for state components
Date: Tue,  8 Mar 2022 12:34:39 +0100	[thread overview]
Message-ID: <20220308113445.859669-17-pbonzini@redhat.com> (raw)
In-Reply-To: <20220308113445.859669-1-pbonzini@redhat.com>

From: Jing Liu <jing2.liu@intel.com>

Intel introduces XFD faulting mechanism for extended
XSAVE features to dynamically enable the features in
runtime. If CPUID (EAX=0Dh, ECX=n, n>1).ECX[2] is set
as 1, it indicates support for XFD faulting of this
state component.

Signed-off-by: Jing Liu <jing2.liu@intel.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <20220217060434.52460-5-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/cpu.c | 3 ++-
 target/i386/cpu.h | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 505ee289bc..79e24bb23f 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5496,7 +5496,8 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
                 const ExtSaveArea *esa = &x86_ext_save_areas[count];
                 *eax = esa->size;
                 *ebx = esa->offset;
-                *ecx = esa->ecx & ESA_FEATURE_ALIGN64_MASK;
+                *ecx = esa->ecx &
+                       (ESA_FEATURE_ALIGN64_MASK | ESA_FEATURE_XFD_MASK);
             }
         }
         break;
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 9630f4712a..925d0129e2 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -557,8 +557,10 @@ typedef enum X86Seg {
 #define XSTATE_DYNAMIC_MASK             (XSTATE_XTILE_DATA_MASK)
 
 #define ESA_FEATURE_ALIGN64_BIT         1
+#define ESA_FEATURE_XFD_BIT             2
 
 #define ESA_FEATURE_ALIGN64_MASK        (1U << ESA_FEATURE_ALIGN64_BIT)
+#define ESA_FEATURE_XFD_MASK            (1U << ESA_FEATURE_XFD_BIT)
 
 
 /* CPUID feature words */
-- 
2.35.1




  parent reply	other threads:[~2022-03-08 11:54 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 11:34 [PULL v2 00/22] QEMU changes for 7.0 soft freeze Paolo Bonzini
2022-03-08 11:34 ` [PULL 01/22] whpx: Fixed reporting of the CPU context to GDB for 64-bit Paolo Bonzini
2022-03-08 11:34 ` [PULL 02/22] whpx: Fixed incorrect CR8/TPR synchronization Paolo Bonzini
2022-03-08 11:34 ` [PULL 03/22] vmxcap: Add 5-level EPT bit Paolo Bonzini
2022-03-08 11:34 ` [PULL 04/22] meson: fix generic location of vss headers Paolo Bonzini
2022-03-08 11:34 ` [PULL 05/22] qga/vss-win32: check old VSS SDK headers Paolo Bonzini
2022-03-08 11:34 ` [PULL 06/22] qga/vss: update informative message about MinGW Paolo Bonzini
2022-03-08 11:34 ` [PULL 07/22] update meson-buildoptions.sh Paolo Bonzini
2022-03-08 11:34 ` [PULL 08/22] kvm-irqchip: introduce new API to support route change Paolo Bonzini
2022-03-08 11:34 ` [PULL 09/22] kvm/msi: do explicit commit when adding msi routes Paolo Bonzini
2022-03-08 11:34 ` [PULL 10/22] target/i386: only include bits in pg_mode if they are not ignored Paolo Bonzini
2022-03-08 11:34 ` [PULL 11/22] target/i386: Throw a #SS when loading a non-canonical IST Paolo Bonzini
2022-03-08 11:34 ` [PULL 12/22] linux-headers: include missing changes from 5.17 Paolo Bonzini
2022-03-08 11:34 ` [PULL 13/22] x86: Fix the 64-byte boundary enumeration for extended state Paolo Bonzini
2022-03-08 11:34 ` [PULL 14/22] x86: Add AMX XTILECFG and XTILEDATA components Paolo Bonzini
2022-03-08 11:34 ` [PULL 15/22] x86: Grant AMX permission for guest Paolo Bonzini
2022-03-16 15:57   ` Peter Krempa
2022-03-16 16:05     ` Daniel P. Berrangé
2022-03-16 17:20       ` Paolo Bonzini
2022-03-16 17:48       ` David Edmondson
2022-03-16 17:50         ` Daniel P. Berrangé
2022-03-17 12:12           ` Maxim Levitsky
2022-03-17  5:56     ` Yang Zhong
2022-03-18 10:13     ` Michal Prívozník
2022-03-18 11:53       ` Yang Zhong
2022-03-22  8:26     ` Yang Zhong
2022-03-08 11:34 ` Paolo Bonzini [this message]
2022-03-08 11:34 ` [PULL 17/22] x86: Add AMX CPUIDs enumeration Paolo Bonzini
2022-03-08 11:34 ` [PULL 18/22] x86: add support for KVM_CAP_XSAVE2 and AMX state migration Paolo Bonzini
2022-03-08 11:34 ` [PULL 19/22] x86: Support XFD and AMX xsave data migration Paolo Bonzini
2022-03-08 11:34 ` [PULL 20/22] i386: Add Icelake-Server-v6 CPU model with 5-level EPT support Paolo Bonzini
2022-03-08 11:34 ` [PULL 21/22] KVM: SVM: always set MSR_AMD64_TSC_RATIO to default value Paolo Bonzini
2022-03-08 11:34 ` [PULL 22/22] gitlab-ci: do not run tests with address sanitizer Paolo Bonzini
2022-03-10 12:09 ` [PULL v2 00/22] QEMU changes for 7.0 soft freeze Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220308113445.859669-17-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jing2.liu@intel.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yang.zhong@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.