lkml.org 
[lkml]   [2022]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v8 071/103] KVM: TDX: restore debug store when TD exit
    Date
    From: Isaku Yamahata <isaku.yamahata@intel.com>

    Because debug store is clobbered, restore it on TD exit.

    Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    ---
    arch/x86/events/intel/ds.c | 1 +
    arch/x86/kvm/vmx/tdx.c | 1 +
    2 files changed, 2 insertions(+)

    diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
    index 376cc3d66094..cdba4227ad3b 100644
    --- a/arch/x86/events/intel/ds.c
    +++ b/arch/x86/events/intel/ds.c
    @@ -2256,3 +2256,4 @@ void perf_restore_debug_store(void)

    wrmsrl(MSR_IA32_DS_AREA, (unsigned long)ds);
    }
    +EXPORT_SYMBOL_GPL(perf_restore_debug_store);
    diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
    index 2c5fda9e213e..2354889df571 100644
    --- a/arch/x86/kvm/vmx/tdx.c
    +++ b/arch/x86/kvm/vmx/tdx.c
    @@ -650,6 +650,7 @@ fastpath_t tdx_vcpu_run(struct kvm_vcpu *vcpu)
    tdx_vcpu_enter_exit(vcpu, tdx);

    tdx_user_return_update_cache();
    + perf_restore_debug_store();
    tdx_restore_host_xsave_state(vcpu);
    tdx->host_state_need_restore = true;

    --
    2.25.1
    \
     
     \ /
      Last update: 2022-08-08 00:06    [W:3.569 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site