mbox series

[for-9.0,00/21] target/arm: kvm cleanups

Message ID 20231123044219.896776-1-richard.henderson@linaro.org
Headers show
Series target/arm: kvm cleanups | expand

Message

Richard Henderson Nov. 23, 2023, 4:41 a.m. UTC
This is primarily concerned with merging kvm64.c with kvm.c
and then unexporting everything that is not required outside.

r~

Chao Du (1):
  target/arm: kvm64: remove a redundant KVM_CAP_SET_GUEST_DEBUG probe

Richard Henderson (20):
  accel/kvm: Make kvm_has_guest_debug static
  target/arm/kvm: Merge kvm_arm_init_debug into kvm_arch_init
  target/arm/kvm: Move kvm_arm_verify_ext_dabt_pending and unexport
  target/arm/kvm: Move kvm_arm_copy_hw_debug_data and unexport
  target/arm/kvm: Move kvm_arm_hw_debug_active and unexport
  target/arm/kvm: Move kvm_arm_handle_debug and unexport
  target/arm/kvm: Unexport kvm_arm_{get,put}_virtual_time
  target/arm/kvm: Inline kvm_arm_steal_time_supported
  target/arm/kvm: Move kvm_arm_get_host_cpu_features and unexport
  target/arm/kvm: Use a switch for kvm_arm_cpreg_level
  target/arm/kvm: Move kvm_arm_cpreg_level and unexport
  target/arm/kvm: Move kvm_arm_reg_syncs_via_cpreg_list and unexport
  target/arm/kvm: Merge kvm64.c into kvm.c
  target/arm/kvm: Unexport kvm_arm_vcpu_init
  target/arm/kvm: Unexport kvm_arm_vcpu_finalize
  target/arm/kvm: Unexport kvm_arm_init_cpreg_list
  target/arm/kvm: Init cap_has_inject_serror_esr in kvm_arch_init
  target/arm/kvm: Unexport kvm_{get,put}_vcpu_events
  target/arm/kvm: Unexport and tidy kvm_arm_sync_mpstate_to_{kvm,qemu}
  target/arm/kvm: Unexport kvm_arm_vm_state_change

 target/arm/kvm_arm.h   |  203 ------
 accel/kvm/kvm-all.c    |    2 +-
 target/arm/kvm.c       | 1372 +++++++++++++++++++++++++++++++++++++++-
 target/arm/kvm64.c     | 1290 -------------------------------------
 target/arm/meson.build |    2 +-
 5 files changed, 1345 insertions(+), 1524 deletions(-)
 delete mode 100644 target/arm/kvm64.c

Comments

Philippe Mathieu-Daudé Nov. 23, 2023, 5:40 p.m. UTC | #1
On 23/11/23 05:41, Richard Henderson wrote:
> This is primarily concerned with merging kvm64.c with kvm.c
> and then unexporting everything that is not required outside.


>   target/arm/kvm_arm.h   |  203 ------

Unrelated to this series goal, but I notice half of the API takes
CPUState, the other ARMCPU...

$ git grep -F 'CPUState *' target/arm/kvm_arm.h | wc -l
       16
$ git grep -F 'ARMCPU *' target/arm/kvm_arm.h | wc -l
       14

Since this is ARM specific, I'd expect it always take ARMCPU, and
call the generic KVM API casting with the CPU() macro.
Philippe Mathieu-Daudé Nov. 23, 2023, 7:14 p.m. UTC | #2
On 23/11/23 18:40, Philippe Mathieu-Daudé wrote:
> On 23/11/23 05:41, Richard Henderson wrote:
>> This is primarily concerned with merging kvm64.c with kvm.c
>> and then unexporting everything that is not required outside.
> 
> 
>>   target/arm/kvm_arm.h   |  203 ------
> 
> Unrelated to this series goal, but I notice half of the API takes
> CPUState, the other ARMCPU...
> 
> $ git grep -F 'CPUState *' target/arm/kvm_arm.h | wc -l
>        16
> $ git grep -F 'ARMCPU *' target/arm/kvm_arm.h | wc -l
>        14
> 
> Since this is ARM specific, I'd expect it always take ARMCPU, and
> call the generic KVM API casting with the CPU() macro.

API clarification done here:
https://lore.kernel.org/qemu-devel/20231123183518.64569-1-philmd@linaro.org/
Philippe Mathieu-Daudé Nov. 24, 2023, 12:05 p.m. UTC | #3
On 23/11/23 05:41, Richard Henderson wrote:
> This is primarily concerned with merging kvm64.c with kvm.c
> and then unexporting everything that is not required outside.
> 
> r~
> 
> Chao Du (1):
>    target/arm: kvm64: remove a redundant KVM_CAP_SET_GUEST_DEBUG probe
> 
> Richard Henderson (20):
>    accel/kvm: Make kvm_has_guest_debug static
>    target/arm/kvm: Merge kvm_arm_init_debug into kvm_arch_init
>    target/arm/kvm: Move kvm_arm_verify_ext_dabt_pending and unexport
>    target/arm/kvm: Move kvm_arm_copy_hw_debug_data and unexport
>    target/arm/kvm: Move kvm_arm_hw_debug_active and unexport
>    target/arm/kvm: Move kvm_arm_handle_debug and unexport
>    target/arm/kvm: Unexport kvm_arm_{get,put}_virtual_time
>    target/arm/kvm: Inline kvm_arm_steal_time_supported
>    target/arm/kvm: Move kvm_arm_get_host_cpu_features and unexport
>    target/arm/kvm: Use a switch for kvm_arm_cpreg_level
>    target/arm/kvm: Move kvm_arm_cpreg_level and unexport
>    target/arm/kvm: Move kvm_arm_reg_syncs_via_cpreg_list and unexport
>    target/arm/kvm: Merge kvm64.c into kvm.c
>    target/arm/kvm: Unexport kvm_arm_vcpu_init
>    target/arm/kvm: Unexport kvm_arm_vcpu_finalize
>    target/arm/kvm: Unexport kvm_arm_init_cpreg_list
>    target/arm/kvm: Init cap_has_inject_serror_esr in kvm_arch_init
>    target/arm/kvm: Unexport kvm_{get,put}_vcpu_events
>    target/arm/kvm: Unexport and tidy kvm_arm_sync_mpstate_to_{kvm,qemu}
>    target/arm/kvm: Unexport kvm_arm_vm_state_change

Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Peter Maydell Dec. 11, 2023, 2:35 p.m. UTC | #4
On Thu, 23 Nov 2023 at 04:43, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> This is primarily concerned with merging kvm64.c with kvm.c
> and then unexporting everything that is not required outside.
>

Applied to target-arm.next for 9.0, thanks.

-- PMM