All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim MacArthur <jim.macarthur@linaro.org>
To: qemu-devel@nongnu.org
Cc: philmd@oss.qualcomm.com
Subject: Re: [PATCH] hw/intc/arm_gicv5: Make IRS_IDR0 reads return actual value, not 0
Date: Fri, 9 Oct 2026 10:48:57 +0100	[thread overview]
Message-ID: <asi4iR9eMPPgQIkS@linaro.org> (raw)
In-Reply-To: <5d81e092-86f2-4459-a34b-460d69009568@oss.qualcomm.com>

On Thu, Oct 08, 2026 at 11:36:59AM +0200, Philippe Mathieu-Daudé wrote:
> On 8/10/26 11:23, Peter Maydell wrote:
> > IN the code for handling reads of IRS_IDR0, we carefully construct
> > the correct value starting with cs->irs_idr0 and adjusting it.
> > However, we never actually write the final value into *data, so
> > the guest will always see zero.
> > 
> > We didn't notice this before, because Linux happens to not care
> > about this register value except to check for the presence of
> > virtualization.
> > 
> > Cc: qemu-stable@nongnu.org
> > Fixes: 405ad2e76f13254 ("hw/intc/arm_gicv5: Implement IRS ID regs")
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> > ---
> >   hw/intc/arm_gicv5.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/hw/intc/arm_gicv5.c b/hw/intc/arm_gicv5.c
> > index 08878193dfc..ebfb0878af3 100644
> > --- a/hw/intc/arm_gicv5.c
> > +++ b/hw/intc/arm_gicv5.c
> > @@ -1433,6 +1433,7 @@ static bool config_readl(GICv5 *s, GICv5Domain domain, hwaddr offset,
> >               /* ...which means VIRT_ONE_N is also RES0 */
> >               v &= ~R_IRS_IDR0_VIRT_ONE_N_MASK;
> >           }
> 
> Looking at the code path it is obvious, I wonder why compilers or
> coverity didn't warned 'v' is set but not used...

AFAICT, 'param @= RHS' counts as a use with -Wunused-but-set-variable in GCC up to version 15; GCC 16.1 adds an exception for this and should warn.

Jim


  reply	other threads:[~2026-10-09  9:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08  9:23 [PATCH] hw/intc/arm_gicv5: Make IRS_IDR0 reads return actual value, not 0 Peter Maydell
2026-10-08  9:36 ` Philippe Mathieu-Daudé
2026-10-09  9:48   ` Jim MacArthur [this message]
2026-10-09 10:06     ` Philippe Mathieu-Daudé
2026-10-09  9:18 ` Jim MacArthur

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=asi4iR9eMPPgQIkS@linaro.org \
    --to=jim.macarthur@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.