From patchwork Tue Jun 6 12:56:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kulkarni, Ganapatrao" X-Patchwork-Id: 9768869 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 47B7F60364 for ; Tue, 6 Jun 2017 13:06:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40F17209D8 for ; Tue, 6 Jun 2017 13:06:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3504027E71; Tue, 6 Jun 2017 13:06:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=0.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 32792209D8 for ; Tue, 6 Jun 2017 13:06:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=i4wpSTw6XsnRvDjNnmb0mkztmu+lwoPkfG5jdww/cTY=; b=OtqndC82sgP6rI d2Nm9spJ9E2rPl8zQDYLPcarCeubj66FJn3c/PPPNDu21JfHZPru9PbWERjaruAQ8tC2gauH2S24E JZ/MivhuvL3+oxLvlDmKc1z0SfLC+9fx1JUyARak8jKQS3sHtT1npf6YjRgPjPTCRgrUvnzFuqoRG KN4iJAWOdH5Nhzzle23YJ1ch9Rf0eXHM+S3DxkzgEyImoBidT6ex+9KVnrDe/Vm+Wh7xBgmNpn386 yFv9wantmvSkr2sGszikQxt81VD+v9AvAUGnc6Xl5bBDbTrJPe1mjlFuxzqTFSjYs2Xsv2kYHWa92 KM7xvypscrxezRCXDLaA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dIEBm-0002au-9V; Tue, 06 Jun 2017 13:06:26 +0000 Received: from mail-bl2nam02on0062.outbound.protection.outlook.com ([104.47.38.62] helo=NAM02-BL2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dIE3S-0005wH-G2 for linux-arm-kernel@lists.infradead.org; Tue, 06 Jun 2017 12:57:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=DZvBwfybuTzTNjr4fzI2dD26f2d7AF0js/Z6bx1C7fI=; b=RpHMrm6niwyeQVq/7G1xYjjSIxB5pRVbazcrZVJQbKKjtJ5JtAIj3sYBiCd5ukUWsAj15//RirtHUoViRwE0+++WVGPXvGgD/1X23V06ckC5gCOoK1g45FSIspWUu6ife9566iefM8p5aZ6kc5EvUAjvdPwqup1D8zEG6bv8yL4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=cavium.com; Received: from mypc.cavium.com.com (111.93.218.67) by CY1PR07MB2572.namprd07.prod.outlook.com (10.167.16.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Tue, 6 Jun 2017 12:57:16 +0000 From: Ganapatrao Kulkarni To: linux-acpi@vger.kernel.org, devel@acpica.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] acpi, gicv3-its, numa: Adding numa node mapping for gic-its units Date: Tue, 6 Jun 2017 18:26:27 +0530 Message-Id: <1496753787-27735-3-git-send-email-ganapatrao.kulkarni@cavium.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1496753787-27735-1-git-send-email-ganapatrao.kulkarni@cavium.com> References: <1496753787-27735-1-git-send-email-ganapatrao.kulkarni@cavium.com> MIME-Version: 1.0 X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0092.INDPRD01.PROD.OUTLOOK.COM (10.174.56.32) To CY1PR07MB2572.namprd07.prod.outlook.com (10.167.16.134) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR07MB2572: X-MS-Office365-Filtering-Correlation-Id: e92269f0-409d-44f1-b3ed-08d4acdb9121 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR07MB2572; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2572; 3:RSuuURTkTFidhL88XkC/AIyykorjmZEd/q3Fmux5Mb+9GNDDHYLIDudrQIAzw/FURy/HVB+a23VQBHZEWTwve3nOFvj/3NP7e/njdevnnSwIsDVw1Eeh58HyiLdOr+4cDvZny4aZOcHkU0LEliJtd2DHcJ+3bQhMzMakv9rU35XKiSPGDM5XHZX2r7xfPxhzCi6JoCM97JRlGDp+sre0pcZ5+4+Tmvxum+uJ/njZUlbfBIj0EwEoEgeS4Ssdumjyl8733NGEL+akDCJ72XbOsJz0zdUOwh8EIJ/Z56PPAhv76ewftMJ9WdwpTikilvYEqYn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udbn3Pqe0nmxIyFykNLBU2XJzgYryFFN6HqIHf6tMx41wMktUYMtNVE3h69c0o2cgTH5QL8gDnygpjblkJVO+dK13PNbwMFPLyYUXvqpFs2JVN8CmhLX+tQL89aK9V9rTD1QOI1kJGHeTk2h1RLKKZrGq0SRuKvZYrWUY6NwFosZr57pGUv9ev909chGKo1t50xr7lM3KhpK7qjdcBr2bZvPXWXufPsswTezd45XFVX7MI5dof0xu X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR07MB2572; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR07MB2572; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2572; 4:8zLA2ncy439B7aOG0EARICijaTKW6ZcsYTWZp9Dji3?= =?us-ascii?Q?Ovv4qxIEHAt4cFKHSMaxAD5sehUIG3+jIAJ5j8x5Dhe81eCIpRrStw1pXjmZ?= =?us-ascii?Q?FavJxOKWlxgTxkWjCAQ9rSeUIqtHAPcrFET3WuMmOIgcAn2XUHhciBzsvtXJ?= =?us-ascii?Q?ouYGd3EAnsdRC0oTBNbwDoJ2nzekRhtdNSYFao81y4LGs72OiEbNMpQmVyfZ?= =?us-ascii?Q?Vo0IL+drk+0DBMdS/WXZP6JdKqYC4qm58/MEYtJlRacB2nNRvDreqwIWZvKZ?= =?us-ascii?Q?hQOcRIl4vjgTMer9BQGHYU/ozoyEMBsfFEsQQlHt4MBDOC593lWtmghNJB4d?= =?us-ascii?Q?W+VKtEg/q0mPzB3wMhDC6zpITU7786zdfH+/dzVN8km8xvItmP5e6WyHG364?= =?us-ascii?Q?MSPzHw3v1k9NWx+IKj7IyZ654b8ghI8T1Dh1FSrAhG8VNGGjdvuGfJcZBCq7?= =?us-ascii?Q?6IaYHVOYhqi24lCUFJe1QAcyf2i18NLNoLDN03r7gr0FjW1dKEwIi4SkRMf8?= =?us-ascii?Q?5YNEnAVVl0fyDIuZW9G+y+Uqk4neuXXL5v7W7Qcis4CYBcZrMJYOt9uGNqmL?= =?us-ascii?Q?f96rrJfonh0gbWql/+hE4CqjyMfd5fTlmKot3eViC9yuzWaLnISALKSPYpUH?= =?us-ascii?Q?62dniX5eCMB/sc4WPDQpDWuDpqDTTAQnFNywDk5r4T0YJygzsFjeDIG5Q8Cc?= =?us-ascii?Q?gj6UQxYtuzI4hmODCiF69cWbgsOUZaqAgCLVuGY0pyEZvnQwDLC0f1xTpcCD?= =?us-ascii?Q?GT2jEPLKPYrVr7EXhcW/WS//ZG7KXrhrNV+TNkHBDPU08att0PIFPxJ+0ezj?= =?us-ascii?Q?zOQGR41l41bgaghg91AI9lw6gYzax/tnv6cMtl7gWNQ3VzhStZuR7q4D4/Eq?= =?us-ascii?Q?xiBVhIX/XpicWiVqZ28ernnfK6KGiuPW1WT+F49vP2Am/vZTppz7hqkqOy4u?= =?us-ascii?Q?/dVlxgPt9elVxwBtpBmbJtwMFgBF0oW/1wtQOE4GPWSAhVfRePnBvR5Q6ZEf?= =?us-ascii?Q?yT2tt/yDBR1QHMf3oZvWSNrLuC+HPfMsqecjQ7spuLJYQQclnCkh5f74biVc?= =?us-ascii?Q?FLu61YELBm/ng4fXBL8EuEG8vh8deepOMYumw443N8j41UPzdimQoHPrxPNz?= =?us-ascii?Q?pDaoAErsrz0ed6EWvqM7EeSvR8k+Vl?= X-Forefront-PRVS: 033054F29A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39850400002)(39400400002)(39840400002)(39450400003)(25786009)(72206003)(5003940100001)(50466002)(48376002)(4720700003)(478600001)(6666003)(53936002)(4326008)(2950100002)(86362001)(575784001)(6506006)(36756003)(6116002)(6486002)(6512007)(5009440100003)(42186005)(3846002)(189998001)(76176999)(50986999)(5660300001)(7416002)(305945005)(2906002)(50226002)(38730400002)(33646002)(110136004)(7736002)(66066001)(47776003)(81166006)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2572; H:mypc.cavium.com.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2572; 23:FOOh3vE20VeO/SXHfti80tVhzHanMNXO4mVV5oXiW?= =?us-ascii?Q?aMrS9MJ48lJB1z1tEGy45xru3EIHDaOolS1x9kdUDz0Tssf9X3y3p0JhTDdM?= =?us-ascii?Q?cGq9SY0zQ+ixjtHRPEwO+/q142lr4HqsDCl9/HpCR8UTQIcxU55E+GEa4RJJ?= =?us-ascii?Q?Am6bWzc0nzt3ad+jp+vm69eAly/FSf0UIE+/sKdkrDjcmDooXJmIRLk/2/Q0?= =?us-ascii?Q?Ehz3pz6Yu/Fsfreogj9DX364S5vn/5rm4nb+tRXuOudnHJG0OZvxxFienepN?= =?us-ascii?Q?ljXqgo8XZsGT7Neyf97XH1L9zyiJJdunAVgtAhGIW/2SC3wOVDKCgm5UBuHR?= =?us-ascii?Q?qGaDdlHSTRFcbHxA54KgUJTcq2gmSd+gEWkApB2yPOSXeJFP7JZN55+8uII2?= =?us-ascii?Q?1RmeduWlKB3GJzEtb19AaFSuUWiaUmHdbCEKi+yWFz9EQd7xd/cQ8OBH0+R6?= =?us-ascii?Q?JyI7I1SHeW52TFiBy/NJWiAdO9hIMPW8Vwe3JCZ18XhY17PHO6gk4rvGVIQe?= =?us-ascii?Q?EHZzOAnfw7XP20fa5oOqqiPEI065ciJPK6cvY2jXyB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OFAjQVktDpTG+yRJ/ZreYa+5JVcxhMQ6KDTM72UbCiVzRrl9eWmnb6AemmsPafhtQxIa/VkRBPwF84azBEASfmzRXsDYKMk4QAGAyGvDo46H6Yl+vopr6HEpmk99NhEyZXifkoc+5LVKn6aECv1D++FV1nfvTwcRTcGMljzPXY0KicYjlWOL/YefLhqnux0OhAiPEAAPZtymtvJ59GWULPSmvWrbZNFNuozn8N+VP0eSpw== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2017 12:57:16.3646 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2572 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170606_055750_751708_60E0A773 X-CRM114-Status: GOOD ( 14.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jason@lakedaemon.net, marc.zyngier@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, robert.moore@intel.com, lv.zheng@intel.com, tglx@linutronix.de, gpkulkarni@gmail.com, jnair@caviumnetworks.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add code to parse SRAT ITS Affinity sub table as defined in ACPI 6.2 Later in driver probe, its devices are mapped to numa node using its id to proximity domain mapping. Signed-off-by: Ganapatrao Kulkarni --- arch/arm64/include/asm/acpi.h | 2 ++ arch/arm64/kernel/acpi_numa.c | 59 ++++++++++++++++++++++++++++++++++++++++ drivers/acpi/numa.c | 32 +++++++++++++++++++++- drivers/irqchip/irq-gic-v3-its.c | 3 +- include/linux/acpi.h | 3 ++ 5 files changed, 97 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index 0e99978..60ea7d1 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -143,9 +143,11 @@ static inline void arch_apei_flush_tlb_one(unsigned long addr) #ifdef CONFIG_ACPI_NUMA int arm64_acpi_numa_init(void); int acpi_numa_get_nid(unsigned int cpu, u64 hwid); +int acpi_numa_get_its_nid(u32 its_id); #else static inline int arm64_acpi_numa_init(void) { return -ENOSYS; } static inline int acpi_numa_get_nid(unsigned int cpu, u64 hwid) { return NUMA_NO_NODE; } +static inline int acpi_numa_get_its_nid(u32 its_id) { return NUMA_NO_NODE; } #endif /* CONFIG_ACPI_NUMA */ #define ACPI_TABLE_UPGRADE_MAX_PHYS MEMBLOCK_ALLOC_ACCESSIBLE diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c index f01fab6..f7b2ea6 100644 --- a/arch/arm64/kernel/acpi_numa.c +++ b/arch/arm64/kernel/acpi_numa.c @@ -29,15 +29,24 @@ #include static int cpus_in_srat; +static int its_in_srat; struct __node_cpu_hwid { u32 node_id; /* logical node containing this CPU */ u64 cpu_hwid; /* MPIDR for this CPU */ }; +struct __node_its_id { + u32 node_id; /* numa node id */ + u32 its_id ; /* GIC ITS ID */ +}; + static struct __node_cpu_hwid early_node_cpu_hwid[NR_CPUS] = { [0 ... NR_CPUS - 1] = {NUMA_NO_NODE, PHYS_CPUID_INVALID} }; +static struct __node_its_id early_node_its_id[MAX_NUMNODES] = { +[0 ... MAX_NUMNODES - 1] = {NUMA_NO_NODE, UINT_MAX} }; + int acpi_numa_get_nid(unsigned int cpu, u64 hwid) { int i; @@ -50,6 +59,18 @@ int acpi_numa_get_nid(unsigned int cpu, u64 hwid) return NUMA_NO_NODE; } +int acpi_numa_get_its_nid(u32 its_id) +{ + int i; + + for (i = 0; i < its_in_srat; i++) { + if (its_id == early_node_its_id[i].its_id) + return early_node_its_id[i].node_id; + } + + return NUMA_NO_NODE; +} + /* Callback for Proximity Domain -> ACPI processor UID mapping */ void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) { @@ -100,6 +121,44 @@ void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) pxm, mpidr, node); } +/* Callback for ITS ACPI Proximity Domain mapping */ +void __init acpi_numa_its_affinity_init(struct acpi_srat_its_affinity *pa) +{ + int pxm, node; + + if (srat_disabled()) + return; + + if (pa->header.length < sizeof(struct acpi_srat_its_affinity)) { + pr_err("SRAT: Invalid SRAT header length: %d\n", + pa->header.length); + bad_srat(); + return; + } + + if (its_in_srat >= MAX_NUMNODES) { + pr_warn_once("SRAT: its count exceeding max count[%d]\n", + MAX_NUMNODES); + return; + } + + pxm = pa->proximity_domain; + node = acpi_map_pxm_to_node(pxm); + + if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) { + pr_err("SRAT: Too many proximity domains %d\n", pxm); + bad_srat(); + return; + } + + early_node_its_id[its_in_srat].node_id = node; + early_node_its_id[its_in_srat].its_id = its_in_srat; + node_set(node, numa_nodes_parsed); + pr_info("SRAT: PXM %d -> ITS %d -> Node %d\n", + pxm, its_in_srat, node); + its_in_srat++; +} + int __init arm64_acpi_numa_init(void) { int ret; diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index edb0c79..9c04dba 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c @@ -182,6 +182,16 @@ int acpi_map_pxm_to_online_node(int pxm) } break; + case ACPI_SRAT_TYPE_GIC_ITS_AFFINITY: + { + struct acpi_srat_its_affinity *p = + (struct acpi_srat_its_affinity *)header; + pr_debug("SRAT ITS [0x%04x]) in proximity domain %d\n", + p->its_id, + p->proximity_domain); + } + break; + default: pr_warn("Found unsupported SRAT entry (type = 0x%x)\n", header->type); @@ -390,6 +400,24 @@ static int __init acpi_parse_slit(struct acpi_table_header *table) return 0; } +static int __init +acpi_parse_its_affinity(struct acpi_subtable_header *header, + const unsigned long end) +{ + struct acpi_srat_its_affinity *its_affinity; + + its_affinity = (struct acpi_srat_its_affinity *)header; + if (!its_affinity) + return -EINVAL; + + acpi_table_print_srat_entry(header); + + /* let architecture-dependent part to do it */ + acpi_numa_its_affinity_init(its_affinity); + + return 0; +} + static int __initdata parsed_numa_memblks; static int __init @@ -445,7 +473,7 @@ int __init acpi_numa_init(void) /* SRAT: Static Resource Affinity Table */ if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) { - struct acpi_subtable_proc srat_proc[3]; + struct acpi_subtable_proc srat_proc[4]; memset(srat_proc, 0, sizeof(srat_proc)); srat_proc[0].id = ACPI_SRAT_TYPE_CPU_AFFINITY; @@ -454,6 +482,8 @@ int __init acpi_numa_init(void) srat_proc[1].handler = acpi_parse_x2apic_affinity; srat_proc[2].id = ACPI_SRAT_TYPE_GICC_AFFINITY; srat_proc[2].handler = acpi_parse_gicc_affinity; + srat_proc[3].id = ACPI_SRAT_TYPE_GIC_ITS_AFFINITY; + srat_proc[3].handler = acpi_parse_its_affinity; acpi_table_parse_entries_array(ACPI_SIG_SRAT, sizeof(struct acpi_table_srat), diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 45ea1933..84936da 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1861,7 +1861,8 @@ static int __init gic_acpi_parse_madt_its(struct acpi_subtable_header *header, goto dom_err; } - err = its_probe_one(&res, dom_handle, NUMA_NO_NODE); + err = its_probe_one(&res, dom_handle, + acpi_numa_get_its_nid(its_entry->translation_id)); if (!err) return 0; diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 137e4a3..e5e8ae3 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -260,9 +260,12 @@ int acpi_table_parse_madt(enum acpi_madt_type id, #ifdef CONFIG_ARM64 void acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa); +void acpi_numa_its_affinity_init(struct acpi_srat_its_affinity *pa); #else static inline void acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) { } +static inline void +acpi_numa_its_affinity_init(struct acpi_srat_its_affinity *pa) { } #endif int acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);