RE: [PATCH v1 09/23] KVM: VMX: Switch FRED RSP0 between host and guest

2023-11-14 Thread Li, Xin3
> >> >diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h index > >> >f8c02bd37069..328a3447f064 100644 > >> >--- a/arch/x86/kvm/vmx/vmx.h > >> >+++ b/arch/x86/kvm/vmx/vmx.h > >> >@@ -276,6 +276,8 @@ struct vcpu_vmx { > >> > #ifdef CONFIG_X86_64 > >> > u64 msr_host_kerne

Re: [PATCH v1 09/23] KVM: VMX: Switch FRED RSP0 between host and guest

2023-11-13 Thread Chao Gao
>> >diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h index >> >f8c02bd37069..328a3447f064 100644 >> >--- a/arch/x86/kvm/vmx/vmx.h >> >+++ b/arch/x86/kvm/vmx/vmx.h >> >@@ -276,6 +276,8 @@ struct vcpu_vmx { >> > #ifdef CONFIG_X86_64 >> >u64 msr_host_kernel_gs_base; >

RE: [PATCH v1 09/23] KVM: VMX: Switch FRED RSP0 between host and guest

2023-11-13 Thread Li, Xin3
> >+if (cpu_feature_enabled(X86_FEATURE_FRED) && > >+guest_cpuid_has(&vmx->vcpu, X86_FEATURE_FRED)) { > > IIUC, vmx_prepare_switch_to_host() is called from IRQ-disabled context. using > guest_cpuid_has() in this context is not desired, see > lockdep_assert_irqs_enabled() in cpuid_entry

Re: [PATCH v1 09/23] KVM: VMX: Switch FRED RSP0 between host and guest

2023-11-12 Thread Chao Gao
On Wed, Nov 08, 2023 at 10:29:49AM -0800, Xin Li wrote: >Switch MSR_IA32_FRED_RSP0 between host and guest in >vmx_prepare_switch_to_{host,guest}(). > >MSR_IA32_FRED_RSP0 is used during ring 3 event delivery only, thus >KVM, running on ring 0, can run safely with guest FRED RSP0, i.e., >no need to s