mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-02-11 19:39:26 -07:00
accel/hvf: Replace @dirty field by generic CPUState::vcpu_dirty field
No need for accel-specific @dirty field when we have a generic one in CPUState. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Message-Id: <20250703173248.44995-19-philmd@linaro.org>
This commit is contained in:
parent
332ad068a0
commit
93bbbcb8d6
5 changed files with 10 additions and 11 deletions
|
|
@ -79,15 +79,15 @@ hvf_slot *hvf_find_overlap_slot(uint64_t start, uint64_t size)
|
|||
|
||||
static void do_hvf_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data arg)
|
||||
{
|
||||
if (!cpu->accel->dirty) {
|
||||
if (!cpu->vcpu_dirty) {
|
||||
hvf_get_registers(cpu);
|
||||
cpu->accel->dirty = true;
|
||||
cpu->vcpu_dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void hvf_cpu_synchronize_state(CPUState *cpu)
|
||||
{
|
||||
if (!cpu->accel->dirty) {
|
||||
if (!cpu->vcpu_dirty) {
|
||||
run_on_cpu(cpu, do_hvf_cpu_synchronize_state, RUN_ON_CPU_NULL);
|
||||
}
|
||||
}
|
||||
|
|
@ -96,7 +96,7 @@ static void do_hvf_cpu_synchronize_set_dirty(CPUState *cpu,
|
|||
run_on_cpu_data arg)
|
||||
{
|
||||
/* QEMU state is the reference, push it to HVF now and on next entry */
|
||||
cpu->accel->dirty = true;
|
||||
cpu->vcpu_dirty = true;
|
||||
}
|
||||
|
||||
static void hvf_cpu_synchronize_post_reset(CPUState *cpu)
|
||||
|
|
@ -150,8 +150,8 @@ static int hvf_init_vcpu(CPUState *cpu)
|
|||
#else
|
||||
r = hv_vcpu_create(&cpu->accel->fd, HV_VCPU_DEFAULT);
|
||||
#endif
|
||||
cpu->accel->dirty = true;
|
||||
assert_hvf_ok(r);
|
||||
cpu->vcpu_dirty = true;
|
||||
|
||||
cpu->accel->guest_debug_enabled = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ struct AccelCPUState {
|
|||
bool vtimer_masked;
|
||||
sigset_t unblock_ipi_mask;
|
||||
bool guest_debug_enabled;
|
||||
bool dirty;
|
||||
};
|
||||
|
||||
void assert_hvf_ok_impl(hv_return_t ret, const char *file, unsigned int line,
|
||||
|
|
|
|||
|
|
@ -813,9 +813,9 @@ int hvf_put_registers(CPUState *cpu)
|
|||
|
||||
static void flush_cpu_state(CPUState *cpu)
|
||||
{
|
||||
if (cpu->accel->dirty) {
|
||||
if (cpu->vcpu_dirty) {
|
||||
hvf_put_registers(cpu);
|
||||
cpu->accel->dirty = false;
|
||||
cpu->vcpu_dirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -733,9 +733,9 @@ int hvf_vcpu_exec(CPUState *cpu)
|
|||
}
|
||||
|
||||
do {
|
||||
if (cpu->accel->dirty) {
|
||||
if (cpu->vcpu_dirty) {
|
||||
hvf_put_registers(cpu);
|
||||
cpu->accel->dirty = false;
|
||||
cpu->vcpu_dirty = false;
|
||||
}
|
||||
|
||||
if (hvf_inject_interrupts(cpu)) {
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@ int hvf_process_events(CPUState *cs)
|
|||
X86CPU *cpu = X86_CPU(cs);
|
||||
CPUX86State *env = &cpu->env;
|
||||
|
||||
if (!cs->accel->dirty) {
|
||||
if (!cs->vcpu_dirty) {
|
||||
/* light weight sync for CPU_INTERRUPT_HARD and IF_MASK */
|
||||
env->eflags = rreg(cs->accel->fd, HV_X86_RFLAGS);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue