Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Yao Yuan <yaoyuan@linux.alibaba.com>
Cc: Michael Bommarito <michael.bommarito@gmail.com>,
	Oliver Upton <oupton@kernel.org>, Joey Gouly <joey.gouly@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>,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: arm64: vgic-its: reject restored DTE with out-of-range num_eventid_bits
Date: Wed, 20 May 2026 07:52:58 +0100	[thread overview]
Message-ID: <87mrxua7xx.wl-maz@kernel.org> (raw)
In-Reply-To: <4v4zv3y5yxwkfnouqcjxhrwxvnpd7c4oodevrcgivxu2aeaiyg@2b3arv4mmv7n>

On Wed, 20 May 2026 07:04:26 +0100,
Yao Yuan <yaoyuan@linux.alibaba.com> wrote:
> 
> On Mon, May 18, 2026 at 09:23:08AM +0800, Marc Zyngier wrote:
> > On Mon, 18 May 2026 07:05:13 +0100,
> > Yao Yuan <yaoyuan@linux.alibaba.com> wrote:
> > >
> > > On Sun, May 17, 2026 at 01:49:55PM +0800, Michael Bommarito wrote:
> >
> > [...]
> >
> > > > diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c
> > > > index 2ea9f1c7ebcd0..a5dcf9a6a2854 100644
> > > > --- a/arch/arm64/kvm/vgic/vgic-its.c
> > > > +++ b/arch/arm64/kvm/vgic/vgic-its.c
> > > > @@ -2307,6 +2307,15 @@ static int vgic_its_restore_dte(struct vgic_its *its, u32 id,
> > > >  	/* dte entry is valid */
> > > >  	offset = (entry & KVM_ITS_DTE_NEXT_MASK) >> KVM_ITS_DTE_NEXT_SHIFT;
> > > >
> > > > +	/*
> > > > +	 * The MAPD command rejects this case; mirror the cap here so a
> > > > +	 * restored DTE cannot install an out-of-range num_eventid_bits
> > > > +	 * that vgic_its_restore_itt() would then convert into a
> > > > +	 * sign-extended scan_its_table() length.
> > > > +	 */
> > > > +	if (num_eventid_bits > VITS_TYPER_IDBITS)
> > > > +		return -EINVAL;
> > >
> > > Hi,
> > >
> > > IIUC, the same issue is still there when VITS_TYPER_IDBITS
> > > change to >=28, I know it's limited to 16 in GITS_TYPER's
> > > definition. I mean the issue is still there w/o really be
> > > fixed.
> >
> > Change how? This is a hard-coded limit that reflect a practical use of
> > the ITS (and is already 32 times larger than what PCIe allows).
> >
> > Are you suggesting a possibility of making this userspace
> > configurable?
> 
> So far No, may until one day it has more than 16 definition :-)

This is 16 *bits*. That 2^16 possible MSIs *per device*. Please show
me a device that exceeds this requirement.

	M.

-- 
Jazz isn't dead. It just smells funny.


  reply	other threads:[~2026-05-20  6:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-17 17:49 [PATCH] KVM: arm64: vgic-its: reject restored DTE with out-of-range num_eventid_bits Michael Bommarito
2026-05-18  6:05 ` Yao Yuan
2026-05-18  8:23   ` Marc Zyngier
2026-05-20  6:04     ` Yao Yuan
2026-05-20  6:52       ` Marc Zyngier [this message]
2026-05-18  8:33 ` Marc Zyngier
2026-05-19 13:25 ` [PATCH v2] " Michael Bommarito
2026-05-20  7:17   ` Marc Zyngier

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=87mrxua7xx.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.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=michael.bommarito@gmail.com \
    --cc=oupton@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yaoyuan@linux.alibaba.com \
    --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