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 EC70C3264CB; Sat, 15 Aug 2026 10:57:27 +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=1786791449; cv=none; b=owzAZarTxMkRSdDFkvdOZ+iLAKqH6/OPHRtAzCRY0gqtgzlLEuU65+jlc/A71v8VZlLjxNDrr/ezfAtEPEQt512/uE+Ui0cZL6UhNcx28VQwrOz6SFQyt1BAEq/m6x9604gWDnGWY7kk0rhAkAQ2ocFuukYnzQ+07j7DUHw8QqU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786791449; c=relaxed/simple; bh=9ZZsIPJvQ4oTXZDcdbVq0S3Y1eoSAmQvOSgmSSPlqsE=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=fD0Nlz5qSkyZ5DZficMomuQQGnAtLke3srRv384sic/bRjyYtSTbiY5PYeDrqKl/NYrC2wpaYznQ1FvTSGhuR9qKemQQ2ynHAvzgJqgLwGEr/cSbcFx1ksjtLPjx4f5vK/N7YX/VGYwFmZ1tG2cAPACF7tUWSsX1FbjDu/y3KzQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IiqZEHXO; 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="IiqZEHXO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 897FC1F000E9; Sat, 15 Aug 2026 10:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786791447; bh=UzMEI1MTAOXlmFMkVLNj5lVlgOkP81/6CiG3vw2PuIk=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=IiqZEHXOLZffGOcgY5ayZvce6UcpLb5BMTb4EJj6LZM/b2JNIuTSmYtGiJ5Vo0k3j sXNQ3l2VbvP1QhYZ6iHDANq1++B4KIZRXCMMp98o3AuBTaLvGaYauV7GOQtAd0+XN0 Klf8oiLC1az4AqgAlXbx/Lp9BXbntA/fkN2p/46332ZigCTTKnENJ5didJl7A6IWWc aMp32dzUw2rgy2yz3tO8tLAvXW0FMdwCFw/ERCs+E40KmFxZQHbBABqQlewnT35By0 8u0qq1+qzZCc0qLiRVYsFhvj2VFq9x/U9jr1NnXPwX807pUqGcS0Bb6sHVAz8jCvlc kjYPJVcW0s9BA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-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 1wvC4r-0000000FseR-0emI; Sat, 15 Aug 2026 10:57:25 +0000 Date: Sat, 15 Aug 2026 11:57:24 +0100 Message-ID: <86wltrzm5n.wl-maz@kernel.org> From: Marc Zyngier To: Karl Mehltretter Cc: Oliver Upton , Sascha Bischoff , Paolo Bonzini , Jonathan Corbet , Shuah Khan , Jonathan Cameron , Timothy Hayes , kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Documentation: KVM: Fix the GICv5 KVM_IRQ_LINE PPI range In-Reply-To: <20260815092537.31737-1-kmehltretter@gmail.com> References: <20260815092537.31737-1-kmehltretter@gmail.com> 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: kmehltretter@gmail.com, oupton@kernel.org, sascha.bischoff@arm.com, pbonzini@redhat.com, corbet@lwn.net, skhan@linuxfoundation.org, jic23@kernel.org, timothy.hayes@arm.com, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-doc@vger.kernel.org, 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 Sat, 15 Aug 2026 10:25:37 +0100, Karl Mehltretter wrote: > > KVM rejects GICv5 PPI irq_id values above 63, while the documented > range extends to 127. KVM also rejects PPIs not present in the This is on purpose, and that's not a bug. > KVM_DEV_ARM_VGIC_USERSPACE_PPIS mask. That mask is populated by > KVM_DEV_ARM_VGIC_CTRL_INIT; reading it beforehand currently succeeds > but returns all zeroes. > > Correct the range, document the mask restriction, and require the mask > to be queried after VGIC initialization. > > Fixes: b88d05a893cb ("KVM: arm64: gic-v5: Support GICv5 interrupts with KVM_IRQ_LINE") > Assisted-by: Claude:claude-fable-5 > Signed-off-by: Karl Mehltretter > --- > Documentation/virt/kvm/api.rst | 4 +++- > Documentation/virt/kvm/devices/arm-vgic-v5.rst | 3 +++ > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst > index e3003a241d5b0..6d8fd74174492 100644 > --- a/Documentation/virt/kvm/api.rst > +++ b/Documentation/virt/kvm/api.rst > @@ -912,7 +912,9 @@ The irq_type field has the following values: > in-kernel GICv5: SPI, irq_id between 0 and 65535 (incl.) > - KVM_ARM_IRQ_TYPE_PPI: > in-kernel GICv2/GICv3: PPI, irq_id between 16 and 31 (incl.) > - in-kernel GICv5: PPI, irq_id between 0 and 127 (incl.) > + in-kernel GICv5: PPI, irq_id between 0 and 63 (incl.), and No. Please understand the difference between *implementation* and *architecture*. Also, the GICv5 architecture mandates which PPI is used for which device for the range 0-63. This is not a carbon copy of the previous versions. > + only if present in the mask returned by the > + KVM_DEV_ARM_VGIC_USERSPACE_PPIS attribute Which, if you look carefully enough, returns a 128bit mask, as per the architecture. > > (The irq_id field thus corresponds nicely to the IRQ ID in the ARM GIC specs) > > diff --git a/Documentation/virt/kvm/devices/arm-vgic-v5.rst b/Documentation/virt/kvm/devices/arm-vgic-v5.rst > index d328cf1e22c1f..e24aed0c4afcd 100644 > --- a/Documentation/virt/kvm/devices/arm-vgic-v5.rst > +++ b/Documentation/virt/kvm/devices/arm-vgic-v5.rst > @@ -35,6 +35,9 @@ Groups: > populated with the userspace PPI mask. The lower __u64 contains the mask > for the lower 64 PPIS, with the remaining 64 being in the second __u64. > > + Userspace must query this attribute after initializing the VGIC with > + KVM_DEV_ARM_VGIC_CTRL_INIT. > + Must? Why? Userspace can perfectly live with ever querying this. M. -- Without deviation from the norm, progress is not possible.