On Thu, Aug 03, 2023 at 12:27:28AM -0400, Yang Weijiang wrote:I need to do some experiments to get the details, but now expect some kind
Make PL{0,1,2}_SSP as write-intercepted to detect whetherWhat would happen if guest tries to use XRSTORS to load S_CET state from a
guest is using these MSRs. Disable intercept to the MSRs
if they're written with non-zero values. KVM does save/
reload for the MSRs only if they're used by guest.
xsave area without any writes to the PL0-2_SSP (i.e., at that point, writes to
the MSRs are still intercepted)?
Oh, yes, it's not necessary after moving the reload logic to kvm_x86_prepare_switch_to_guest().@@ -2420,6 +2432,14 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)Is it necessary to do the wrmsl()?
else
vmx->pt_desc.guest.addr_a[index / 2] = data;
break;
+ case MSR_IA32_PL0_SSP ... MSR_IA32_PL2_SSP:
+ if (kvm_set_msr_common(vcpu, msr_info))
+ return 1;
+ if (data) {
+ vmx_disable_write_intercept_sss_msr(vcpu);
+ wrmsrl(msr_index, data);
looks the next kvm_x86_prepare_switch_to_guest() will load PL0-2_SSP from the
caching values.