From nobody Mon Jul 15 12:38:16 2024 X-Original-To: dev-commits-src-all@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 4WN1vX40Drz5QrS7; Mon, 15 Jul 2024 12:38:16 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WN1vX1S28z4HCN; Mon, 15 Jul 2024 12:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721047096; 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=37k9JUvfH6CjW7t5/jxIQrwQgNZo/sRJafvrU0uOUmU=; b=v+lPxG+GtJh2PTvDpUcMLzReG1Q1eaODVG1+61B0BDPpaynpVg4sHNyyJolQy8H4d66zkV dBFyplQOQJS0WPkZrD2ExXnwx6C/csXn0tAMbc9YfNkrVBu0T/WxI71FvQjQ4Q2wSnJhwr YoDtR7Cm41Wn64gARW62tqGIwyoFKSSjFs6nu5LX3fjRuV7I7d1685A66aL0H+EyKcDf8L V6iPwwI9O6ZMIwUv08iqcS4tS6hBfiOe01C6bS9KdEfj1Q2bZpeUgNMv/tBkniQerXl19m znnvc8/JA9putAPc0VR5NmshexOeZJGbqlL75nPLzGHzm8opQ9QZlVkRkHpx5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721047096; a=rsa-sha256; cv=none; b=IC5Roc5kcHM6M2EUBG/GExAK3EHapn9T4SPduGoROpZ/HvBoXXZ+xX0o+qMnQqeOHhOEbP AGM3IB3lCwLi655UG8OPt0ctyxJ094tjBS3xBdN92LE4u5y7mTIltIf7lxtgDeXnhm7Rph m10/FLIELjPDPIFKhzp83tk4E56rVPhGToiZzmf/E9RYiFAP4lbgwxmhFMM3ofBMXtc5Cj xu3tvd+WEaJx/opvGJcu1+0ZhQTkNQSGV8C+kNRSyM86Ie8F5W9OcC1Tu5R1zIpY913nJw XMdtYguVUCcwTyCFIwFJrQ31dmL+Q1OYMw6V/7zJ+K7tZ8YfNIXVS3zAmTCCng== 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=1721047096; 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=37k9JUvfH6CjW7t5/jxIQrwQgNZo/sRJafvrU0uOUmU=; b=wI/ma45JMMXD3k7C16D4Wta13uo2chUGWlmRa9XWWtq218DFkm8DF/IHfPY9jKK9XefV+s i2ekfaXvHOZ6cE6UwbHeS42Sgn38/hDar1FkQjryzcZolYoDNn5SX7toPkTx9uH1VUifzP WgDyjqEDdLbPNqaIO9JG8nSgkMfl9HASSIxN4ddmAR7Jvp3o+ODm4Iw7rgs1IPz32vC83J umZXUfiVUQSXgoXiGpskqcyt58qBgSbUxb3lKW4ccA5ShkWaxKRQ9q6Iz6SRedPcKySicF 19JNxBsyH3WzzgpmLzKCJx6K+QrhOm1hoG4k//6TNNP3BQGPI9GwvZbSIUQNEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WN1vX13c8zspB; Mon, 15 Jul 2024 12:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46FCcG0x060501; Mon, 15 Jul 2024 12:38:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46FCcGrJ060498; Mon, 15 Jul 2024 12:38:16 GMT (envelope-from git) Date: Mon, 15 Jul 2024 12:38:16 GMT Message-Id: <202407151238.46FCcGrJ060498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: d7385a251abf - stable/13 - arm64/gicv3: Check if the hardware supports LPIs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: d7385a251abffa8313f0c5c981d397bb64e1a683 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d7385a251abffa8313f0c5c981d397bb64e1a683 commit d7385a251abffa8313f0c5c981d397bb64e1a683 Author: Andrew Turner AuthorDate: 2024-04-23 11:28:23 +0000 Commit: Andrew Turner CommitDate: 2024-07-15 12:34:29 +0000 arm64/gicv3: Check if the hardware supports LPIs Some simulators have the ITS in the DTB passed to the kernel, however it is a runtime configuration option to enable it. Check the GICD_TYPER register to see if LPIs are enabled before attaching the ITS driver. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44914 (cherry picked from commit 4ab0f5ab3fd6dcd7f76c1ed1c9dc0dcd152fb64f) --- sys/arm64/arm64/gic_v3.c | 4 ++++ sys/arm64/arm64/gic_v3_var.h | 2 ++ sys/arm64/arm64/gicv3_its.c | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c index e37c68aa8a5d..c90edc3ba14c 100644 --- a/sys/arm64/arm64/gic_v3.c +++ b/sys/arm64/arm64/gic_v3.c @@ -443,6 +443,10 @@ gic_v3_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) case GICV3_IVAR_REDIST: *result = (uintptr_t)sc->gic_redists.pcpu[PCPU_GET(cpuid)]; return (0); + case GICV3_IVAR_SUPPORT_LPIS: + *result = + (gic_d_read(sc, 4, GICD_TYPER) & GICD_TYPER_LPIS) != 0; + return (0); case GIC_IVAR_HW_REV: KASSERT( GICR_PIDR2_ARCH(sc->gic_pidr2) == GICR_PIDR2_ARCH_GICv3 || diff --git a/sys/arm64/arm64/gic_v3_var.h b/sys/arm64/arm64/gic_v3_var.h index d423e51453dc..1a4112a4b0ea 100644 --- a/sys/arm64/arm64/gic_v3_var.h +++ b/sys/arm64/arm64/gic_v3_var.h @@ -97,9 +97,11 @@ MALLOC_DECLARE(M_GIC_V3); #define GICV3_IVAR_NIRQS 1000 /* 1001 was GICV3_IVAR_REDIST_VADDR */ #define GICV3_IVAR_REDIST 1002 +#define GICV3_IVAR_SUPPORT_LPIS 1003 __BUS_ACCESSOR(gicv3, nirqs, GICV3, NIRQS, u_int); __BUS_ACCESSOR(gicv3, redist, GICV3, REDIST, void *); +__BUS_ACCESSOR(gicv3, support_lpis, GICV3, SUPPORT_LPIS, bool); /* Device methods */ int gic_v3_attach(device_t dev); diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c index 852db0054aa7..3acc1558cf1a 100644 --- a/sys/arm64/arm64/gicv3_its.c +++ b/sys/arm64/arm64/gicv3_its.c @@ -2018,6 +2018,9 @@ gicv3_its_fdt_probe(device_t dev) if (!ofw_bus_is_compatible(dev, "arm,gic-v3-its")) return (ENXIO); + if (!gicv3_get_support_lpis(dev)) + return (ENXIO); + device_set_desc(dev, "ARM GIC Interrupt Translation Service"); return (BUS_PROBE_DEFAULT); } @@ -2088,6 +2091,9 @@ gicv3_its_acpi_probe(device_t dev) if (gic_get_hw_rev(dev) < 3) return (EINVAL); + if (!gicv3_get_support_lpis(dev)) + return (ENXIO); + device_set_desc(dev, "ARM GIC Interrupt Translation Service"); return (BUS_PROBE_DEFAULT); }