summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/kvm-asm-offsets.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-11-07 03:49:59 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2022-11-09 12:25:33 -0500
commite287bd005ad9d85dd6271dd795d3ecfb6bca46ad (patch)
tree10e0fac1c9d0378b3af82dbc882c695352177e93 /arch/x86/kvm/kvm-asm-offsets.c
parente61ab42de874c5af8c5d98b327c77a374d9e7da1 (diff)
downloadlinux-e287bd005ad9d85dd6271dd795d3ecfb6bca46ad.tar.gz
linux-e287bd005ad9d85dd6271dd795d3ecfb6bca46ad.tar.bz2
linux-e287bd005ad9d85dd6271dd795d3ecfb6bca46ad.zip
KVM: SVM: restore host save area from assembly
Allow access to the percpu area via the GS segment base, which is needed in order to access the saved host spec_ctrl value. In linux-next FILL_RETURN_BUFFER also needs to access percpu data. For simplicity, the physical address of the save area is added to struct svm_cpu_data. Cc: stable@vger.kernel.org Fixes: a149180fbcf3 ("x86: Add magic AMD return-thunk") Reported-by: Nathan Chancellor <nathan@kernel.org> Analyzed-by: Andrew Cooper <andrew.cooper3@citrix.com> Tested-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/kvm-asm-offsets.c')
-rw-r--r--arch/x86/kvm/kvm-asm-offsets.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/kvm-asm-offsets.c b/arch/x86/kvm/kvm-asm-offsets.c
index f83e88b85bf2..1b805cd24d66 100644
--- a/arch/x86/kvm/kvm-asm-offsets.c
+++ b/arch/x86/kvm/kvm-asm-offsets.c
@@ -18,6 +18,7 @@ static void __used common(void)
OFFSET(SVM_current_vmcb, vcpu_svm, current_vmcb);
OFFSET(SVM_vmcb01, vcpu_svm, vmcb01);
OFFSET(KVM_VMCB_pa, kvm_vmcb_info, pa);
+ OFFSET(SD_save_area_pa, svm_cpu_data, save_area_pa);
}
if (IS_ENABLED(CONFIG_KVM_INTEL)) {