summaryrefslogtreecommitdiffstats
path: root/target/i386/hvf-utils/vmx.h
diff options
context:
space:
mode:
authorSergio Andres Gomez Del Real2017-09-13 11:05:21 +0200
committerPaolo Bonzini2017-12-22 15:01:48 +0100
commitb7394c8394d38cb38b6db14eb431cac7a91e7140 (patch)
tree68ed6476103dfb40f8e214d33f2a2ad362f0434d /target/i386/hvf-utils/vmx.h
parenti386: hvf: implement vga dirty page tracking (diff)
downloadqemu-b7394c8394d38cb38b6db14eb431cac7a91e7140.tar.gz
qemu-b7394c8394d38cb38b6db14eb431cac7a91e7140.tar.xz
qemu-b7394c8394d38cb38b6db14eb431cac7a91e7140.zip
i386: hvf: refactor event injection code for hvf
This patch refactors the event-injection code for hvf by using the appropriate fields already provided by CPUX86State. At vmexit, it fills these fields so that hvf_inject_interrupts can just retrieve them without calling into hvf. Signed-off-by: Sergio Andres Gomez Del Real <Sergio.G.DelReal@gmail.com> Message-Id: <20170913090522.4022-14-Sergio.G.DelReal@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/hvf-utils/vmx.h')
-rw-r--r--target/i386/hvf-utils/vmx.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/target/i386/hvf-utils/vmx.h b/target/i386/hvf-utils/vmx.h
index 44a5c6d554..102075d0d4 100644
--- a/target/i386/hvf-utils/vmx.h
+++ b/target/i386/hvf-utils/vmx.h
@@ -181,6 +181,10 @@ static inline void macvm_set_rip(CPUState *cpu, uint64_t rip)
static inline void vmx_clear_nmi_blocking(CPUState *cpu)
{
+ X86CPU *x86_cpu = X86_CPU(cpu);
+ CPUX86State *env = &x86_cpu->env;
+
+ env->hflags2 &= ~HF2_NMI_MASK;
uint32_t gi = (uint32_t) rvmcs(cpu->hvf_fd, VMCS_GUEST_INTERRUPTIBILITY);
gi &= ~VMCS_INTERRUPTIBILITY_NMI_BLOCKING;
wvmcs(cpu->hvf_fd, VMCS_GUEST_INTERRUPTIBILITY, gi);
@@ -188,6 +192,10 @@ static inline void vmx_clear_nmi_blocking(CPUState *cpu)
static inline void vmx_set_nmi_blocking(CPUState *cpu)
{
+ X86CPU *x86_cpu = X86_CPU(cpu);
+ CPUX86State *env = &x86_cpu->env;
+
+ env->hflags2 |= HF2_NMI_MASK;
uint32_t gi = (uint32_t)rvmcs(cpu->hvf_fd, VMCS_GUEST_INTERRUPTIBILITY);
gi |= VMCS_INTERRUPTIBILITY_NMI_BLOCKING;
wvmcs(cpu->hvf_fd, VMCS_GUEST_INTERRUPTIBILITY, gi);