From: "Yang, Weijiang" <weijiang.yang@intel.com>
To: Binbin Wu <binbin.wu@linux.intel.com>
Cc: <rick.p.edgecombe@intel.com>, <seanjc@google.com>,
<peterz@infradead.org>, <pbonzini@redhat.com>,
<kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<john.allen@amd.com>
Subject: Re: [PATCH v2 00/21] Enable CET Virtualization
Date: Mon, 24 Apr 2023 14:12:49 +0800 [thread overview]
Message-ID: <03de07df-da43-774f-3bb3-632455566053@intel.com> (raw)
In-Reply-To: <821ee57d-83cf-56ae-cc49-b8e8fcadf2ea@linux.intel.com>
On 4/23/2023 4:30 PM, Binbin Wu wrote:
>
> On 4/21/2023 9:45 PM, Yang Weijiang wrote:
[...]
>> Indirect Branch Tracking (IBT):
>> IBT adds new instrutions, ENDBRANCH{32|64}, to mark valid target
>> addresses
>
> /s/instrutions/instructions
Thanks for review, I'll fix these spelling issues.
>
>
>> of indirect branches (CALL, JMP etc...). If an indirect branch is
>> executed
>> and the next instruction is _not_ an ENDBRANCH, the processor
>> generates a #CP.
>
> IMHO, it's better to mention the behavior of the new instructions when
> IBT is not enabled or
> on the old platforms that don't support the feature.
Sure, will do it.
>
> [...]
>>
>> CET supervisor mode states are grouped into two categories - XSAVES
>> dependent
>> and non-dependent, the former includes MSR_IA32_PL{0,1,2}_SSP, the later
>> consists of MSR_IA32_S_CET and MSR_IA32_INTR_SSP_TBL. The XSAVES
>> dependent
>> MSR's save/restore depends on S_CET bit set in MSR_XSS. Since the
>> native series
>> doesn't enable S_CET support,
>
> Do you know the reason why native patch doesn't enable S_CET support?
This bit controls XSAVES for supervisor SHSTK, but the landing native
part is only for user SHSTK
so it doesn't need to touch it. Anyway, enabling the bit requires
additional FPU area size(3*8byte).
>
>
>> these s-SHSTK shadow stack pointers are invalid.
>>
>> Moveover, new VMCS fields, {GUEST|HOST}_{S_CET,SSP,INTR_SSP_TABL}, are
>> introduced for guest/host supervisor state switch. When CET
>> entry/exit load
>> bits are set, the guest/host MSR_IA32_{S_CET,INTR_SSP_TBL,SSP} are
>> swapped
>> automatically at vm-exit/entry. With these new fields, current guest
>> kernel
>> IBT enalbing doesn't depend on host {XSAVES|XRSTORS} support.
>
> /s/enalbing/enabling
>
>
>>
>>
>> Tests:
>> --------------------------------------------------------------------------
>>
>> This series passed basic CET user shadow stack test and kernel IBT
>> test in
>> L1 and L2 guest. It also passed CET KUT test which has been merged
>> there.
>>
>> Executed all KUT tests and KVM selftests against this series, all
>> test cases
>> passes except the vmx test, the failure is due to CR4_CET bit testing in
>> test_vmxon_bad_cr(). After add CR4_CET bit to skip list, the test
>> passed.
>> I'll send a patch to fix this issue later.
>>
>>
>> To run user shadow stack test and kernel IBT test in VM, you need an CET
>> capable platform, e.g., Sapphire Rapids server, and follow below
>> steps to
>> build host/guest kernel properly:
>>
>> 1. Buld host kernel. Patch this series to kernel tree and build kernel
>
> /s/Buld/Build
>
>
>> with CET capable gcc version(e.g., >=8.5.0).
>
> I guess these should be some compiler option(s), can you also list it
> here if any?
Please check gcc options: -fcf-protection=[full|branch|return|none]
>
>
>>
>> 2. Build guest kernel. Patch CET native series to kernel tree and opt-in
>> CONFIG_X86_KERNEL_IBT and CONFIG_X86_USER_SHADOW_STACK options.
>
> I guess guest kernel also needs to be built using CET capable tool
> chain with CET enabled?
Yes.
For kernel IBT testing, KERNEL_IBT option + CET enabled tool chain is a
must.
>
>
[...]
prev parent reply other threads:[~2023-04-24 6:13 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 13:45 Yang Weijiang
2023-04-21 13:45 ` [PATCH v2 01/21] x86/shstk: Add Kconfig option for shadow stack Yang Weijiang
2023-04-21 13:45 ` [PATCH v2 02/21] x86/cpufeatures: Add CPU feature flags for shadow stacks Yang Weijiang
2023-04-21 13:45 ` [PATCH v2 03/21] x86/cpufeatures: Enable CET CR4 bit for shadow stack Yang Weijiang
2023-04-21 13:45 ` [PATCH v2 04/21] x86/fpu/xstate: Introduce CET MSR and XSAVES supervisor states Yang Weijiang
2023-04-21 13:45 ` [PATCH v2 05/21] x86/fpu: Add helper for modifying xstate Yang Weijiang
2023-04-21 13:46 ` [PATCH v2 06/21] KVM:x86: Report XSS as to-be-saved if there are supported features Yang Weijiang
2023-04-21 13:46 ` [PATCH v2 07/21] KVM:x86: Refresh CPUID on write to guest MSR_IA32_XSS Yang Weijiang
2023-04-24 1:38 ` Binbin Wu
2023-04-24 6:15 ` Yang, Weijiang
2023-04-21 13:46 ` [PATCH v2 08/21] KVM:x86: Init kvm_caps.supported_xss with supported feature bits Yang Weijiang
2023-04-21 13:46 ` [PATCH v2 09/21] KVM:x86: Load guest FPU state when accessing xsaves-managed MSRs Yang Weijiang
2023-04-27 3:46 ` Binbin Wu
2023-04-27 15:57 ` Yang, Weijiang
2023-04-21 13:46 ` [PATCH v2 10/21] KVM:x86: Add #CP support in guest exception classification Yang Weijiang
2023-04-28 6:09 ` Binbin Wu
2023-05-04 3:41 ` Yang, Weijiang
2023-05-04 5:36 ` Binbin Wu
2023-05-04 6:59 ` Yang, Weijiang
2023-04-21 13:46 ` [PATCH v2 11/21] KVM:VMX: Introduce CET VMCS fields and control bits Yang Weijiang
2023-05-05 2:18 ` Binbin Wu
2023-05-05 2:22 ` Binbin Wu
2023-05-05 7:07 ` Yang, Weijiang
2023-04-21 13:46 ` [PATCH v2 12/21] KVM:x86: Add fault checks for guest CR4.CET setting Yang Weijiang
2023-05-05 5:01 ` Binbin Wu
2023-05-05 7:24 ` Yang, Weijiang
2023-04-21 13:46 ` [PATCH v2 13/21] KVM:VMX: Emulate reads and writes to CET MSRs Yang Weijiang
2023-04-21 13:46 ` [PATCH v2 14/21] KVM:VMX: Add a synthetic MSR to allow userspace VMM to access GUEST_SSP Yang Weijiang
2023-05-03 17:08 ` Edgecombe, Rick P
2023-05-04 1:30 ` Yang, Weijiang
2023-04-21 13:46 ` [PATCH v2 15/21] KVM:x86: Report CET MSRs as to-be-saved if CET is supported Yang Weijiang
2023-04-21 13:46 ` [PATCH v2 16/21] KVM:x86: Save/Restore GUEST_SSP to/from SMM state save area Yang Weijiang
2023-04-21 13:46 ` [PATCH v2 17/21] KVM:VMX: Pass through user CET MSRs to the guest Yang Weijiang
2023-04-21 13:46 ` [PATCH v2 18/21] KVM:x86: Enable CET virtualization for VMX and advertise to userspace Yang Weijiang
2023-04-21 13:46 ` [PATCH v2 19/21] KVM:nVMX: Enable user CET support for nested VMX Yang Weijiang
2023-04-21 13:46 ` [PATCH v2 20/21] KVM:x86: Enable supervisor IBT support for guest Yang Weijiang
2023-04-21 13:46 ` [PATCH v2 21/21] KVM:x86: Support CET supervisor shadow stack MSR access Yang Weijiang
2023-05-03 17:06 ` Edgecombe, Rick P
2023-05-04 1:11 ` Yang, Weijiang
2023-05-03 17:07 ` Edgecombe, Rick P
2023-05-04 1:20 ` Yang, Weijiang
2023-05-04 4:17 ` Edgecombe, Rick P
2023-05-04 6:51 ` Yang, Weijiang
2023-04-21 21:54 ` [PATCH v2 00/21] Enable CET Virtualization Mike Rapoport
2023-04-23 5:37 ` Yang, Weijiang
2023-04-24 18:22 ` John Allen
2023-04-22 13:02 ` Peter Zijlstra
2023-04-23 6:12 ` Yang, Weijiang
2023-04-23 8:30 ` Binbin Wu
2023-04-24 6:12 ` Yang, Weijiang [this message]
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=03de07df-da43-774f-3bb3-632455566053@intel.com \
--to=weijiang.yang@intel.com \
--cc=binbin.wu@linux.intel.com \
--cc=john.allen@amd.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rick.p.edgecombe@intel.com \
--cc=seanjc@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome