Skip to content

Commit

Permalink
target/i386: Remove pointless CPUArchState casts
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220305233415.64627-3-philippe.mathieu.daude@gmail.com>
  • Loading branch information
philmd committed Mar 6, 2022
1 parent b36e239 commit 95e862d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions target/i386/hax/hax-all.c
Expand Up @@ -222,7 +222,7 @@ int hax_init_vcpu(CPUState *cpu)

cpu->hax_vcpu = hax_global.vm->vcpus[cpu->cpu_index];
cpu->vcpu_dirty = true;
qemu_register_reset(hax_reset_vcpu_state, (CPUArchState *) (cpu->env_ptr));
qemu_register_reset(hax_reset_vcpu_state, cpu->env_ptr);

return ret;
}
Expand Down Expand Up @@ -669,7 +669,7 @@ void hax_cpu_synchronize_pre_loadvm(CPUState *cpu)

int hax_smp_cpu_exec(CPUState *cpu)
{
CPUArchState *env = (CPUArchState *) (cpu->env_ptr);
CPUArchState *env = cpu->env_ptr;
int fatal;
int ret;

Expand Down
14 changes: 7 additions & 7 deletions target/i386/nvmm/nvmm-all.c
Expand Up @@ -85,7 +85,7 @@ nvmm_set_segment(struct nvmm_x64_state_seg *nseg, const SegmentCache *qseg)
static void
nvmm_set_registers(CPUState *cpu)
{
CPUX86State *env = (CPUArchState *)cpu->env_ptr;
CPUX86State *env = cpu->env_ptr;
struct nvmm_machine *mach = get_nvmm_mach();
struct qemu_vcpu *qcpu = get_qemu_vcpu(cpu);
struct nvmm_vcpu *vcpu = &qcpu->vcpu;
Expand Down Expand Up @@ -222,7 +222,7 @@ nvmm_get_segment(SegmentCache *qseg, const struct nvmm_x64_state_seg *nseg)
static void
nvmm_get_registers(CPUState *cpu)
{
CPUX86State *env = (CPUArchState *)cpu->env_ptr;
CPUX86State *env = cpu->env_ptr;
struct nvmm_machine *mach = get_nvmm_mach();
struct qemu_vcpu *qcpu = get_qemu_vcpu(cpu);
struct nvmm_vcpu *vcpu = &qcpu->vcpu;
Expand Down Expand Up @@ -347,7 +347,7 @@ nvmm_get_registers(CPUState *cpu)
static bool
nvmm_can_take_int(CPUState *cpu)
{
CPUX86State *env = (CPUArchState *)cpu->env_ptr;
CPUX86State *env = cpu->env_ptr;
struct qemu_vcpu *qcpu = get_qemu_vcpu(cpu);
struct nvmm_vcpu *vcpu = &qcpu->vcpu;
struct nvmm_machine *mach = get_nvmm_mach();
Expand Down Expand Up @@ -394,7 +394,7 @@ nvmm_can_take_nmi(CPUState *cpu)
static void
nvmm_vcpu_pre_run(CPUState *cpu)
{
CPUX86State *env = (CPUArchState *)cpu->env_ptr;
CPUX86State *env = cpu->env_ptr;
struct nvmm_machine *mach = get_nvmm_mach();
struct qemu_vcpu *qcpu = get_qemu_vcpu(cpu);
struct nvmm_vcpu *vcpu = &qcpu->vcpu;
Expand Down Expand Up @@ -480,7 +480,7 @@ static void
nvmm_vcpu_post_run(CPUState *cpu, struct nvmm_vcpu_exit *exit)
{
struct qemu_vcpu *qcpu = get_qemu_vcpu(cpu);
CPUX86State *env = (CPUArchState *)cpu->env_ptr;
CPUX86State *env = cpu->env_ptr;
X86CPU *x86_cpu = X86_CPU(cpu);
uint64_t tpr;

Expand Down Expand Up @@ -652,7 +652,7 @@ static int
nvmm_handle_halted(struct nvmm_machine *mach, CPUState *cpu,
struct nvmm_vcpu_exit *exit)
{
CPUX86State *env = (CPUArchState *)cpu->env_ptr;
CPUX86State *env = cpu->env_ptr;
int ret = 0;

qemu_mutex_lock_iothread();
Expand Down Expand Up @@ -685,7 +685,7 @@ nvmm_inject_ud(struct nvmm_machine *mach, struct nvmm_vcpu *vcpu)
static int
nvmm_vcpu_loop(CPUState *cpu)
{
CPUX86State *env = (CPUArchState *)cpu->env_ptr;
CPUX86State *env = cpu->env_ptr;
struct nvmm_machine *mach = get_nvmm_mach();
struct qemu_vcpu *qcpu = get_qemu_vcpu(cpu);
struct nvmm_vcpu *vcpu = &qcpu->vcpu;
Expand Down
18 changes: 9 additions & 9 deletions target/i386/whpx/whpx-all.c
Expand Up @@ -221,7 +221,7 @@ static SegmentCache whpx_seg_h2q(const WHV_X64_SEGMENT_REGISTER *hs)

static int whpx_set_tsc(CPUState *cpu)
{
CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
CPUX86State *env = cpu->env_ptr;
WHV_REGISTER_NAME tsc_reg = WHvX64RegisterTsc;
WHV_REGISTER_VALUE tsc_val;
HRESULT hr;
Expand Down Expand Up @@ -260,7 +260,7 @@ static void whpx_set_registers(CPUState *cpu, int level)
{
struct whpx_state *whpx = &whpx_global;
struct whpx_vcpu *vcpu = get_whpx_vcpu(cpu);
CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
CPUX86State *env = cpu->env_ptr;
X86CPU *x86_cpu = X86_CPU(cpu);
struct whpx_register_set vcxt;
HRESULT hr;
Expand Down Expand Up @@ -428,7 +428,7 @@ static void whpx_set_registers(CPUState *cpu, int level)

static int whpx_get_tsc(CPUState *cpu)
{
CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
CPUX86State *env = cpu->env_ptr;
WHV_REGISTER_NAME tsc_reg = WHvX64RegisterTsc;
WHV_REGISTER_VALUE tsc_val;
HRESULT hr;
Expand All @@ -449,7 +449,7 @@ static void whpx_get_registers(CPUState *cpu)
{
struct whpx_state *whpx = &whpx_global;
struct whpx_vcpu *vcpu = get_whpx_vcpu(cpu);
CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
CPUX86State *env = cpu->env_ptr;
X86CPU *x86_cpu = X86_CPU(cpu);
struct whpx_register_set vcxt;
uint64_t tpr, apic_base;
Expand Down Expand Up @@ -760,7 +760,7 @@ static int whpx_handle_portio(CPUState *cpu,

static int whpx_handle_halt(CPUState *cpu)
{
CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
CPUX86State *env = cpu->env_ptr;
int ret = 0;

qemu_mutex_lock_iothread();
Expand All @@ -781,7 +781,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu)
HRESULT hr;
struct whpx_state *whpx = &whpx_global;
struct whpx_vcpu *vcpu = get_whpx_vcpu(cpu);
CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
CPUX86State *env = cpu->env_ptr;
X86CPU *x86_cpu = X86_CPU(cpu);
int irq;
uint8_t tpr;
Expand Down Expand Up @@ -903,7 +903,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu)
static void whpx_vcpu_post_run(CPUState *cpu)
{
struct whpx_vcpu *vcpu = get_whpx_vcpu(cpu);
CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
CPUX86State *env = cpu->env_ptr;
X86CPU *x86_cpu = X86_CPU(cpu);

env->eflags = vcpu->exit_ctx.VpContext.Rflags;
Expand All @@ -927,7 +927,7 @@ static void whpx_vcpu_post_run(CPUState *cpu)

static void whpx_vcpu_process_async_events(CPUState *cpu)
{
CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
CPUX86State *env = cpu->env_ptr;
X86CPU *x86_cpu = X86_CPU(cpu);
struct whpx_vcpu *vcpu = get_whpx_vcpu(cpu);

Expand Down Expand Up @@ -1333,7 +1333,7 @@ int whpx_init_vcpu(CPUState *cpu)
struct whpx_state *whpx = &whpx_global;
struct whpx_vcpu *vcpu = NULL;
Error *local_error = NULL;
CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
CPUX86State *env = cpu->env_ptr;
X86CPU *x86_cpu = X86_CPU(cpu);
UINT64 freq = 0;
int ret;
Expand Down

0 comments on commit 95e862d

Please sign in to comment.