x86/hvm: Don't let hvm_set_efer() raise #GP itself
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 24 Feb 2017 09:22:09 +0000 (09:22 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 24 Feb 2017 14:34:41 +0000 (14:34 +0000)
commitad8aafe287eb015c0717f79d8cd60b4813bea914
treed88d100a476acf9afeb7cb9249de238869ff9042
parente55e6b641bba24fcaddb1914017b59197eaa92b9
x86/hvm: Don't let hvm_set_efer() raise #GP itself

c/s 49de10f3c "x86/hvm: Don't raise #GP behind the emulators back for MSR
accesses" missed an edge case.

hvm_set_efer() raises #GP itself, so deliberately avoided the goto gp_fault
path in hvm_msr_write_intercept().

With the above change, guest updates to MSR_EFER which end up faulting raises
hvm_msr_write_intercept() returning X86EMUL_EXCEPTION.  The second #GP gets
combined to #DF and handed back to the guest.

Update hvm_set_efer() to avoid raising #GP, requiring its callers to do so.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/svm/nestedsvm.c