[PATCH-for-9.0 00/16] target/arm/kvm: Unify kvm_arm_FOO() API

Philippe Mathieu-Daudé posted 16 patches 1 year ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20231123183518.64569-1-philmd@linaro.org
Maintainers: Peter Maydell <peter.maydell@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>
target/arm/kvm_arm.h        |  26 ++++-----
hw/arm/virt.c               |   9 +--
hw/intc/arm_gicv3_its_kvm.c |   1 +
target/arm/cpu.c            |   2 +-
target/arm/cpu64.c          |   2 +-
target/arm/kvm.c            | 111 +++++++++++++++++-------------------
6 files changed, 73 insertions(+), 78 deletions(-)
[PATCH-for-9.0 00/16] target/arm/kvm: Unify kvm_arm_FOO() API
Posted by Philippe Mathieu-Daudé 1 year ago
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, have it always take ARMCPU, and
call the generic KVM API casting with the CPU() macro.

Based-on: <20231123044219.896776-1-richard.henderson@linaro.org>
  "target/arm: kvm cleanups"
  https://lore.kernel.org/qemu-devel/20231123044219.896776-1-richard.henderson@linaro.org/

Philippe Mathieu-Daudé (16):
  hw/intc/arm_gicv3: Include missing 'qemu/error-report.h' header
  target/arm/kvm: Remove unused includes
  target/arm/kvm: Have kvm_arm_add_vcpu_properties take a ARMCPU
    argument
  target/arm/kvm: Have kvm_arm_sve_set_vls take a ARMCPU argument
  target/arm/kvm: Have kvm_arm_sve_get_vls take a ARMCPU argument
  target/arm/kvm: Have kvm_arm_set_device_attr take a ARMCPU argument
  target/arm/kvm: Have kvm_arm_pvtime_init take a ARMCPU argument
  target/arm/kvm: Have kvm_arm_pmu_init take a ARMCPU argument
  target/arm/kvm: Have kvm_arm_pmu_set_irq take a ARMCPU argument
  target/arm/kvm: Have kvm_arm_vcpu_init take a ARMCPU argument
  target/arm/kvm: Have kvm_arm_vcpu_finalize take a ARMCPU argument
  target/arm/kvm: Have kvm_arm_[get|put]_virtual_time take ARMCPU
    argument
  target/arm/kvm: Have kvm_arm_verify_ext_dabt_pending take a ARMCPU arg
  target/arm/kvm: Have kvm_arm_handle_dabt_nisv take a ARMCPU argument
  target/arm/kvm: Have kvm_arm_handle_debug take a ARMCPU argument
  target/arm/kvm: Have kvm_arm_hw_debug_active take a ARMCPU argument

 target/arm/kvm_arm.h        |  26 ++++-----
 hw/arm/virt.c               |   9 +--
 hw/intc/arm_gicv3_its_kvm.c |   1 +
 target/arm/cpu.c            |   2 +-
 target/arm/cpu64.c          |   2 +-
 target/arm/kvm.c            | 111 +++++++++++++++++-------------------
 6 files changed, 73 insertions(+), 78 deletions(-)

-- 
2.41.0


Re: [PATCH-for-9.0 00/16] target/arm/kvm: Unify kvm_arm_FOO() API
Posted by Peter Maydell 11 months, 3 weeks ago
On Thu, 23 Nov 2023 at 18:35, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> 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, have it always take ARMCPU, and
> call the generic KVM API casting with the CPU() macro.



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

-- PMM
Re: [PATCH-for-9.0 00/16] target/arm/kvm: Unify kvm_arm_FOO() API
Posted by Philippe Mathieu-Daudé 11 months, 2 weeks ago
On 11/12/23 15:36, Peter Maydell wrote:
> On Thu, 23 Nov 2023 at 18:35, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>>
>> 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, have it always take ARMCPU, and
>> call the generic KVM API casting with the CPU() macro.
> 
> 
> 
> Applied to target-arm.next for 9.0, thanks.

Thanks Peter, the only change I added from Gavin review is
on top of patch #3:

-- >8 --
diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h
index 6fb8a5f67e..3abbef0260 100644
--- a/target/arm/kvm_arm.h
+++ b/target/arm/kvm_arm.h
@@ -148,7 +148,7 @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu);

  /**
   * kvm_arm_add_vcpu_properties:
- * @obj: The CPU object to add the properties to
+ * @cpu: The CPU object to add the properties to
   *
   * Add all KVM specific CPU properties to the CPU object. These
   * are the CPU properties with "kvm-" prefixed names.
---


Re: [PATCH-for-9.0 00/16] target/arm/kvm: Unify kvm_arm_FOO() API
Posted by Peter Maydell 11 months, 2 weeks ago
On Wed, 13 Dec 2023 at 09:42, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> On 11/12/23 15:36, Peter Maydell wrote:
> > On Thu, 23 Nov 2023 at 18:35, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> >>
> >> 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, have it always take ARMCPU, and
> >> call the generic KVM API casting with the CPU() macro.
> >
> >
> >
> > Applied to target-arm.next for 9.0, thanks.
>
> Thanks Peter, the only change I added from Gavin review is
> on top of patch #3:

OK, I've squashed that in.

-- PMM
Re: [PATCH-for-9.0 00/16] target/arm/kvm: Unify kvm_arm_FOO() API
Posted by Richard Henderson 1 year ago
On 11/23/23 12:35, Philippe Mathieu-Daudé wrote:
> 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, have it always take ARMCPU, and
> call the generic KVM API casting with the CPU() macro.
> 
> Based-on: <20231123044219.896776-1-richard.henderson@linaro.org>
>    "target/arm: kvm cleanups"
>    https://lore.kernel.org/qemu-devel/20231123044219.896776-1-richard.henderson@linaro.org/
> 
> Philippe Mathieu-Daudé (16):
>    hw/intc/arm_gicv3: Include missing 'qemu/error-report.h' header
>    target/arm/kvm: Remove unused includes
>    target/arm/kvm: Have kvm_arm_add_vcpu_properties take a ARMCPU
>      argument
>    target/arm/kvm: Have kvm_arm_sve_set_vls take a ARMCPU argument
>    target/arm/kvm: Have kvm_arm_sve_get_vls take a ARMCPU argument
>    target/arm/kvm: Have kvm_arm_set_device_attr take a ARMCPU argument
>    target/arm/kvm: Have kvm_arm_pvtime_init take a ARMCPU argument
>    target/arm/kvm: Have kvm_arm_pmu_init take a ARMCPU argument
>    target/arm/kvm: Have kvm_arm_pmu_set_irq take a ARMCPU argument
>    target/arm/kvm: Have kvm_arm_vcpu_init take a ARMCPU argument
>    target/arm/kvm: Have kvm_arm_vcpu_finalize take a ARMCPU argument
>    target/arm/kvm: Have kvm_arm_[get|put]_virtual_time take ARMCPU
>      argument
>    target/arm/kvm: Have kvm_arm_verify_ext_dabt_pending take a ARMCPU arg
>    target/arm/kvm: Have kvm_arm_handle_dabt_nisv take a ARMCPU argument
>    target/arm/kvm: Have kvm_arm_handle_debug take a ARMCPU argument
>    target/arm/kvm: Have kvm_arm_hw_debug_active take a ARMCPU argument


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~