From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E81233F5B5; Wed, 20 May 2026 06:49:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779259794; cv=none; b=YVR7o9C2Gzpp3OArRaIBmUNiCmFvO9Wr2exx7KXdkAUwWDuj/7hbXlt7WlVzqzDkfMxgkquHwytVD4x87v+gRLdOQB8vDGQnGBkZpi+jzimWzG30MxVGjUt/+SfE8G3fdceEbxq9+N6jkSKU4R/uR8ZyGWIWQ3O/hhqvSXg8Kp4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779259794; c=relaxed/simple; bh=zEh1oPzhKzOoSL5FG7JVzsIJzlLRDEcwcyUmtlTtYSo=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=caYENfMN5WZpKudVHZnSX0jdr8osi7Y1ZfjpCVgXbS1dw17nF+4HLCC7so5bSrQlqjmLAQJG9+LldSasYTUfc89L7e1JZ0X6f/TogabAEdOe+kD6yfms4oQIfMl80c9Me4JCOFVj6qx8d4LT7OvrNnEeUcyMUI+H1PgTv5riwZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TzarIWMh; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TzarIWMh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B51E1F00894; Wed, 20 May 2026 06:49:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779259792; bh=SYGoO+3vr+wCVS6zRiEdGY9MLJHWWaWiqDe/o0mDGzI=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=TzarIWMhkmz7SMufc86TM8YhhsuQ0r0YK/YsACMLXuPR8iZ/yobd3WtClK3szEgvT xpYLpdhGQAdpnizcPga1PxAdAzd1j8f4LQ17NOP+3eKonM6Zk2k/F3TNWSSg6xUeOA IRnwtto+REyB0zr5DKzwwZ00EQC7/qshn6m/ssweryX3pAWUk5boGpqwKWm3v7t582 LdeDABgNCWBwS8YkUuW6DdGhST4rAAZSvUQg1oyk8eXuHZLsMYW63rCEGhVIPnHtCG SvqngTpnLcE8AtmLbxK7pVQERuclLfW3h41hnFOt7+84NFcXxKfg+3GYxqHWTgouEU qNgc5CEbK3j8w== Received: from sofa.misterjones.org ([185.219.108.64] helo=lobster-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wPakY-00000004Exw-0GXy; Wed, 20 May 2026 06:49:50 +0000 Date: Wed, 20 May 2026 07:52:58 +0100 Message-ID: <87mrxua7xx.wl-maz@kernel.org> From: Marc Zyngier To: Yao Yuan Cc: Michael Bommarito , Oliver Upton , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , 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 In-Reply-To: <4v4zv3y5yxwkfnouqcjxhrwxvnpd7c4oodevrcgivxu2aeaiyg@2b3arv4mmv7n> References: <20260517174955.273004-1-michael.bommarito@gmail.com> <8633zpxh1v.wl-maz@kernel.org> <4v4zv3y5yxwkfnouqcjxhrwxvnpd7c4oodevrcgivxu2aeaiyg@2b3arv4mmv7n> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: yaoyuan@linux.alibaba.com, michael.bommarito@gmail.com, oupton@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Wed, 20 May 2026 07:04:26 +0100, Yao Yuan 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 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.