[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/38] accel/nvmm: Use accel-specific per-vcpu @dirty field
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 21/38] accel/nvmm: Use accel-specific per-vcpu @dirty field |
Date: |
Fri, 26 Apr 2024 21:41:41 +0200 |
NVMM has a specific use of the CPUState::vcpu_dirty field
(CPUState::vcpu_dirty is not used by common code).
To make this field accel-specific, add and use a new
@dirty variable in the AccelCPUState structure.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20240424174506.326-3-philmd@linaro.org>
---
target/i386/nvmm/nvmm-all.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c
index 49a3a3b916..f9cced53b3 100644
--- a/target/i386/nvmm/nvmm-all.c
+++ b/target/i386/nvmm/nvmm-all.c
@@ -30,6 +30,7 @@ struct AccelCPUState {
struct nvmm_vcpu vcpu;
uint8_t tpr;
bool stop;
+ bool dirty;
/* Window-exiting for INTs/NMIs. */
bool int_window_exit;
@@ -507,7 +508,7 @@ nvmm_io_callback(struct nvmm_io *io)
}
/* Needed, otherwise infinite loop. */
- current_cpu->vcpu_dirty = false;
+ current_cpu->accel->dirty = false;
}
static void
@@ -516,7 +517,7 @@ nvmm_mem_callback(struct nvmm_mem *mem)
cpu_physical_memory_rw(mem->gpa, mem->data, mem->size, mem->write);
/* Needed, otherwise infinite loop. */
- current_cpu->vcpu_dirty = false;
+ current_cpu->accel->dirty = false;
}
static struct nvmm_assist_callbacks nvmm_callbacks = {
@@ -726,9 +727,9 @@ nvmm_vcpu_loop(CPUState *cpu)
* Inner VCPU loop.
*/
do {
- if (cpu->vcpu_dirty) {
+ if (cpu->accel->dirty) {
nvmm_set_registers(cpu);
- cpu->vcpu_dirty = false;
+ cpu->accel->dirty = false;
}
if (qcpu->stop) {
@@ -826,32 +827,32 @@ static void
do_nvmm_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data arg)
{
nvmm_get_registers(cpu);
- cpu->vcpu_dirty = true;
+ cpu->accel->dirty = true;
}
static void
do_nvmm_cpu_synchronize_post_reset(CPUState *cpu, run_on_cpu_data arg)
{
nvmm_set_registers(cpu);
- cpu->vcpu_dirty = false;
+ cpu->accel->dirty = false;
}
static void
do_nvmm_cpu_synchronize_post_init(CPUState *cpu, run_on_cpu_data arg)
{
nvmm_set_registers(cpu);
- cpu->vcpu_dirty = false;
+ cpu->accel->dirty = false;
}
static void
do_nvmm_cpu_synchronize_pre_loadvm(CPUState *cpu, run_on_cpu_data arg)
{
- cpu->vcpu_dirty = true;
+ cpu->accel->dirty = true;
}
void nvmm_cpu_synchronize_state(CPUState *cpu)
{
- if (!cpu->vcpu_dirty) {
+ if (!cpu->accel->dirty) {
run_on_cpu(cpu, do_nvmm_cpu_synchronize_state, RUN_ON_CPU_NULL);
}
}
@@ -981,7 +982,7 @@ nvmm_init_vcpu(CPUState *cpu)
}
}
- cpu->vcpu_dirty = true;
+ cpu->accel->dirty = true;
cpu->accel = qcpu;
return 0;
--
2.41.0
- [PULL 14/38] target/i386: Include missing 'exec/exec-all.h' header, (continued)
- [PULL 14/38] target/i386: Include missing 'exec/exec-all.h' header, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 17/38] accel/tcg: Include missing headers in 'tb-jmp-cache.h', Philippe Mathieu-Daudé, 2024/04/26
- [PULL 15/38] accel/tcg: Un-inline retaddr helpers to 'user-retaddr.h', Philippe Mathieu-Daudé, 2024/04/26
- [PULL 16/38] accel/tcg: Include missing 'hw/core/cpu.h' header, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 19/38] accel/tcg: Rename helper-head.h -> helper-head.h.inc, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 22/38] accel/hvf: Use accel-specific per-vcpu @dirty field, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 18/38] accel/tcg: Rename load-extract/store-insert headers using .h.inc suffix, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 20/38] accel/whpx: Use accel-specific per-vcpu @dirty field, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 21/38] accel/nvmm: Use accel-specific per-vcpu @dirty field,
Philippe Mathieu-Daudé <=
- [PULL 24/38] exec/cpu-all: Remove unused 'qemu/thread.h' header, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 25/38] exec/cpu-all: Remove unused tswapls() definitions, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 23/38] exec/cpu-all: Reduce 'qemu/rcu.h' header inclusion, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 26/38] exec: Declare target_words_bigendian() in 'exec/tswap.h', Philippe Mathieu-Daudé, 2024/04/26
- [PULL 27/38] exec: Move [b]tswapl() declarations to 'exec/user/tswap-target.h', Philippe Mathieu-Daudé, 2024/04/26
- [PULL 28/38] exec/user: Do not include 'cpu.h' in 'abitypes.h', Philippe Mathieu-Daudé, 2024/04/26
- [PULL 29/38] exec: Declare abi_ptr type in its own 'abi_ptr.h' header, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 30/38] exec: Declare MMUAccessType type in 'mmu-access-type.h' header, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 31/38] exec: Declare CPUBreakpoint/CPUWatchpoint type in 'breakpoint.h' header, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 32/38] exec: Restrict TCG specific declarations of 'cputlb.h', Philippe Mathieu-Daudé, 2024/04/26