[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 22/61] WHPX: Use proper synchronization primitives while processin
From: |
Paolo Bonzini |
Subject: |
[PULL 22/61] WHPX: Use proper synchronization primitives while processing |
Date: |
Mon, 16 Mar 2020 22:26:49 +0100 |
From: Sunil Muthuswamy <address@hidden>
WHPX wasn't using the proper synchronization primitives while
processing async events, which can cause issues with SMP.
Signed-off-by: Sunil Muthuswamy <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
target/i386/whpx-all.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c
index cb863b7..c78baac 100644
--- a/target/i386/whpx-all.c
+++ b/target/i386/whpx-all.c
@@ -905,9 +905,8 @@ static void whpx_vcpu_process_async_events(CPUState *cpu)
if ((cpu->interrupt_request & CPU_INTERRUPT_INIT) &&
!(env->hflags & HF_SMM_MASK)) {
-
+ whpx_cpu_synchronize_state(cpu);
do_cpu_init(x86_cpu);
- cpu->vcpu_dirty = true;
vcpu->interruptable = true;
}
@@ -923,17 +922,13 @@ static void whpx_vcpu_process_async_events(CPUState *cpu)
}
if (cpu->interrupt_request & CPU_INTERRUPT_SIPI) {
- if (!cpu->vcpu_dirty) {
- whpx_get_registers(cpu);
- }
+ whpx_cpu_synchronize_state(cpu);
do_cpu_sipi(x86_cpu);
}
if (cpu->interrupt_request & CPU_INTERRUPT_TPR) {
cpu->interrupt_request &= ~CPU_INTERRUPT_TPR;
- if (!cpu->vcpu_dirty) {
- whpx_get_registers(cpu);
- }
+ whpx_cpu_synchronize_state(cpu);
apic_handle_tpr_access_report(x86_cpu->apic_state, env->eip,
env->tpr_access_type);
}
@@ -1125,8 +1120,10 @@ static int whpx_vcpu_run(CPUState *cpu)
static void do_whpx_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data arg)
{
- whpx_get_registers(cpu);
- cpu->vcpu_dirty = true;
+ if (!cpu->vcpu_dirty) {
+ whpx_get_registers(cpu);
+ cpu->vcpu_dirty = true;
+ }
}
static void do_whpx_cpu_synchronize_post_reset(CPUState *cpu,
--
1.8.3.1
- [PULL 14/61] configure: Fix building with SASL on Windows, (continued)
- [PULL 14/61] configure: Fix building with SASL on Windows, Paolo Bonzini, 2020/03/16
- [PULL 13/61] modules: load modules from versioned /var/run dir, Paolo Bonzini, 2020/03/16
- [PULL 16/61] memory: Fix start offset for bitmap log_clear hook, Paolo Bonzini, 2020/03/16
- [PULL 12/61] build-sys: do not make qemu-ga link with pixman, Paolo Bonzini, 2020/03/16
- [PULL 15/61] tests/docker: Install SASL library to extend code coverage on amd64, Paolo Bonzini, 2020/03/16
- [PULL 19/61] ich9: Simplify ich9_lpc_initfn, Paolo Bonzini, 2020/03/16
- [PULL 18/61] ich9: fix getter type for sci_int property, Paolo Bonzini, 2020/03/16
- [PULL 17/61] qom/object: enable setter for uint types, Paolo Bonzini, 2020/03/16
- [PULL 21/61] i386: Fix GCC warning with snprintf when HAX is enabled, Paolo Bonzini, 2020/03/16
- [PULL 20/61] qom/object: Use common get/set uint helpers, Paolo Bonzini, 2020/03/16
- [PULL 22/61] WHPX: Use proper synchronization primitives while processing,
Paolo Bonzini <=
- [PULL 23/61] Makefile: Align 'help' target output, Paolo Bonzini, 2020/03/16
- [PULL 24/61] Makefile: Let the 'help' target list the tools targets, Paolo Bonzini, 2020/03/16
- [PULL 25/61] hw/audio/fmopl: Move ENV_CURVE to .heap to save 32KiB of .bss, Paolo Bonzini, 2020/03/16
- [PULL 26/61] hw/audio/intel-hda: Use memory region alias to reduce .rodata by 4.34MB, Paolo Bonzini, 2020/03/16
- [PULL 27/61] hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB, Paolo Bonzini, 2020/03/16
- [PULL 28/61] ui/curses: Make control_characters[] array const, Paolo Bonzini, 2020/03/16
- [PULL 32/61] Use -isystem for linux-headers dir, Paolo Bonzini, 2020/03/16
- [PULL 29/61] ui/curses: Move arrays to .heap to save 74KiB of .bss, Paolo Bonzini, 2020/03/16
- [PULL 31/61] softmmu/vl.c: Handle '-cpu help' and '-device help' before 'no default machine', Paolo Bonzini, 2020/03/16
- [PULL 33/61] exec/rom_reset: Free rom data during inmigrate skip, Paolo Bonzini, 2020/03/16