target/arm: Use vaddr type in handle_psci_call()
PATCH v4 1/1 target/arm: Use vaddr type in handle_psci_call()
Use 'vaddr' type for @entry, which is the start %pc for the on-lining vCPU. This allows to remove an unnecessary target_ulong in hvf_handle_psci_call().
--- target/arm/hvf/hvf.c | 2 +- target/arm/tcg/psci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
target/arm/hvf/hvf.c +1 -1
@@ -1418,7 +1418,7 @@ static bool hvf_handle_psci_call(CPUState *cpu, int *excp_ret)bool target_aarch64 = true;CPUState *target_cpu_state;ARMCPU *target_cpu; -target_ulong entry; +vaddr entry;int target_el =1 ;int32_t ret =0 ;
target/arm/tcg/psci.c +1 -1
@@ -68,7 +68,7 @@ void arm_handle_psci_call(ARMCPU *cpu)CPUARMState *env = &cpu->env;uint64_t param[4 ];uint64_t context_id, mpidr; -uint64_t entry; +vaddr entry;int32_t ret =0 ;int i;
Signature · 1 line
2.53.0
Quoted 32 lines · Philippe Mathieu-Daudé
Use 'vaddr' type for @entry, which is the start %pc for the on-lining vCPU. This allows to remove an unnecessary
target_ulonginhvf_handle_psci_call().Suggested-by Richard Henderson <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Pierrick Bouvier <[email protected]>Reviewed-by Richard Henderson <[email protected]>--- target/arm/hvf/hvf.c | 2 +- target/arm/tcg/psci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)target/arm/hvf/hvf.c +1
-1@@ -1418,7 +1418,7 @@ static bool hvf_handle_psci_call(CPUState *cpu, int *excp_ret)bool target_aarch64 = true;CPUState *target_cpu_state;ARMCPU *target_cpu; -target_ulong entry; +vaddr entry;int target_el =1 ;int32_t ret =0 ;target/arm/tcg/psci.c +0
-0
target/arm/tcg/psci.c void arm_handle_psci_call(ARMCPU *cpu) · line 73
Quoted 7 lines
target/arm/tcg/psci.c +1
-1@@ -68,7 +68,7 @@ void arm_handle_psci_call(ARMCPU *cpu)CPUARMState *env = &cpu->env;uint64_t param[4 ];uint64_t context_id, mpidr; -uint64_t entry; +vaddr entry;int32_t ret =0 ;int i;
So we take our argument which is a uint64_t in param[], and we put it into a vaddr entry, and then the only thing we do with that is pass it to arm_set_cpu_on() which takes a uint64_t... I'm not sure what the vaddr type is getting us here.
Should we just do in hvf.c the same thing we did already for tcg/psci.c in 3580aa03547f92, and make 'entry' a uint64_t ?
-- PMM
Quoted 46 lines · Peter Maydell
Quoted 32 lines · Philippe Mathieu-Daudé
Use 'vaddr' type for @entry, which is the start %pc for the on-lining vCPU. This allows to remove an unnecessary
target_ulonginhvf_handle_psci_call().Suggested-by Richard Henderson <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Pierrick Bouvier <[email protected]>Reviewed-by Richard Henderson <[email protected]>--- target/arm/hvf/hvf.c | 2 +- target/arm/tcg/psci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)target/arm/hvf/hvf.c +1
-1@@ -1418,7 +1418,7 @@ static bool hvf_handle_psci_call(CPUState *cpu, int *excp_ret)bool target_aarch64 = true;CPUState *target_cpu_state;ARMCPU *target_cpu; -target_ulong entry; +vaddr entry;int target_el =1 ;int32_t ret =0 ;target/arm/tcg/psci.c +0
-0target/arm/tcg/psci.c void arm_handle_psci_call(ARMCPU *cpu) · line 73
Quoted 7 lines
target/arm/tcg/psci.c +1
-1@@ -68,7 +68,7 @@ void arm_handle_psci_call(ARMCPU *cpu)CPUARMState *env = &cpu->env;uint64_t param[4 ];uint64_t context_id, mpidr; -uint64_t entry; +vaddr entry;int32_t ret =0 ;int i;So we take our argument which is a
uint64_tin param[], and we put it into a vaddr entry, and then the only thing we do with that is pass it toarm_set_cpu_on()which takes auint64_t... I'm not sure what the vaddr type is getting us here.
Quoted 2 lines
Should we just do in
hvf.cthe same thing we did already fortcg/psci.cin3580aa03547f92, and make 'entry' auint64_t?
Well this was v3, I just wanted to address Richard comment:
https://lore.kernel.org/qemu-devel/[email protected]/
I'll repost v3 as v5 so we can choose :)