[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/53] i386: hvf: Set env->eip in macvm_set_rip()
From: |
Paolo Bonzini |
Subject: |
[PULL 12/53] i386: hvf: Set env->eip in macvm_set_rip() |
Date: |
Mon, 6 Jul 2020 12:41:14 -0400 |
From: Roman Bolshakov <r.bolshakov@yadro.com>
cpu_synchronize_state() is currently no-op for hvf but BIOS will hang in
vAPIC option ROM when cpu_synchronize_state() is wired to
hvf_cpu_synchronize_state().
cpu_synchronize_state() state is called from vapic_write() during option
ROM initialization. It sets dirty flag on the cpu. macvm_set_rip() is
then invoked to advance IP after the I/O write to vAPIC port.
macvm_set_rip() only modifies VMCS, it doesn't change env->eip.
Therefore on the next iteration of vCPU loop, vcpu_dirty flag is checked
and hvf_put_registers() overwrites correct RIP in VMCS with the value of
env->eip that points to the I/O write instruction. Execution of the CPU
gets stuck on the instruction.
The issue can be avoided if eip doesn't contain stale value when dirty
flag is set on cpu.
Cc: Cameron Esfahani <dirty@apple.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Message-Id: <20200630102824.77604-2-r.bolshakov@yadro.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/hvf/vmx.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/i386/hvf/vmx.h b/target/i386/hvf/vmx.h
index ce2a1532d5..1e8b29bf7d 100644
--- a/target/i386/hvf/vmx.h
+++ b/target/i386/hvf/vmx.h
@@ -173,6 +173,7 @@ static inline void macvm_set_rip(CPUState *cpu, uint64_t
rip)
/* BUG, should take considering overlap.. */
wreg(cpu->hvf_fd, HV_X86_RIP, rip);
+ env->eip = rip;
/* after moving forward in rip, we need to clean INTERRUPTABILITY */
val = rvmcs(cpu->hvf_fd, VMCS_GUEST_INTERRUPTIBILITY);
--
2.26.2
- [PULL 00/53] Misc patches for QEMU 5.1 soft freeze, Paolo Bonzini, 2020/07/06
- [PULL 02/53] tests: Inject test name also when the test fails, Paolo Bonzini, 2020/07/06
- [PULL 04/53] qom: Introduce object_property_try_add_child(), Paolo Bonzini, 2020/07/06
- [PULL 05/53] tests/qmp-cmd-test: Add qmp/object-add-duplicate-id, Paolo Bonzini, 2020/07/06
- [PULL 03/53] util/qemu-error: prepend guest name to error message to identify affected VM owner, Paolo Bonzini, 2020/07/06
- [PULL 06/53] tests/qmp-cmd-test: Add qmp/object-add-failure-modes, Paolo Bonzini, 2020/07/06
- [PULL 10/53] KVM: add support for AMD nested live migration, Paolo Bonzini, 2020/07/06
- [PULL 07/53] hw/core/null-machine: Do not initialize unused chardev backends, Paolo Bonzini, 2020/07/06
- [PULL 08/53] target/i386: set SSE FTZ in correct floating-point state, Paolo Bonzini, 2020/07/06
- [PULL 12/53] i386: hvf: Set env->eip in macvm_set_rip(),
Paolo Bonzini <=
- [PULL 14/53] i386: hvf: Add hvf_cpu_synchronize_pre_loadvm(), Paolo Bonzini, 2020/07/06
- [PULL 09/53] target/i386: fix IEEE SSE floating-point exception raising, Paolo Bonzini, 2020/07/06
- [PULL 17/53] i386: hvf: Don't duplicate register reset, Paolo Bonzini, 2020/07/06
- [PULL 18/53] i386: hvf: Clean up synchronize functions, Paolo Bonzini, 2020/07/06
- [PULL 21/53] MAINTAINERS: Add an 'overall' entry for accelerators, Paolo Bonzini, 2020/07/06
- [PULL 22/53] MAINTAINERS: Cover the HAX accelerator stub, Paolo Bonzini, 2020/07/06
- [PULL 23/53] Makefile: Remove dangerous EOL trailing backslash, Paolo Bonzini, 2020/07/06
- [PULL 24/53] Makefile: Write MINIKCONF variables as one entry per line, Paolo Bonzini, 2020/07/06
- [PULL 16/53] i386: hvf: Move Guest LMA reset to macvm_set_cr0(), Paolo Bonzini, 2020/07/06
- [PULL 25/53] accel/Kconfig: Extract accel selectors into their own config, Paolo Bonzini, 2020/07/06