All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mohamed Mediouni <mohamed@unpredictable.fr>
To: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Cc: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [PULL 15/28] hw/intc: arm_gicv3_hvf: save/restore Apple GIC state
Date: Sat, 13 Jun 2026 13:49:40 +0200	[thread overview]
Message-ID: <B66CF85A-948B-4B24-B7C1-BE07F817BFB2@unpredictable.fr> (raw)
In-Reply-To: <a35bb538-541d-487c-b28f-39e265ac80a0@oss.qualcomm.com>



> On 13. Jun 2026, at 13:45, Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> wrote:
> 
> Hi Mohamed,
> 
> On 1/5/26 12:14, Peter Maydell wrote:
>> From: Mohamed Mediouni <mohamed@unpredictable.fr>
>> On HVF, some of the GIC state is in an opaque Apple-provided structure.
>> Save/restore that state to be able to save/restore VMs that use the hardware GIC.
>> Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
>> Message-id: 20260429190532.26538-3-mohamed@unpredictable.fr
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>>  hw/intc/arm_gicv3_common.c         |  1 +
>>  hw/intc/arm_gicv3_hvf.c            | 94 ++++++++++++++++++++++++++++--
>>  hw/intc/arm_gicv3_hvf_stub.c       | 25 ++++++++
>>  hw/intc/meson.build                |  1 +
>>  include/hw/intc/arm_gicv3_common.h |  3 +
>>  5 files changed, 120 insertions(+), 4 deletions(-)
>>  create mode 100644 hw/intc/arm_gicv3_hvf_stub.c
> 
> 
>> diff --git a/hw/intc/arm_gicv3_hvf.c b/hw/intc/arm_gicv3_hvf.c
>> index 22f19d274d..ae881092ea 100644
>> --- a/hw/intc/arm_gicv3_hvf.c
>> +++ b/hw/intc/arm_gicv3_hvf.c
>> @@ -13,6 +13,7 @@
>>  #include "qemu/error-report.h"
>>  #include "qemu/module.h"
>>  #include "system/runstate.h"
>> +#include "migration/vmstate.h"
>>  #include "system/hvf.h"
>>  #include "system/hvf_int.h"
>>  #include "hvf_arm.h"
>> @@ -37,8 +38,13 @@ struct HVFARMGICv3Class {
>>    typedef struct HVFARMGICv3Class HVFARMGICv3Class;
>>  -/* This is reusing the GICv3State typedef from ARM_GICV3_ITS_COMMON */
>> -DECLARE_OBJ_CHECKERS(GICv3State, HVFARMGICv3Class,
>> +typedef struct HVFGICv3State {
>> +    GICv3State parent_obj;
>> +    uint32_t size;
>> +    void *state;
>> +} HVFGICv3State;
>> +
>> +DECLARE_OBJ_CHECKERS(HVFGICv3State, HVFARMGICv3Class,
>>                       HVF_GICV3, TYPE_HVF_GICV3);
>>    /*
>> @@ -668,7 +674,7 @@ static const ARMCPRegInfo gicv3_cpuif_reginfo[] = {
>>  static void hvf_gicv3_realize(DeviceState *dev, Error **errp)
>>  {
>>      ERRP_GUARD();
>> -    GICv3State *s = HVF_GICV3(dev);
>> +    GICv3State *s = (GICv3State *)HVF_GICV3(dev);
>>      HVFARMGICv3Class *kgc = HVF_GICV3_GET_CLASS(s);
>>      int i;
>>  @@ -715,6 +721,86 @@ static void hvf_gicv3_realize(DeviceState *dev, Error **errp)
>>      }
>>  }
>>  +/*
>> + * HVF doesn't have a way to save the RDIST pending tables
>> + * to guest memory, only to an opaque data structure.
>> + */
>> +static bool gicv3_is_hvf(void *opaque)
>> +{
>> +    return hvf_enabled() && hvf_irqchip_in_kernel();
>> +}
> Unfortunately this commit (48396ad6ce9) breaks bisection:
> 
> ../../hw/intc/arm_gicv3_hvf.c:730:29: error: call to undeclared function 'hvf_irqchip_in_kernel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>  730 |     return hvf_enabled() && hvf_irqchip_in_kernel();
>      |                             ^
> 1 error generated.

Hi,

My mistake. Will try to see in which rev of the patchset I intro’d this one…
and will see how to avoid it going forward...

On a side note, two bugs affecting HVF right now:

- looks like on M1 there’s an issue affecting detecting 36-bit PAs

think that bug was intro’d by me but will have to look more into it

- and qemu master is broken rn with HVF (and there’s an unmerged patch for
that)

> 
> The method is declared / defined in the following commit (2a3c965516f).
> 
> Please be careful to avoid that in future to avoid manual operations.
> 
> Regards,
> 
> Phil.




  reply	other threads:[~2026-06-13 11:50 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 10:14 [PULL 00/28] target-arm queue Peter Maydell
2026-05-01 10:14 ` [PULL 01/28] hw/arm/fsl-imx8mp: Do not create redundant unimplemented devices Peter Maydell
2026-05-01 10:14 ` [PULL 02/28] hw/arm/fsl-imx8mp: Fix parent of ocram memory region Peter Maydell
2026-05-01 10:14 ` [PULL 03/28] Revert "sysbus: add irq_routing_notifier" Peter Maydell
2026-05-01 10:14 ` [PULL 04/28] linux-user/arm: Restrict regpairs_aligned Peter Maydell
2026-05-01 10:14 ` [PULL 05/28] qemu-options: Improve description for -smb option Peter Maydell
2026-05-01 10:14 ` [PULL 06/28] target/arm/cpu-features.c: New fields in AA64MMFR4 Peter Maydell
2026-05-01 10:14 ` [PULL 07/28] target/arm/cpu.h: New GPCCR fields Peter Maydell
2026-05-01 10:14 ` [PULL 08/28] target/arm/ptw.c: Add GDI spaces to the granule protection case Peter Maydell
2026-05-01 10:14 ` [PULL 09/28] tests/tcg/aarch64/system/rme_gdi.c: Very basic test of GDI Peter Maydell
2026-05-01 10:14 ` [PULL 10/28] docs/devel/decodetree: Fix formatting in "field examples" table Peter Maydell
2026-05-01 10:14 ` [PULL 11/28] hw/net/allwinner-sun8i-emac: Flush queued packets when rx is enabled Peter Maydell
2026-05-01 10:14 ` [PULL 12/28] hw/intc/arm_gicv3: Fix NS write to ICC_AP1Rn_EL1 when prebits < 7 Peter Maydell
2026-05-01 10:14 ` [PULL 13/28] target/arm/kvm: Cache host CPU probe failure Peter Maydell
2026-05-01 10:14 ` [PULL 14/28] hw/intc: Add hvf vGIC interrupt controller support Peter Maydell
2026-05-01 10:14 ` [PULL 15/28] hw/intc: arm_gicv3_hvf: save/restore Apple GIC state Peter Maydell
2026-05-07  8:08   ` Philippe Mathieu-Daudé
2026-06-13 11:45   ` Philippe Mathieu-Daudé
2026-06-13 11:49     ` Mohamed Mediouni [this message]
2026-05-01 10:14 ` [PULL 16/28] accel, hw/arm, include/system/hvf: infrastructure changes for HVF vGIC Peter Maydell
2026-05-01 10:14 ` [PULL 17/28] target/arm: hvf: instantiate GIC early Peter Maydell
2026-05-01 10:14 ` [PULL 18/28] hw/arm, target/arm: nested virtualisation on HVF Peter Maydell
2026-05-01 10:14 ` [PULL 19/28] hvf: only call hvf_sync_vtimer() when running without the platform vGIC Peter Maydell
2026-05-01 10:14 ` [PULL 20/28] hvf: gate ARM_FEATURE_PMU register emulation when using the Apple vGIC Peter Maydell
2026-05-01 10:14 ` [PULL 21/28] hvf: arm: allow exposing minimal PMU for kernel-irqchip=on Peter Maydell
2026-05-01 10:14 ` [PULL 22/28] target/arm: hvf: add asserts for code paths not leveraged when using the vGIC Peter Maydell
2026-05-01 10:15 ` [PULL 23/28] hvf: sync registers used at EL2 Peter Maydell
2026-05-01 10:59   ` Stefan Hajnoczi
2026-05-01 23:20     ` Mohamed Mediouni
2026-05-01 10:15 ` [PULL 24/28] target/arm: hvf: pass through CNTHCTL_EL2 and MDCCINT_EL1 Peter Maydell
2026-05-01 10:15 ` [PULL 25/28] hvf: arm: disable SME when nested virt is active Peter Maydell
2026-05-01 10:15 ` [PULL 26/28] hvf: arm: physical timer emulation Peter Maydell
2026-05-01 10:15 ` [PULL 27/28] hvf: enable nested virtualisation support Peter Maydell
2026-05-01 10:15 ` [PULL 28/28] hvf: arm: enable vGIC by default for virt-11.1 and later 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=B66CF85A-948B-4B24-B7C1-BE07F817BFB2@unpredictable.fr \
    --to=mohamed@unpredictable.fr \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@oss.qualcomm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.