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 EF3193D9DB2 for ; Tue, 26 May 2026 12:24:51 +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=1779798293; cv=none; b=MuOvv/CxGrc9t2P/VlFSDB7ghCk8qHzau86V67KiDGyFXNrXWyZWGCYixdKxO1kHXTI9hPUUoaLqMeai8dPej+ks3CtVGNWaGL5jXxcS2xfOC0oEWEEk/kxK9ma+k/3zLYE9vXnHuhVP26g9Y//C2VckuEKMmj7E9yyzGmxM9Yo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779798293; c=relaxed/simple; bh=RN0mO+G+ACYE4WDsWLcz8W8a77gxolDqMQXYsghyuBY=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=LP4PPlHjrfkty/E1tcXNijrKkXzRHouvlm+vWFrrGVrIi03dgNQ6BafpGgFU4i5jqVArl1nMSPKE3ytcs6KZF/BZAQE3ySI/FpziCPAr1AEVoQ0bQhJ7MnnKjos1jGsKrv4JBgLqlQ6b1dzD+inwJABjuKgE0JDWwyJs0qNL91E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jqvCjM5T; 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="jqvCjM5T" 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) 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=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 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.