From patchwork Wed Jan 31 02:31:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haibo Xu X-Patchwork-Id: 194446 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1627712dyb; Tue, 30 Jan 2024 18:25:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEK9PMgV5cP2SWRcEsL9P51R+65PTEfw+B/FIKM2qWGnCjms5XFb9mE+exYbGXXR7ehEcFS X-Received: by 2002:ad4:5d6f:0:b0:684:e4e3:3a49 with SMTP id fn15-20020ad45d6f000000b00684e4e33a49mr387652qvb.48.1706667902084; Tue, 30 Jan 2024 18:25:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706667902; cv=pass; d=google.com; s=arc-20160816; b=Xho8INiO7lORdvVhpMMsavcYJcbezaeHDaEEje1QOUK33IkcCECdbMa37NhRJDpidg t98PR9D92ZwA4AdffT89AkIcCiqMSmG3hptv9yubxz79mlovVY0UppKJXqaYTgjZlO1v Y+nDibdHa7ZVnfcWztMm1nrbV1mrzdqBAZ4apBSKgQM5hvIDanind+lazMiA7rNsKNHo rK9mHVOfmF65Ls0N1KPJU+JbP1QmdkwKOQTSbbRh7MRZbh5lNPeFf2WPQcXzPc5fulwo nzHiQqITbfzFouuZv/LvmFRkKy4Q2BmuDsn8a1MuEpR3OJdcQPjLUUlamCSFWdpya+Gh 0v1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=GxMPdz2fWmQz0LEfzZItEmMCJkLB5Ba4ZYrhl8UAxh4=; fh=oRVb5a/N8pBiQWwrjppCgx3NaMeOAkWlyoQ5xXHdlZg=; b=Oj7eD4YUh7U6EHDUTIKIJO0RHcoexsawaQ+oYwXDUiWicSeJ3E1gCYvat5ePnsj8MX WV0bzQlcQi2fT9J1HFi6r08T/FPzXWCRP3EniWNWBieARbZrdziH2dOnvcIQDdILXs2d Knq/0ulAn60N1wUuaVLAF+wNBc8b1AARGl+j8eQ1dnbKLI5ENthm/5Ydyv+VagMz87g4 NIanVuQsaOF/61BkYdYZYL36GwxyIPzv7eX8P462IWI+dGf976eaNNkkPZj9hRaDuIJd iJY2GyBW5X0SB1LNe4M+tP2uqvnm+LU/oVWkdJ7ZmLLk9NGkw1R3lmM3z+7AypvWUn9t 8b4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Bky9jtv1; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-45663-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45663-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCXxDjBQ2A5TXcORssdeVCuDHaQoYSHpGWZLZ6o1TO5bAidkYDDyEfcSZ1eAYWP8mnKxtY/rfsdEe48nabm4SymQSDBPLQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id iv14-20020ad45cee000000b00681993f0261si11446720qvb.391.2024.01.30.18.25.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 18:25:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45663-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Bky9jtv1; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-45663-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45663-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id DC25F1C27D9C for ; Wed, 31 Jan 2024 02:25:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C013D125B9; Wed, 31 Jan 2024 02:19:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Bky9jtv1" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 6599CFBE7; Wed, 31 Jan 2024 02:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706667549; cv=none; b=hwjS6dHOXHwz2ntDDT9TKsFj6Dy99mqzd3uT+QFW/LO54jRONuYyLVMuYAnmj4W4eQgVXpE0mPYdzVbdc50fy6T4So7hhsLd4Kol5tqIZhYg1PAxbW4vxb2yfxLvt0zWPNVaJ6JQLEdfUnMwgkPDeLuAw3EWc/TzbfP67EIiBPw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706667549; c=relaxed/simple; bh=EazMTTYX9oeR/uhQC7ENeexop7S60anC75kEcPjLk3Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QRlHFImZmwG4Mz3li7x4FxYVz0PLReapV15ZazSPnIaKRoDn33httJ7f9rwiVRYT8JdR1Prr4WBqou00qc2UVj8oW7IKXt0V7IbjzXs2jM6gNwmLgUHmSd65ZeM2qDRc60Q+bXAkv0ena5H3kxbThI1ckHle5SV/V620uBfxpG4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Bky9jtv1; arc=none smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706667547; x=1738203547; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EazMTTYX9oeR/uhQC7ENeexop7S60anC75kEcPjLk3Y=; b=Bky9jtv1AmGnEyLuST7iUPm66tWCHVgLTmBmJ/2GNDFZNRdmDWmk4Mz7 Tm0tF6d4Ud8gS0k+mjha5BeRWmMPLMi4RsvgN7arXDcia0PfUo4dAvFq8 e9uNu/jUlFYVRDsyMIOz0Uh8hAJ0gOxpj9OcJbFHQOsMVEhMGFDTa+bm8 CjWU/82fsxz80z/VvOvlJpcSf9zcQvCJoTLgE4qhogq8jGGyQnbyl+Rx5 wBR959dZwA5DgbM2cZDW+xSf5zGn3fa98HthE+k/MIk6kp/+VPSa4xWD7 nWIFSZPtvJCxX0jmTwSQOIMksi/0NHwhjJxx69/k2AtVqjl3FBQafxuwZ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="24939137" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="24939137" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 18:19:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="907714731" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="907714731" Received: from haibo-optiplex-7090.sh.intel.com ([10.239.159.132]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 18:18:59 -0800 From: Haibo Xu To: Cc: xiaobo55x@gmail.com, ajones@ventanamicro.com, sunilvl@ventanamicro.com, Haibo Xu , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J. Wysocki" , Len Brown , Robert Moore , Conor Dooley , Guo Ren , Anup Patel , Alexandre Ghiti , Greentime Hu , Baoquan He , Jisheng Zhang , Sami Tolvanen , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Greg Kroah-Hartman , Arnd Bergmann , Chen Jiahao , James Morse , Evan Green , Samuel Holland , Ard Biesheuvel , Tony Luck , Yuntao Wang , Alison Schofield , Dave Hansen , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [PATCH 2/4] ACPI: NUMA: Add handler for SRAT RINTC affinity structure Date: Wed, 31 Jan 2024 10:31:59 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789571002222139152 X-GMAIL-MSGID: 1789571002222139152 Add RINTC affinity structure handler during parsing SRAT table. The ARCH specific implementation will be added in next patch. Signed-off-by: Haibo Xu --- drivers/acpi/numa/srat.c | 32 +++++++++++++++++++++++++++++++- include/linux/acpi.h | 3 +++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 0214518fc582..503abcf6125d 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -165,6 +165,19 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header) } } break; + + case ACPI_SRAT_TYPE_RINTC_AFFINITY: + { + struct acpi_srat_rintc_affinity *p = + (struct acpi_srat_rintc_affinity *)header; + pr_debug("SRAT Processor (acpi id[0x%04x]) in proximity domain %d %s\n", + p->acpi_processor_uid, + p->proximity_domain, + (p->flags & ACPI_SRAT_RINTC_ENABLED) ? + "enabled" : "disabled"); + } + break; + default: pr_warn("Found unsupported SRAT entry (type = 0x%x)\n", header->type); @@ -448,6 +461,21 @@ acpi_parse_gi_affinity(union acpi_subtable_headers *header, } #endif /* defined(CONFIG_X86) || defined (CONFIG_ARM64) */ +static int __init +acpi_parse_rintc_affinity(union acpi_subtable_headers *header, + const unsigned long end) +{ + struct acpi_srat_rintc_affinity *rintc_affinity; + + rintc_affinity = (struct acpi_srat_rintc_affinity *)header; + acpi_table_print_srat_entry(&header->common); + + /* let architecture-dependent part to do it */ + acpi_numa_rintc_affinity_init(rintc_affinity); + + return 0; +} + static int __initdata parsed_numa_memblks; static int __init @@ -501,7 +529,7 @@ int __init acpi_numa_init(void) /* SRAT: System Resource Affinity Table */ if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) { - struct acpi_subtable_proc srat_proc[4]; + struct acpi_subtable_proc srat_proc[5]; memset(srat_proc, 0, sizeof(srat_proc)); srat_proc[0].id = ACPI_SRAT_TYPE_CPU_AFFINITY; @@ -512,6 +540,8 @@ int __init acpi_numa_init(void) srat_proc[2].handler = acpi_parse_gicc_affinity; srat_proc[3].id = ACPI_SRAT_TYPE_GENERIC_AFFINITY; srat_proc[3].handler = acpi_parse_gi_affinity; + srat_proc[4].id = ACPI_SRAT_TYPE_RINTC_AFFINITY; + srat_proc[4].handler = acpi_parse_rintc_affinity; acpi_table_parse_entries_array(ACPI_SIG_SRAT, sizeof(struct acpi_table_srat), diff --git a/include/linux/acpi.h b/include/linux/acpi.h index b7165e52b3c6..a65273db55c6 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -269,6 +269,9 @@ acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) { } int acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma); +static inline void +acpi_numa_rintc_affinity_init(struct acpi_srat_rintc_affinity *pa) { } + #ifndef PHYS_CPUID_INVALID typedef u32 phys_cpuid_t; #define PHYS_CPUID_INVALID (phys_cpuid_t)(-1)