]> xenbits.xensource.com Git - xen.git/commit
SVM: Add union intstat_t for offset 68h in vmcb struct
authorPu Wen <puwen@hygon.cn>
Thu, 26 Mar 2020 13:44:30 +0000 (21:44 +0800)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 26 Mar 2020 18:58:56 +0000 (18:58 +0000)
commit51900bb0288e1db213d218079c11003b5bb2426f
tree56ff88b4ce6452b96eb31a0037b7fc1446f7f20c
parent9267a439c10a619a289528987ddeff1bd2c3a643
SVM: Add union intstat_t for offset 68h in vmcb struct

According to chapter "Appendix B Layout of VMCB" in the new version
(v3.32) AMD64 APM[1], bit 1 of the VMCB offset 68h is defined as
GUEST_INTERRUPT_MASK.

In current xen codes, it use whole u64 interrupt_shadow to setup
interrupt shadow, which will misuse other bit in VMCB offset 68h
as part of interrupt_shadow, causing svm_get_interrupt_shadow() to
mistake the guest having interrupts enabled as being in an interrupt
shadow.  This has been observed to cause SeaBIOS to hang on boot.

Add union intstat_t for VMCB offset 68h and fix codes to only use
bit 0 as intr_shadow according to the new APM description.

Reference:
[1] https://www.amd.com/system/files/TechDocs/24593.pdf

Signed-off-by: Pu Wen <puwen@hygon.cn>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/svm/nestedsvm.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/svm/svmdebug.c
xen/include/asm-x86/hvm/svm/vmcb.h