qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gavin Shan <gshan@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, kvm@vger.kernel.org,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH-for-9.0 05/16] target/arm/kvm: Have kvm_arm_sve_get_vls take a ARMCPU argument
Date: Mon, 27 Nov 2023 15:12:10 +1100	[thread overview]
Message-ID: <54a38178-18ca-4bea-9d5d-af34114dda5b@redhat.com> (raw)
In-Reply-To: <20231123183518.64569-6-philmd@linaro.org>

Hi Phil,

On 11/24/23 05:35, Philippe Mathieu-Daudé wrote:
> Unify the "kvm_arm.h" API: All functions related to ARM vCPUs
> take a ARMCPU* argument. Use the CPU() QOM cast macro When
> calling the generic vCPU API from "sysemu/kvm.h".
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/arm/kvm_arm.h | 6 +++---
>   target/arm/cpu64.c   | 2 +-
>   target/arm/kvm.c     | 2 +-
>   3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h
> index 6fb8a5f67e..84f87f5ed7 100644
> --- a/target/arm/kvm_arm.h
> +++ b/target/arm/kvm_arm.h
> @@ -129,13 +129,13 @@ void kvm_arm_destroy_scratch_host_vcpu(int *fdarray);
>   
>   /**
>    * kvm_arm_sve_get_vls:
> - * @cs: CPUState
> + * @cpu: ARMCPU
>    *
>    * Get all the SVE vector lengths supported by the KVM host, setting
>    * the bits corresponding to their length in quadwords minus one
>    * (vq - 1) up to ARM_MAX_VQ.  Return the resulting map.
>    */
> -uint32_t kvm_arm_sve_get_vls(CPUState *cs);
> +uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu);
>   

Either @cs or @cpu isn't dereferenced in kvm_arm_sve_get_vls(). So I guess
the argument can be simply droped?

>   /**
>    * kvm_arm_set_cpu_features_from_host:
> @@ -278,7 +278,7 @@ static inline void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp)
>       g_assert_not_reached();
>   }
>   
> -static inline uint32_t kvm_arm_sve_get_vls(CPUState *cs)
> +static inline uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu)
>   {
>       g_assert_not_reached();
>   }
> diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
> index 1e9c6c85ae..8e30a7993e 100644
> --- a/target/arm/cpu64.c
> +++ b/target/arm/cpu64.c
> @@ -66,7 +66,7 @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp)
>        */
>       if (kvm_enabled()) {
>           if (kvm_arm_sve_supported()) {
> -            cpu->sve_vq.supported = kvm_arm_sve_get_vls(CPU(cpu));
> +            cpu->sve_vq.supported = kvm_arm_sve_get_vls(cpu);
>               vq_supported = cpu->sve_vq.supported;
>           } else {
>               assert(!cpu_isar_feature(aa64_sve, cpu));
> diff --git a/target/arm/kvm.c b/target/arm/kvm.c
> index 71833a845a..766a077bcf 100644
> --- a/target/arm/kvm.c
> +++ b/target/arm/kvm.c
> @@ -1803,7 +1803,7 @@ bool kvm_arm_sve_supported(void)
>   
>   QEMU_BUILD_BUG_ON(KVM_ARM64_SVE_VQ_MIN != 1);
>   
> -uint32_t kvm_arm_sve_get_vls(CPUState *cs)
> +uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu)
>   {
>       /* Only call this function if kvm_arm_sve_supported() returns true. */
>       static uint64_t vls[KVM_ARM64_SVE_VLS_WORDS];

Thanks,
Gavin



  reply	other threads:[~2023-11-27  4:13 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-23 18:35 [PATCH-for-9.0 00/16] target/arm/kvm: Unify kvm_arm_FOO() API Philippe Mathieu-Daudé
2023-11-23 18:35 ` [PATCH-for-9.0 01/16] hw/intc/arm_gicv3: Include missing 'qemu/error-report.h' header Philippe Mathieu-Daudé
2023-11-27  3:54   ` Gavin Shan
2023-11-23 18:35 ` [PATCH-for-9.0 02/16] target/arm/kvm: Remove unused includes Philippe Mathieu-Daudé
2023-11-27  3:59   ` Gavin Shan
2023-11-23 18:35 ` [PATCH-for-9.0 03/16] target/arm/kvm: Have kvm_arm_add_vcpu_properties take a ARMCPU argument Philippe Mathieu-Daudé
2023-11-27  4:05   ` Gavin Shan
2023-11-28  6:52     ` Philippe Mathieu-Daudé
2023-11-23 18:35 ` [PATCH-for-9.0 04/16] target/arm/kvm: Have kvm_arm_sve_set_vls " Philippe Mathieu-Daudé
2023-11-27  4:07   ` Gavin Shan
2023-11-23 18:35 ` [PATCH-for-9.0 05/16] target/arm/kvm: Have kvm_arm_sve_get_vls " Philippe Mathieu-Daudé
2023-11-27  4:12   ` Gavin Shan [this message]
2023-11-28  6:52     ` Philippe Mathieu-Daudé
2023-11-23 18:35 ` [PATCH-for-9.0 06/16] target/arm/kvm: Have kvm_arm_set_device_attr " Philippe Mathieu-Daudé
2023-11-27  4:13   ` Gavin Shan
2023-11-23 18:35 ` [PATCH-for-9.0 07/16] target/arm/kvm: Have kvm_arm_pvtime_init " Philippe Mathieu-Daudé
2023-11-27  4:15   ` Gavin Shan
2023-11-23 18:35 ` [PATCH-for-9.0 08/16] target/arm/kvm: Have kvm_arm_pmu_init " Philippe Mathieu-Daudé
2023-11-27  4:20   ` Gavin Shan
2023-11-28  6:46     ` Philippe Mathieu-Daudé
2023-11-23 18:35 ` [PATCH-for-9.0 09/16] target/arm/kvm: Have kvm_arm_pmu_set_irq " Philippe Mathieu-Daudé
2023-11-27  4:21   ` Gavin Shan
2023-11-23 18:35 ` [PATCH-for-9.0 10/16] target/arm/kvm: Have kvm_arm_vcpu_init " Philippe Mathieu-Daudé
2023-11-27  4:24   ` Gavin Shan
2023-11-27  4:25   ` Gavin Shan
2023-11-23 18:35 ` [PATCH-for-9.0 11/16] target/arm/kvm: Have kvm_arm_vcpu_finalize " Philippe Mathieu-Daudé
2023-11-27  4:26   ` Gavin Shan
2023-11-23 18:35 ` [PATCH-for-9.0 12/16] target/arm/kvm: Have kvm_arm_[get|put]_virtual_time take " Philippe Mathieu-Daudé
2023-11-27  4:29   ` Gavin Shan
2023-11-23 18:35 ` [PATCH-for-9.0 13/16] target/arm/kvm: Have kvm_arm_verify_ext_dabt_pending take a ARMCPU arg Philippe Mathieu-Daudé
2023-11-27  4:31   ` Gavin Shan
2023-11-23 18:35 ` [PATCH-for-9.0 14/16] target/arm/kvm: Have kvm_arm_handle_dabt_nisv take a ARMCPU argument Philippe Mathieu-Daudé
2023-11-27  4:33   ` Gavin Shan
2023-11-23 18:35 ` [PATCH-for-9.0 15/16] target/arm/kvm: Have kvm_arm_handle_debug " Philippe Mathieu-Daudé
2023-11-27  4:34   ` Gavin Shan
2023-11-23 18:35 ` [PATCH-for-9.0 16/16] target/arm/kvm: Have kvm_arm_hw_debug_active " Philippe Mathieu-Daudé
2023-11-27  4:36   ` Gavin Shan
2023-11-26 13:59 ` [PATCH-for-9.0 00/16] target/arm/kvm: Unify kvm_arm_FOO() API Richard Henderson
2023-12-11 14:36 ` Peter Maydell
2023-12-13  9:42   ` Philippe Mathieu-Daudé
2023-12-14 15:34     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54a38178-18ca-4bea-9d5d-af34114dda5b@redhat.com \
    --to=gshan@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).