From: Yang Weijiang <weijiang.yang@intel.com>
To: tglx@linutronix.de, dave.hansen@intel.com, x86@kernel.org,
seanjc@google.com, pbonzini@redhat.com,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: peterz@infradead.org, chao.gao@intel.com,
rick.p.edgecombe@intel.com, mlevitsk@redhat.com,
weijiang.yang@intel.com, john.allen@amd.com
Subject: [PATCH 0/6] Introduce CET supervisor state support
Date: Fri, 31 May 2024 02:03:25 -0700 [thread overview]
Message-ID: <20240531090331.13713-1-weijiang.yang@intel.com> (raw)
This series spins off from CET KVM virtualization enabling series [1].
The purpose is to get these preparation work resolved ahead of KVM part
landing. There was a discussion about introducing CET supervisor state
support [2] [3].
CET supervisor state, i.e., IA32_PL{0,1,2}_SSP, are xsave-managed MSRs,
it can be enabled via IA32_XSS[bit 12]. KVM relies on host side CET
supervisor state support to fully enable guest CET MSR contents storage.
The benefits are: 1) No need to manually save/restore the 3 MSRs when
vCPU fpu context is sched in/out. 2) Omit manually swapping the three
MSRs at VM-Exit/VM-Entry for guest/host. 3) Make guest CET user/supervisor
states managed in a consistent manner within host kernel FPU framework.
This series tries to:
1) Fix existing issue regarding enabling guest supervisor states support.
2) Add CET supervisor state support in core kernel.
3) Introduce new FPU config for guest fpstate setup.
With the preparation work landed, for guest fpstate, we have xstate_bv[12]
== xcomp_bv[12] == 1 and CET supervisor state is saved/reloaded when
xsaves/xrstors executes on guest fpstate.
For non-guest/normal fpstate, we have xstate_bv[12] == xcomp_bv[12] == 0,
then HW can optimize xsaves/xrstors operations.
Patch1: Preserve guest supervisor xfeatures in __state_perm.
Patch2: Enable CET supervisor xstate support.
Patch3: Introduce kernel dynamic xfeature set.
Patch4: Initialize fpu_guest_cfg settings.
Patch5: Create guest fpstate with fpu_guest_cfg.
Patch6: Check invalid fpstate config before executes xsaves.
[1]: https://lore.kernel.org/all/20240219074733.122080-1-weijiang.yang@intel.com/
[2]: https://lore.kernel.org/all/ZM1jV3UPL0AMpVDI@google.com/
[3]: https://lore.kernel.org/all/2597a87b-1248-b8ce-ce60-94074bc67ea4@intel.com/
Sean Christopherson (1):
x86/fpu/xstate: Always preserve non-user xfeatures/flags in
__state_perm
Yang Weijiang (5):
x86/fpu/xstate: Add CET supervisor mode state support
x86/fpu/xstate: Introduce XFEATURE_MASK_KERNEL_DYNAMIC xfeature set
x86/fpu/xstate: Introduce fpu_guest_cfg for guest FPU configuration
x86/fpu/xstate: Create guest fpstate with guest specific config
x86/fpu/xstate: Warn if CET supervisor state is detected in normal
fpstate
arch/x86/include/asm/fpu/types.h | 16 ++++++++--
arch/x86/include/asm/fpu/xstate.h | 11 ++++---
arch/x86/kernel/fpu/core.c | 53 ++++++++++++++++++++++++-------
arch/x86/kernel/fpu/xstate.c | 35 +++++++++++++++-----
arch/x86/kernel/fpu/xstate.h | 2 ++
5 files changed, 90 insertions(+), 27 deletions(-)
base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
--
2.43.0
next reply other threads:[~2024-05-31 9:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-31 9:03 Yang Weijiang [this message]
2024-05-31 9:03 ` [PATCH 1/6] x86/fpu/xstate: Always preserve non-user xfeatures/flags in __state_perm Yang Weijiang
2024-05-31 9:03 ` [PATCH 2/6] x86/fpu/xstate: Add CET supervisor mode state support Yang Weijiang
2024-05-31 9:03 ` [PATCH 3/6] x86/fpu/xstate: Introduce XFEATURE_MASK_KERNEL_DYNAMIC xfeature set Yang Weijiang
2024-05-31 9:03 ` [PATCH 4/6] x86/fpu/xstate: Introduce fpu_guest_cfg for guest FPU configuration Yang Weijiang
2024-05-31 9:03 ` [PATCH 5/6] x86/fpu/xstate: Create guest fpstate with guest specific config Yang Weijiang
2024-05-31 9:03 ` [PATCH 6/6] x86/fpu/xstate: Warn if CET supervisor state is detected in normal fpstate Yang Weijiang
2024-07-09 3:17 ` [PATCH 0/6] Introduce CET supervisor state support Yang, Weijiang
2024-07-11 20:58 ` Dave Hansen
2024-07-11 22:11 ` Edgecombe, Rick P
2024-07-11 22:30 ` Dave Hansen
2024-07-11 22:55 ` Edgecombe, Rick P
2024-07-12 14:36 ` Dave Hansen
2024-07-12 6:27 ` Yang, Weijiang
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=20240531090331.13713-1-weijiang.yang@intel.com \
--to=weijiang.yang@intel.com \
--cc=chao.gao@intel.com \
--cc=dave.hansen@intel.com \
--cc=john.allen@amd.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mlevitsk@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rick.p.edgecombe@intel.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®