From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 60185CD5BC8 for ; Tue, 26 May 2026 12:25:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Subject:Cc:To:From: Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kXHQg71bAXxckbX3tH5zEBgAoUtODudj6ZHDRQ1RDpY=; b=kONE7W0Zp1fCHm2M6SeC5T3BOp SKrH7+NW/ZAd+9TJCpb8S/dGQD5TcKEDIE+2yDMZzjPXmuNICRNTfcDRvx1STcCWYeSSKQ1IWa/L/ gYuHIfX7lYvTa6PQJhS9Rt3Up+gIVwgjYmeD/B9MEE5zcpTPfuyXFKMoOkWhbTNfWTz5FR0p/lusQ 5+axeUFyUcAbQ32mZ0RszbqnfUKorW6QxwBeLB7xM2DNaUmHIMPy/4VImVoqBOkE4t3mQSBtGXaGC CX8N9ratGvtKTCaxNPmtbwg0+6PnduqXR/IVN07RDd0kZrcvX57rFbinC+YJGam6a2yD/Pk93lj4l sty+23vQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wRqq5-00000001uK4-3VWR; Tue, 26 May 2026 12:24:53 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wRqq5-00000001uJl-0rTB for linux-arm-kernel@lists.infradead.org; Tue, 26 May 2026 12:24:53 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id E6B4A6008A; Tue, 26 May 2026 12:24:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D8B11F000E9; Tue, 26 May 2026 12:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779798291; bh=kXHQg71bAXxckbX3tH5zEBgAoUtODudj6ZHDRQ1RDpY=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=jqvCjM5TZzau8HI4W9fqEBQhzTBsxmznDYVIh8+zjv2k6+YRoDBhoCjh859/i/Ktj nEy93gnloejDZuYZF5LlmUYkruN2DYtgBHyL7l++XQw1Eix7w4BwAwtUkPermuddjm crNoL2tcrWjyBFzrQxa6HfHqC4yJZsbf5PBAN0oAx0DWUj/Kxh80ShVcbPDZg+0Vzp ioUi1S2zyXNWwgJ+07QA/CXGe5cMB2v68wZHWzU+cJIL5Ep/KrDb292w16NHDOaVvV RxylSYyZfS2nC/AfzfnvnUwfIffWpPH63KjQklVEdFeGyKNmkhIqI1xab5ZuwliJhn q1h4kApxkQXLA== 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 1wRqq1-00000006GFf-22kQ; Tue, 26 May 2026 12:24:49 +0000 Date: Tue, 26 May 2026 13:24:49 +0100 Message-ID: <86v7cauzn2.wl-maz@kernel.org> From: Marc Zyngier To: Mostafa Saleh Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, tglx@kernel.org Subject: Re: [PATCH v2] irqchip/gic-v4: Harden against bogus command line In-Reply-To: <20260526112618.3629321-1-smostafa@google.com> References: <20260526112618.3629321-1-smostafa@google.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) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: smostafa@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, tglx@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 26 May 2026 12:26:18 +0100, Mostafa Saleh wrote: >=20 nit: $SUBJECT isn't quite telling the full story, and the command-line is only a second order effect. Something like: "irqchip/gic-v4: Don't advertise VLPIs if no ITS is probed" actually describes the nature of the issue. > When accidentally setting =E2=80=9Ckvm-arm.vgic_v4_enable=3D1=E2=80=9D on= the wrong > setup that has no MSI controller device tree node (it exists but > not used) and GICv4, it caused a panic as =E2=80=9Cgic_domain=E2=80=9D is= NULL and > the kernel attempted to access its ops. >=20 > Originally, I hit this on an older kernel, but was able to reproduce > it on upstream with Qemu by hacking this unreasonable setup. >=20 > [ 33.145536] Unable to handle kernel NULL pointer dereference at virtua= l address 0000000000000028 > [ 33.145658] Mem abort info: > [ 33.145751] ESR =3D 0x0000000096000006 > ... > [ 33.154057] CPU: 1 UID: 0 PID: 295 Comm: lkvm-static Not tainted 7.1.0= -rc4-ge3f15ad3970e #5 PREEMPT > [ 33.156922] Hardware name: linux,dummy-virt (DT) > [ 33.158780] pstate: 81402005 (Nzcv daif +PAN -UAO -TCO +DIT -SSBS BTYP= E=3D--) > [ 33.160340] pc : __irq_domain_instantiate+0x1d4/0x578 > [ 33.162602] lr : __irq_domain_instantiate+0x1cc/0x578 >=20 > Set vLPI support to false at init time if the host has no ITS, so it > propagates properly to kvm_vgic_global_state.has_gicv4. > > Suggested-by: Marc Zyngier > Signed-off-by: Mostafa Saleh >=20 > --- > v2: Fix the issue at construction as Marc suggested. > --- > drivers/irqchip/irq-gic-v3-its.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v= 3-its.c > index 291d7668cc8d..d02cb9c17c0b 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -5837,6 +5837,7 @@ int __init its_init(struct fwnode_handle *handle, s= truct rdists *rdists, > its_acpi_probe(); > =20 > if (list_empty(&its_nodes)) { > + rdists->has_vlpis =3D false; > pr_warn("ITS: No ITS available, not enabling LPIs\n"); > return -ENXIO; > } With the above fixed: Acked-by: Marc Zyngier M. --=20 Without deviation from the norm, progress is not possible.