* [PATCH 0/2] accel|target: Remove pointless CPUArchState casts
@ 2022-03-05 23:34 Philippe Mathieu-Daudé
2022-03-05 23:34 ` [PATCH 1/2] accel/tcg: " Philippe Mathieu-Daudé
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-03-05 23:34 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, Richard Henderson, Philippe Mathieu-Daudé,
Kamil Rytarowski, haxm-team, Colin Xu, Paolo Bonzini,
Sunil Muthuswamy, Reinoud Zandijk, Wenchao Wang
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Now than we can use the abstract CPUArchState, let's clean up.
Based-on: <20220214183144.27402-1-f4bug@amsat.org>
target: Use ArchCPU & CPUArchState as abstract interface to target CPU
Philippe Mathieu-Daudé (2):
accel/tcg: Remove pointless CPUArchState casts
target/i386: Remove pointless CPUArchState casts
accel/tcg/cpu-exec.c | 4 ++--
target/i386/hax/hax-all.c | 4 ++--
target/i386/nvmm/nvmm-all.c | 14 +++++++-------
target/i386/whpx/whpx-all.c | 18 +++++++++---------
4 files changed, 20 insertions(+), 20 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] accel/tcg: Remove pointless CPUArchState casts
2022-03-05 23:34 [PATCH 0/2] accel|target: Remove pointless CPUArchState casts Philippe Mathieu-Daudé
@ 2022-03-05 23:34 ` Philippe Mathieu-Daudé
2022-03-05 23:34 ` [PATCH 2/2] target/i386: " Philippe Mathieu-Daudé
2022-03-06 4:43 ` [PATCH 0/2] accel|target: " Richard Henderson
2 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-03-05 23:34 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, Richard Henderson, Philippe Mathieu-Daudé,
Kamil Rytarowski, haxm-team, Colin Xu, Paolo Bonzini,
Sunil Muthuswamy, Reinoud Zandijk, Wenchao Wang
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
accel/tcg/cpu-exec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index c68270f794..c997c2e8e0 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -422,7 +422,7 @@ static void cpu_exec_exit(CPUState *cpu)
void cpu_exec_step_atomic(CPUState *cpu)
{
- CPUArchState *env = (CPUArchState *)cpu->env_ptr;
+ CPUArchState *env = cpu->env_ptr;
TranslationBlock *tb;
target_ulong cs_base, pc;
uint32_t flags, cflags;
@@ -532,7 +532,7 @@ TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc,
struct tb_desc desc;
uint32_t h;
- desc.env = (CPUArchState *)cpu->env_ptr;
+ desc.env = cpu->env_ptr;
desc.cs_base = cs_base;
desc.flags = flags;
desc.cflags = cflags;
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] target/i386: Remove pointless CPUArchState casts
2022-03-05 23:34 [PATCH 0/2] accel|target: Remove pointless CPUArchState casts Philippe Mathieu-Daudé
2022-03-05 23:34 ` [PATCH 1/2] accel/tcg: " Philippe Mathieu-Daudé
@ 2022-03-05 23:34 ` Philippe Mathieu-Daudé
2022-03-06 4:43 ` [PATCH 0/2] accel|target: " Richard Henderson
2 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-03-05 23:34 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, Richard Henderson, Philippe Mathieu-Daudé,
Kamil Rytarowski, haxm-team, Colin Xu, Paolo Bonzini,
Sunil Muthuswamy, Reinoud Zandijk, Wenchao Wang
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/i386/hax/hax-all.c | 4 ++--
target/i386/nvmm/nvmm-all.c | 14 +++++++-------
target/i386/whpx/whpx-all.c | 18 +++++++++---------
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/target/i386/hax/hax-all.c b/target/i386/hax/hax-all.c
index ccdcb6afab..81f665e212 100644
--- a/target/i386/hax/hax-all.c
+++ b/target/i386/hax/hax-all.c
@@ -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;
}
@@ -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;
diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c
index e159dd2b93..b97d091a50 100644
--- a/target/i386/nvmm/nvmm-all.c
+++ b/target/i386/nvmm/nvmm-all.c
@@ -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;
@@ -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;
@@ -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();
@@ -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;
@@ -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;
@@ -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();
@@ -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;
diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c
index a822246144..c7e25abf42 100644
--- a/target/i386/whpx/whpx-all.c
+++ b/target/i386/whpx/whpx-all.c
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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();
@@ -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;
@@ -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;
@@ -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);
@@ -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;
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] accel|target: Remove pointless CPUArchState casts
2022-03-05 23:34 [PATCH 0/2] accel|target: Remove pointless CPUArchState casts Philippe Mathieu-Daudé
2022-03-05 23:34 ` [PATCH 1/2] accel/tcg: " Philippe Mathieu-Daudé
2022-03-05 23:34 ` [PATCH 2/2] target/i386: " Philippe Mathieu-Daudé
@ 2022-03-06 4:43 ` Richard Henderson
2022-03-06 11:12 ` Philippe Mathieu-Daudé
2 siblings, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2022-03-06 4:43 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Thomas Huth, Philippe Mathieu-Daudé, Kamil Rytarowski,
haxm-team, Colin Xu, Paolo Bonzini, Sunil Muthuswamy,
Reinoud Zandijk, Wenchao Wang
On 3/5/22 13:34, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé<f4bug@amsat.org>
>
> Now than we can use the abstract CPUArchState, let's clean up.
>
> Based-on:<20220214183144.27402-1-f4bug@amsat.org>
> target: Use ArchCPU & CPUArchState as abstract interface to target CPU
>
> Philippe Mathieu-Daudé (2):
> accel/tcg: Remove pointless CPUArchState casts
> target/i386: Remove pointless CPUArchState casts
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] accel|target: Remove pointless CPUArchState casts
2022-03-06 4:43 ` [PATCH 0/2] accel|target: " Richard Henderson
@ 2022-03-06 11:12 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-03-06 11:12 UTC (permalink / raw)
To: Richard Henderson, qemu-devel
Cc: Thomas Huth, Philippe Mathieu-Daudé, Kamil Rytarowski,
haxm-team, Colin Xu, Paolo Bonzini, Sunil Muthuswamy,
Reinoud Zandijk, Wenchao Wang
On 6/3/22 05:43, Richard Henderson wrote:
> On 3/5/22 13:34, Philippe Mathieu-Daudé wrote:
>> From: Philippe Mathieu-Daudé<f4bug@amsat.org>
>>
>> Now than we can use the abstract CPUArchState, let's clean up.
>>
>> Based-on:<20220214183144.27402-1-f4bug@amsat.org>
>> target: Use ArchCPU & CPUArchState as abstract interface to target CPU
>>
>> Philippe Mathieu-Daudé (2):
>> accel/tcg: Remove pointless CPUArchState casts
>> target/i386: Remove pointless CPUArchState casts
>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Thanks, queued as 'abstract-arch-cpu'.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-03-06 11:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-05 23:34 [PATCH 0/2] accel|target: Remove pointless CPUArchState casts Philippe Mathieu-Daudé
2022-03-05 23:34 ` [PATCH 1/2] accel/tcg: " Philippe Mathieu-Daudé
2022-03-05 23:34 ` [PATCH 2/2] target/i386: " Philippe Mathieu-Daudé
2022-03-06 4:43 ` [PATCH 0/2] accel|target: " Richard Henderson
2022-03-06 11:12 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).