qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
	"Leif Lindholm" <quic_llindhol@quicinc.com>,
	"Radoslaw Biernacki" <rad@semihalf.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Igor Mitsyanko" <i.mitsyanko@gmail.com>,
	"Rob Herring" <robh@kernel.org>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Marcin Juszkiewicz" <marcin.juszkiewicz@linaro.org>
Subject: Re: [PATCH v2 09/14] hw/arm: Prefer arm_feature(EL3) over object_property_find(has_el3)
Date: Tue, 9 Jan 2024 19:22:04 +0100	[thread overview]
Message-ID: <e233582b-67db-481d-90bd-bb2677ff8734@linaro.org> (raw)
In-Reply-To: <20240109180930.90793-10-philmd@linaro.org>

On 9/1/24 19:09, Philippe Mathieu-Daudé wrote:
> The "has_el3" property is added to ARMCPU when the
> ARM_FEATURE_EL3 feature is available. Rather than
> checking whether the QOM property is present, directly
> check the feature.
> 
> Suggested-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/arm/exynos4210.c   |  4 ++--
>   hw/arm/integratorcp.c |  5 ++---
>   hw/arm/realview.c     |  2 +-
>   hw/arm/versatilepb.c  |  5 ++---
>   hw/arm/xilinx_zynq.c  |  2 +-
>   hw/cpu/a15mpcore.c    | 11 +++++++----
>   hw/cpu/a9mpcore.c     |  6 +++---
>   7 files changed, 18 insertions(+), 17 deletions(-)


> diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
> index bfd8aa5644..cebfe142cf 100644
> --- a/hw/cpu/a15mpcore.c
> +++ b/hw/cpu/a15mpcore.c
> @@ -53,7 +53,6 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp)
>       DeviceState *gicdev;
>       SysBusDevice *busdev;
>       int i;
> -    bool has_el3;
>       bool has_el2 = false;
>       Object *cpuobj;
>   
> @@ -62,13 +61,17 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp)
>       qdev_prop_set_uint32(gicdev, "num-irq", s->num_irq);
>   
>       if (!kvm_irqchip_in_kernel()) {
> +        CPUState *cpu;
> +
>           /* Make the GIC's TZ support match the CPUs. We assume that
>            * either all the CPUs have TZ, or none do.
>            */
> -        cpuobj = OBJECT(qemu_get_cpu(0));
> -        has_el3 = object_property_find(cpuobj, "has_el3") &&
> +        cpu = qemu_get_cpu(0);
> +        cpuobj = OBJECT(cpu);
> +        if (arm_feature(cpu_env(cpu), ARM_FEATURE_EL3)) {
>               object_property_get_bool(cpuobj, "has_el3", &error_abort);

This requires the same change than a9mp_priv_realize(), so squashing:

-- >8 --
          if (arm_feature(cpu_env(cpu), ARM_FEATURE_EL3)) {
-            object_property_get_bool(cpuobj, "has_el3", &error_abort);
-            qdev_prop_set_bit(gicdev, "has-security-extensions", true);
+            qdev_prop_set_bit(gicdev, "has-security-extensions",
+                              object_property_get_bool(cpuobj, "has_el3",
+                                                       &error_abort));
          }
---

> -        qdev_prop_set_bit(gicdev, "has-security-extensions", has_el3);
> +            qdev_prop_set_bit(gicdev, "has-security-extensions", true);
> +        }
>           /* Similarly for virtualization support */
>           has_el2 = object_property_find(cpuobj, "has_el2") &&
>               object_property_get_bool(cpuobj, "has_el2", &error_abort);


  parent reply	other threads:[~2024-01-09 18:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 18:09 [PATCH v2 00/14] hw/arm: Prefer arm_feature() over object_property_find() Philippe Mathieu-Daudé
2024-01-09 18:09 ` [PATCH v2 01/14] target/arm/cpu: Simplify checking A64_MTE bit in FEATURE_ID register Philippe Mathieu-Daudé
2024-01-10  6:01   ` Richard Henderson
2024-01-10 11:36     ` Peter Maydell
2024-01-09 18:09 ` [PATCH v2 02/14] hw/arm/armv7m: Introduce cpudev variable in armv7m_realize() Philippe Mathieu-Daudé
2024-01-09 18:09 ` [PATCH v2 03/14] hw/arm/armv7m: Ensure requested CPU type implements ARM_FEATURE_M Philippe Mathieu-Daudé
2024-01-09 18:09 ` [PATCH v2 04/14] hw/arm/armv7m: Move code setting 'start-powered-off' property around Philippe Mathieu-Daudé
2024-01-09 18:09 ` [PATCH v2 05/14] hw/arm/armv7m: Always set 'init-nsvtor' property for Cortex-M CPUs Philippe Mathieu-Daudé
2024-01-09 18:09 ` [PATCH v2 06/14] hw/arm: Prefer arm_feature(M_SECURITY) over object_property_find() Philippe Mathieu-Daudé
2024-01-09 18:09 ` [PATCH v2 07/14] hw/arm: Prefer arm_feature(THUMB_DSP) over object_property_find(dsp) Philippe Mathieu-Daudé
2024-01-09 18:09 ` [PATCH v2 08/14] hw/arm: Prefer arm_feature(V7) over object_property_find(pmsav7-dregion) Philippe Mathieu-Daudé
2024-01-09 18:09 ` [PATCH v2 09/14] hw/arm: Prefer arm_feature(EL3) over object_property_find(has_el3) Philippe Mathieu-Daudé
2024-01-09 18:13   ` Philippe Mathieu-Daudé
2024-01-09 18:17     ` Philippe Mathieu-Daudé
2024-01-09 18:22   ` Philippe Mathieu-Daudé [this message]
2024-01-09 18:09 ` [PATCH v2 10/14] hw/arm: Prefer arm_feature(EL2) over object_property_find(has_el2) Philippe Mathieu-Daudé
2024-01-09 18:23   ` Philippe Mathieu-Daudé
2024-01-09 18:09 ` [PATCH v2 11/14] hw/arm: Prefer arm_feature(CBAR*) over object_property_find(reset-cbar) Philippe Mathieu-Daudé
2024-01-09 18:09 ` [PATCH v2 12/14] hw/arm: Prefer arm_feature(PMU) over object_property_find(pmu) Philippe Mathieu-Daudé
2024-01-09 18:09 ` [PATCH v2 13/14] hw/arm: Prefer cpu_isar_feature(aa64_mte) over property_find(tag-memory) Philippe Mathieu-Daudé
2024-01-09 18:09 ` [PATCH v2 14/14] hw/arm: Prefer arm_feature(GENERIC_TMR) over 'kvm-no-adjvtime' property Philippe Mathieu-Daudé

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=e233582b-67db-481d-90bd-bb2677ff8734@linaro.org \
    --to=philmd@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=alistair@alistair23.me \
    --cc=armbru@redhat.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=i.mitsyanko@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=marcin.juszkiewicz@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quic_llindhol@quicinc.com \
    --cc=rad@semihalf.com \
    --cc=robh@kernel.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).