Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp444321lqt; Thu, 6 Jun 2024 08:07:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXti4DoSF57vt3yrhpuQ5HUqYRSe8vxqgVfqsn5d1mt9t/HGRjVJgcycTX/LsFAQPX56xjVQIjwY/vaKc36mbHsBMxNIBZZX776s83dHQ== X-Google-Smtp-Source: AGHT+IFmzqpInux/50W6noG1E1hvGLEy18xrLn7JwbCFB1NMeAOie7LFNv6E3kMA/DXoArsQfwzb X-Received: by 2002:a17:903:2443:b0:1f4:7f18:6d7c with SMTP id d9443c01a7336-1f6a5a83e8bmr80718345ad.61.1717686456031; Thu, 06 Jun 2024 08:07:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717686456; cv=pass; d=google.com; s=arc-20160816; b=eTmXDLu+LLozQy5Jpe6kud7Pfm8VtxwT2y1P8U+mYUuB6mXobL99tt6dQDrod66RrA g98ohcdOQNuyhXjB3fJF7FHGBl3VNfEEatymJ2vstlnhL65Yuxke3h97nZ9d2npVORQO 8+YXlVMvtii2E7IyBthel/mbvwszB3TanX69hy/l5HYLYmabYvtBi+7wXc5+wzjF/BUc TUHvfPcWbrnP54t++JN7fY2UXifnmEZ9N4VgzRY+aoFuDb8sdEfRR2D1OhUMPWynqSA+ W6Vq4ZPdBXtBoiK/pcrXLjU0E5dfrKgHCyxSyeSKlR4rKrvRMdVpnrO9AHR12w9glJ7Y xr3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=5Om1VCSNqPpr0VK3hPFHIBndBdY4QYvPmRknCYRoy2k=; fh=/6wfxNNHD4WwdlXLDLZ8Di0nQSxvyRtLWvGiesW0b2Y=; b=gmgvl6bmqnqbDCMkaBlwAihosnqA+Q/MH7nphcaFma1arg4wA+jQIilNtY1MbuWBhL DRpRcDvuCjoAJ8lu8oYWBZ3o9ZAnguEAwg0fattI6PyRO/exQr1+PBZOZv9SBWhWjP9U rzQhUdWQ3j2hj25WIIN6Eiu6VoQ9tIKYdaejjHgTe0+Nj2osUVfiOXk0zHLoeJ7htlDR 2AVJBffHs9Qn/Qd88boH2xsdEUL0crramBPnq2G0UFNnzPBqXXifrbdUq5wkORReooHL 7WWyTO4t8m5xjAJZuNOzNUovRdPioB6FCAteRPcCDF42fDs05mSbP4Kbm0flOsuyLcue Y8Mg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=J5KIury0; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-204503-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204503-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd81d73csi6494495ad.547.2024.06.06.08.07.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 08:07:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204503-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=J5KIury0; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-204503-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204503-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 81A6B289065 for ; Thu, 6 Jun 2024 15:04:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 615351B151A; Thu, 6 Jun 2024 14:40:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="J5KIury0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="9xhHkNLU" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 985FE1ABCC6; Thu, 6 Jun 2024 14:40:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684829; cv=none; b=W3GVs4b0b5bZdIbzkvsiPbMQ8oFVGeDVQ/fBR4lzsEOO9N05+rDDtGsm5QdPCmpTsw0hfXKRkzTT4BmX4mpAIp0+D7l51H/Uw6P8pt7IIaXyy/808ySxn2pQwAJkb0l5HeUPkeMsBjGmqR0xyudbbsM94I0wxi0AdAyRYeH25Dk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684829; c=relaxed/simple; bh=r6ctxYlFhKPoW9QH9D/dZVqAI1dWiHmDq09+6Bvxatk=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=j7OVN8tI+R46j399iyHMHWfhE6XFWk2Z7mVH7K1lNqSyMzKsEa2KaGWkFikF7w2sDJQhG0rDZUztvK8lov8RoHLnR5BneVfp2NMUpkeYU2kTOyLXdNpgObvr36UsPc3047i1cAkuEmixC+NguQc/h7JZNudEgxlcryUmpXnTEV0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=J5KIury0; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=9xhHkNLU; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Thu, 06 Jun 2024 14:40:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1717684826; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5Om1VCSNqPpr0VK3hPFHIBndBdY4QYvPmRknCYRoy2k=; b=J5KIury07aNQktjb4f7Yvop/k7/06Tsp/knuerZThA71DsJftZNi3tO+el2zdH4xbf2HHU c2y2RRvcdcyz5CAbvftOmKgikYGBnr2Rcj/eWdvD3ORLU7afcuqzfTzIoEUpGLzUQYXGei mz67HrW4E7z4qEwHKiG8/QM2FBFYV40FYLFnzm7Et/WzAc6wnnceslJkdEOpkMIlay8e3A Va2RGj2kCrFNw4r3SNR+vwlM2iIx816M8uWK2BR5g4UxwWc6nF4YCTBsmzZzZifQ0ByQZ7 px/eacMUhk9PfyjojNp006mL2sOf6E3NuJ6xU7L+tAw5+k4Pb7HqZM9xnqIYpw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1717684826; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5Om1VCSNqPpr0VK3hPFHIBndBdY4QYvPmRknCYRoy2k=; b=9xhHkNLU1nAmHB7O+e80QI9cBiKTtkliqqYd9SikO6NeO8IfSmFgiGgU/5iXzgIcBnBI/R 9Bp/Ae1vy64kKaDQ== From: "tip-bot2 for Lorenzo Pieralisi" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] irqchip/gic-v3: Enable non-coherent redistributors/ITSes ACPI probing Cc: Lorenzo Pieralisi , Thomas Gleixner , Robin Murphy , Marc Zyngier , "Rafael J. Wysocki" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240606094238.757649-2-lpieralisi@kernel.org> References: <20240606094238.757649-2-lpieralisi@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171768482381.10875.281989797581205013.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the irq/core branch of tip: Commit-ID: ababa16fd9bd0e2727a1c31c4fb68d6be053bddc Gitweb: https://git.kernel.org/tip/ababa16fd9bd0e2727a1c31c4fb68d6be053bddc Author: Lorenzo Pieralisi AuthorDate: Thu, 06 Jun 2024 11:42:38 +02:00 Committer: Thomas Gleixner CommitterDate: Thu, 06 Jun 2024 16:30:15 +02:00 irqchip/gic-v3: Enable non-coherent redistributors/ITSes ACPI probing The GIC architecture specification defines a set of registers for redistributors and ITSes that control the sharebility and cacheability attributes of redistributors/ITSes initiator ports on the interconnect (GICR_[V]PROPBASER, GICR_[V]PENDBASER, GITS_BASER). Architecturally the GIC provides a means to drive shareability and cacheability attributes signals but it is not mandatory for designs to wire up the corresponding interconnect signals that control the cacheability/shareability of transactions. Redistributors and ITSes interconnect ports can be connected to non-coherent interconnects that are not able to manage the shareability/cacheability attributes; this implicitly makes the redistributors and ITSes non-coherent observers. To enable non-coherent GIC designs on ACPI based systems, parse the MADT GICC/GICR/ITS subtables non-coherent flags to determine whether the respective components are non-coherent observers and force the shareability attributes to be programmed into the redistributors and ITSes registers. An ACPI global function (acpi_get_madt_revision()) is added to retrieve the MADT revision, in that it is essential to check the MADT revision before checking for flags that were added with MADT revision 7 so that if the kernel is booted with an ACPI MADT table with revision < 7 it skips parsing the newly added flags (that should be zeroed reserved values for MADT versions < 7 but they could turn out to be buggy and should be ignored). Signed-off-by: Lorenzo Pieralisi Signed-off-by: Thomas Gleixner Reviewed-by: Robin Murphy Acked-by: Marc Zyngier Cc: "Rafael J. Wysocki" Link: https://lore.kernel.org/r/20240606094238.757649-2-lpieralisi@kernel.org --- drivers/acpi/processor_core.c | 15 +++++++++++++++ drivers/irqchip/irq-gic-v3-its.c | 4 ++++ drivers/irqchip/irq-gic-v3.c | 9 +++++++++ include/linux/acpi.h | 3 +++ 4 files changed, 31 insertions(+) diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index b203cfe..915713c 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -215,6 +215,21 @@ phys_cpuid_t __init acpi_map_madt_entry(u32 acpi_id) return rv; } +int __init acpi_get_madt_revision(void) +{ + struct acpi_table_header *madt = NULL; + int revision; + + if (ACPI_FAILURE(acpi_get_table(ACPI_SIG_MADT, 0, &madt))) + return -EINVAL; + + revision = madt->revision; + + acpi_put_table(madt); + + return revision; +} + static phys_cpuid_t map_mat_entry(acpi_handle handle, int type, u32 acpi_id) { struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 40ebf17..af5297e 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -5600,6 +5600,10 @@ static int __init gic_acpi_parse_madt_its(union acpi_subtable_headers *header, goto node_err; } + if (acpi_get_madt_revision() >= 7 && + (its_entry->flags & ACPI_MADT_ITS_NON_COHERENT)) + its->flags |= ITS_FLAGS_FORCE_NON_SHAREABLE; + err = its_probe_one(its); if (!err) return 0; diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 6fb2765..e4bc5f0 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -2349,6 +2349,11 @@ gic_acpi_parse_madt_redist(union acpi_subtable_headers *header, pr_err("Couldn't map GICR region @%llx\n", redist->base_address); return -ENOMEM; } + + if (acpi_get_madt_revision() >= 7 && + (redist->flags & ACPI_MADT_GICR_NON_COHERENT)) + gic_data.rdists.flags |= RDIST_FLAGS_FORCE_NON_SHAREABLE; + gic_request_region(redist->base_address, redist->length, "GICR"); gic_acpi_register_redist(redist->base_address, redist_base); @@ -2373,6 +2378,10 @@ gic_acpi_parse_madt_gicc(union acpi_subtable_headers *header, return -ENOMEM; gic_request_region(gicc->gicr_base_address, size, "GICR"); + if (acpi_get_madt_revision() >= 7 && + (gicc->flags & ACPI_MADT_GICC_NON_COHERENT)) + gic_data.rdists.flags |= RDIST_FLAGS_FORCE_NON_SHAREABLE; + gic_acpi_register_redist(gicc->gicr_base_address, redist_base); return 0; } diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 28c3fb2..000d339 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -279,6 +279,9 @@ static inline bool invalid_phys_cpuid(phys_cpuid_t phys_id) return phys_id == PHYS_CPUID_INVALID; } + +int __init acpi_get_madt_revision(void); + /* Validate the processor object's proc_id */ bool acpi_duplicate_processor_id(int proc_id); /* Processor _CTS control */