From nobody Thu Feb 5 14:02:22 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f6JnW2Zs1z6QZy7 for ; Thu, 05 Feb 2026 14:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f6JnV5Srrz462k for ; Thu, 05 Feb 2026 14:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770300142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JucA4C/8Ml4fSXJ7panRciW3aOwtN4c7eiEUwmIxOTw=; b=TxOYu0i2dtluhGHltGYJGbNVgfHN/NjzAyDXHgJBdKBsKNki8oDT7egEmi0TaPCT10UXzn WAP2iTVt8XXT+Y0Vak8xgs5XTGd+iQzWF3/lfpknn3VWbjtQ9nZsvUVM1+7zEkWx7Lya0h vxLE10Ryv6pET8K0HuiR3qLi8ihAb6B6/ZEhWcRc4VSgCq0zU/KUeaMQ+Zb+CPrj8jdYwE tupBH5m6yeaTnnEZw8TUm83VR6ss/5krkxaT+39aBbSSSyHBHRr+n+ZACgPY+lJfU/sOhZ L6IjwWlISxuVHR59kW8rZnz9WP6QCwG/piHqzJsaUUNvAoJWdv2nde7/Rosx/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770300142; a=rsa-sha256; cv=none; b=MRp16OQrupHuaTojButDKlsQXbP/8wWInQtYbDsl0jMqiISWmIcl52qIGkhhOVDBSLVk4P XpRM6Q/FGo6NbwvBzZukNU8DHmUTlXahC9ao9uZGY25BJg3EsKFJeSC66C7PayqzYMwA2i xXmj/pjj2vuselV3Q6YFkOQpvgqMHH9kyQJ6lNQv04n9998uL/rTh6nRItMIZeY870bdRn tMYS9PdkUVO7gLaaBmPQ3omb7zWOmCeoamxDWxfmLlYWeM5qa+3Ctr/AVtjQwCq9X7orUP 7nynfBTT8EHZ0gAvK183rlFuADydgya2T9Sa64haiL6RMHg0YsiZFZjlboyxUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770300142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JucA4C/8Ml4fSXJ7panRciW3aOwtN4c7eiEUwmIxOTw=; b=vD/Lf+9t0gR3QWor1abwBT6cSQIv4B36nolVU+8/Ve/98KTrlnuGDMWMLVxqibkOJdJl36 wyRfmnErjXLQqBfzkKOm4KRcCoMYzP6H3bed0vt6JWng25M1d7ssL5UpVzS1ARPyIhLjW1 43lKKtt8B/Z626wT7hU9Sd2ONsh2zupW1VGESBkOzuqnPVWujvGIFDcXbnsEXAXIesD5al aV91oxpRyNvbK4cgcpCCCep/9qDolwEY1zbSz4HLLFQmO2HKlPSY/Tg+lYx2aT/v4y0ZGb 1DzZaV07fA2Vlv2jGHVAufTvkrUhH+D688GWNpcJGXT6w7eptwt5Uvr3bQ6XTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f6JnV4zjVzYvF for ; Thu, 05 Feb 2026 14:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38096 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 05 Feb 2026 14:02:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: c12d6cc326b7 - main - arm64: Attach the vgic even if there is no ITS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c12d6cc326b70326d776324067bdf07e4fa328aa Auto-Submitted: auto-generated Date: Thu, 05 Feb 2026 14:02:22 +0000 Message-Id: <6984a2ee.38096.5a1218ca@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c12d6cc326b70326d776324067bdf07e4fa328aa commit c12d6cc326b70326d776324067bdf07e4fa328aa Author: Andrew Turner AuthorDate: 2026-01-19 14:24:14 +0000 Commit: Andrew Turner CommitDate: 2026-01-21 17:25:04 +0000 arm64: Attach the vgic even if there is no ITS If there is no ITS device so no memory resources the gicv3 driver would exit attaching early. This caused the vgic driver to also not be attached, even if it could. Reported by: novel@ Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54791 --- sys/arm64/arm64/gic_v3_fdt.c | 57 +++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c index 871516145168..a71114881906 100644 --- a/sys/arm64/arm64/gic_v3_fdt.c +++ b/sys/arm64/arm64/gic_v3_fdt.c @@ -86,7 +86,7 @@ EARLY_DRIVER_MODULE(gic_v3, ofwbus, gic_v3_fdt_driver, 0, 0, /* * Helper functions declarations. */ -static int gic_v3_ofw_bus_attach(device_t); +static void gic_v3_ofw_bus_attach(device_t); /* * Device interface. @@ -193,12 +193,7 @@ gic_v3_fdt_attach(device_t dev) * GIC will act as a bus in that case. * Failure here will not affect main GIC functionality. */ - if (gic_v3_ofw_bus_attach(dev) != 0) { - if (bootverbose) { - device_printf(dev, - "Failed to attach ITS to this GIC\n"); - } - } + gic_v3_ofw_bus_attach(dev); if (device_get_children(dev, &sc->gic_children, &sc->gic_nchildren) != 0) sc->gic_nchildren = 0; @@ -298,7 +293,7 @@ gic_v3_ofw_fill_ranges(phandle_t parent, struct gic_v3_softc *sc, * Collects and configures device informations and finally * adds ITS device as a child of GICv3 in Newbus hierarchy. */ -static int +static void gic_v3_ofw_bus_attach(device_t dev) { struct gic_v3_ofw_devinfo *di; @@ -313,8 +308,13 @@ gic_v3_ofw_bus_attach(device_t dev) if (parent > 0) { rv = gic_v3_ofw_fill_ranges(parent, sc, &addr_cells, &size_cells); - if (rv != 0) - return (rv); + if (rv != 0) { + if (bootverbose) { + device_printf(dev, + "Failed to attach ITS to this GIC\n"); + } + goto vgic; + } /* Iterate through all GIC subordinates */ for (node = OF_child(parent); node > 0; node = OF_peer(node)) { @@ -369,28 +369,31 @@ gic_v3_ofw_bus_attach(device_t dev) sc->gic_nchildren++; device_set_ivars(child, di); } - } - /* - * If there is a vgic maintanance interrupt add a virtual gic - * child so we can use this in the vmm module for bhyve. - */ - if (OF_hasprop(parent, "interrupts")) { - child = device_add_child(dev, "vgic", DEVICE_UNIT_ANY); - if (child == NULL) { - device_printf(dev, "Could not add vgic child\n"); - } else { - di = malloc(sizeof(*di), M_GIC_V3, M_WAITOK | M_ZERO); - resource_list_init(&di->di_rl); - di->di_gic_dinfo.gic_domain = -1; - di->di_gic_dinfo.is_vgic = 1; - device_set_ivars(child, di); - sc->gic_nchildren++; +vgic: + + /* + * If there is a vgic maintanance interrupt add a virtual gic + * child so we can use this in the vmm module for bhyve. + */ + if (OF_hasprop(parent, "interrupts")) { + child = device_add_child(dev, "vgic", DEVICE_UNIT_ANY); + if (child == NULL) { + device_printf(dev, + "Could not add vgic child\n"); + } else { + di = malloc(sizeof(*di), M_GIC_V3, + M_WAITOK | M_ZERO); + resource_list_init(&di->di_rl); + di->di_gic_dinfo.gic_domain = -1; + di->di_gic_dinfo.is_vgic = 1; + device_set_ivars(child, di); + sc->gic_nchildren++; + } } } bus_attach_children(dev); - return (0); } static struct resource_list *