From: Marc Zyngier <maz@kernel.org>
To: Marc Zyngier <maz@kernel.org>,
Oliver Upton <oliver.upton@linux.dev>,
James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, Joey Gouly <joey.gouly@arm.com>,
Jia Qingtong <jiaqingtong@huawei.com>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: arm64: vgic: fix GICR_STATUSR in vgic_v3_rd_registers
Date: Mon, 30 Sep 2024 15:45:17 +0100 [thread overview]
Message-ID: <87o745urnm.wl-maz@kernel.org> (raw)
In-Reply-To: <mhwgdkcgoan7r53bubpvlnu4xoexmnldwlk6ni5zjvkn4cnr72@fhxnwlfw536t>
On Mon, 30 Sep 2024 07:20:35 +0100,
Jia Qingtong <jiaqingtong97@gmail.com> wrote:
>
> On 29 Sep 10:38, Marc Zyngier wrote:
> > On Sun, 29 Sep 2024 05:39:35 +0100,
> > jiaqingtong97@gmail.com wrote:
> > >
> > > From: Jia Qingtong <jiaqingtong@huawei.com>
> > >
> > > vgic_uaccess use bsearch search regs in vgic_io_device.regions, but the
> > > GICR_STATUSR have wrong order in vgic_v3_rd_registers.
> > > When check all vgic_register_region, it turned out that only
> > > vgic_v3_rd_registers has this problem.
> > >
> > > It's harmless since vgic_uaccess behaves as RAZ&WI when it can't find the
> > > specified reg. This is exactly the same as the behavior of the GICR_STATUSR
> > > register.
> > >
> > > So just move GICR_STATUSR to the right place.
> >
> > That looks correct, but I think we should have some code that ensures
> > that these tables are correct at boot time, just like we're doing for
> > the system registers. Or completely remove our reliance on bsearch().
> >
> struct vgic_register_region was defined in vgic-{its,mmio-v2,mmio-v3},
> do you think it's appropriate to extern and check tables's item order in
> vgic-init.c's kvm_vgic_hyp_init?.
I'd rather we have local functions performing the check, one in each
of the GIC "modules", calling a global helper taking a pointer to the
register array as a parameter.
>
> > Another thing is that GICD_STATUSR looks pretty wrong. It is handled
> > as RAO, but we never clear any "error" (it is WI). This has been buggy
> > since GICv3 save/restore was added, 7 years ago.
> >
> Let's change it to RAZ? We will implement the complete logic when someone
> really needs this feature.
Exactly. Which is probably *never*.
>
> > Do you mind spinning a series fixing this up?
> >
> Sure.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
prev parent reply other threads:[~2024-09-30 14:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-29 4:39 [PATCH] KVM: arm64: vgic: fix GICR_STATUSR in vgic_v3_rd_registers jiaqingtong97
2024-09-29 9:38 ` Marc Zyngier
2024-09-30 6:20 ` Jia Qingtong
2024-09-30 14:45 ` Marc Zyngier [this message]
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=87o745urnm.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=jiaqingtong@huawei.com \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver.upton@linux.dev \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/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).