accel/hvf: Rename hvf_put|get_registers -> hvf_arch_put|get_registers

hvf_put_registers() and hvf_get_registers() are implemented per
target, rename them using the 'hvf_arch_' prefix following the
per target pattern.

Since they call hv_vcpu_set_reg() / hv_vcpu_get_reg(), mention
they must be called on the vCPU.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Mads Ynddal <mads@ynddal.dk>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé 2025-10-28 06:41:42 +01:00 committed by Peter Maydell
parent 963f1576c0
commit 1182ede151
5 changed files with 13 additions and 9 deletions

View file

@ -81,7 +81,7 @@ 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->vcpu_dirty) {
hvf_get_registers(cpu);
hvf_arch_get_registers(cpu);
cpu->vcpu_dirty = true;
}
}

View file

@ -74,12 +74,14 @@ hv_return_t hvf_arch_vm_create(MachineState *ms, uint32_t pa_range);
int hvf_arch_init_vcpu(CPUState *cpu);
void hvf_arch_vcpu_destroy(CPUState *cpu);
hvf_slot *hvf_find_overlap_slot(uint64_t, uint64_t);
int hvf_put_registers(CPUState *);
int hvf_get_registers(CPUState *);
void hvf_kick_vcpu_thread(CPUState *cpu);
/* Must be called by the owning thread */
int hvf_arch_vcpu_exec(CPUState *);
/* Must be called by the owning thread */
int hvf_arch_put_registers(CPUState *);
/* Must be called by the owning thread */
int hvf_arch_get_registers(CPUState *);
struct hvf_sw_breakpoint {
vaddr pc;

View file

@ -424,7 +424,7 @@ static const hv_sys_reg_t hvf_sreg_list[] = {
#undef DEF_SYSREG
int hvf_get_registers(CPUState *cpu)
int hvf_arch_get_registers(CPUState *cpu)
{
ARMCPU *arm_cpu = ARM_CPU(cpu);
CPUARMState *env = &arm_cpu->env;
@ -564,7 +564,7 @@ int hvf_get_registers(CPUState *cpu)
return 0;
}
int hvf_put_registers(CPUState *cpu)
int hvf_arch_put_registers(CPUState *cpu)
{
ARMCPU *arm_cpu = ARM_CPU(cpu);
CPUARMState *env = &arm_cpu->env;
@ -692,11 +692,12 @@ int hvf_put_registers(CPUState *cpu)
static void flush_cpu_state(CPUState *cpu)
{
if (cpu->vcpu_dirty) {
hvf_put_registers(cpu);
hvf_arch_put_registers(cpu);
cpu->vcpu_dirty = false;
}
}
/* Must be called by the owning thread */
static void hvf_set_reg(CPUState *cpu, int rt, uint64_t val)
{
hv_return_t r;
@ -709,6 +710,7 @@ static void hvf_set_reg(CPUState *cpu, int rt, uint64_t val)
}
}
/* Must be called by the owning thread */
static uint64_t hvf_get_reg(CPUState *cpu, int rt)
{
uint64_t val = 0;

View file

@ -734,7 +734,7 @@ int hvf_arch_vcpu_exec(CPUState *cpu)
do {
if (cpu->vcpu_dirty) {
hvf_put_registers(cpu);
hvf_arch_put_registers(cpu);
cpu->vcpu_dirty = false;
}

View file

@ -236,7 +236,7 @@ void hvf_get_msrs(CPUState *cs)
env->tsc = rdtscp() + rvmcs(cs->accel->fd, VMCS_TSC_OFFSET);
}
int hvf_put_registers(CPUState *cs)
int hvf_arch_put_registers(CPUState *cs)
{
X86CPU *x86cpu = X86_CPU(cs);
CPUX86State *env = &x86cpu->env;
@ -280,7 +280,7 @@ int hvf_put_registers(CPUState *cs)
return 0;
}
int hvf_get_registers(CPUState *cs)
int hvf_arch_get_registers(CPUState *cs)
{
X86CPU *x86cpu = X86_CPU(cs);
CPUX86State *env = &x86cpu->env;