x86/svm: Fix svm_vmcb_dump() when used in current context
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 17 Jun 2019 12:17:57 +0000 (12:17 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 19 Jun 2019 18:54:22 +0000 (19:54 +0100)
commit7d161f6537557520b52c2c7fb8321460f37ff933
tree2d4a5530c3c742f4d7c60eb27788ffb45167d632
parent1c9460595c60c432244083a4401f36f9f374a1c0
x86/svm: Fix svm_vmcb_dump() when used in current context

VMExit doesn't switch all state.  The FS/GS/TS/LDTR/GSBASE segment
information, and SYSCALL/SYSENTER MSRs may still be cached in hardware, rather
than up-to-date in the VMCB.

Export svm_sync_vmcb() via svmdebug.h so svm_vmcb_dump() can use it, and bring
the VMCB into sync in current context.

As a minor optimisation, switch svm_sync_vmcb() to use svm_vm{load,save}_pa(),
as svm->vmcb_pa is always correct, and this avoids a redundant __pa()
translation behind the scenes.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Brian Woods <brian.woods@amd.com>
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/svm/svmdebug.c
xen/include/asm-x86/hvm/svm/svmdebug.h