x86/svm: Fix svm_vmcb_dump() when used in current context
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 29 Oct 2019 13:33:52 +0000 (14:33 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 29 Oct 2019 13:33:52 +0000 (14:33 +0100)
commite33ce327e8dc61bd47d4a025709bd606ec1038d1
tree405328411a466f4ff452afdd169edea619f5d6c6
parent28ed7a571fc60e5cae89031b267c1b83bbd9bddd
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>
master commit: 7d161f6537557520b52c2c7fb8321460f37ff933
master date: 2019-06-19 19:54:22 +0100
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/svm/svmdebug.c
xen/include/asm-x86/hvm/svm/svmdebug.h