From patchwork Tue May 24 22:35:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 9134383 X-Patchwork-Delegate: rjw@sisk.pl 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 85CB9607D8 for ; Tue, 24 May 2016 22:39:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B7A8281E3 for ; Tue, 24 May 2016 22:39:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 617A12822B; Tue, 24 May 2016 22:39:37 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F11D0281F9 for ; Tue, 24 May 2016 22:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754619AbcEXWjA (ORCPT ); Tue, 24 May 2016 18:39:00 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35526 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751757AbcEXWgJ (ORCPT ); Tue, 24 May 2016 18:36:09 -0400 Received: by mail-pf0-f193.google.com with SMTP id f144so3439325pfa.2; Tue, 24 May 2016 15:36:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zM2MBzQgSa8qdts+oNIJV3pKdg58h2zLMU72xECFxZo=; b=Ae26wRu21AElhJvn95RDbAvFXrJ4gZkPj/byNel4LPNI9PBVqLI2v70zm1j47hJglk hUfXqSRUetezRIll02wnUhOGVo0FFZFx/1dT5xYX5+lKngNMldHLvS5HHc/sZm63tDuQ B7MJYqKMbHKJZFHkq4QSjJmZ6UfAqQk7kq5I5Yejtso2+7VfNffoSSgvucwIMw2JnRAD j4CYJPus9dPYhhM3/k4LwiDjBM/WcToUV0IvzDOswD1YU5m4jCs+Lhi2oavlOQCjS3OX 6K7/9n6OFZ+pxvrYLIphf5/4GZM8SAttbZmDQ56AoAIy+TzpC9Sc/CBA4INYuqqUsXGC HcWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zM2MBzQgSa8qdts+oNIJV3pKdg58h2zLMU72xECFxZo=; b=JZYrVxtBTtdg0b1Dxka8fQQ49fgYXtva1Nv86aiztYfZGs/zkQ8GssjuWgEtF+i12K b+LOp8c7gPbA7JvFgrGMFdoxwPKp9RtuPrm1Tn7wbLpCjeYTOFRa2xijvU2z+r8zGPiW Dm13cjb4ZWBf7Iq9Mghg8g4fan3qWwwQtqnpVdGB4zjQrC58ubYBESV5i+/yAVbc3DG3 UI50C5HeDoy6t6kgctv4Uq8Pe5GPneWKYZeI0x4sEVCwWxpnWyG380geQJ1BtG5fmNbF IJ0FDL2kWNicc/qwB1XnUa/0wdPHO8f0vNBeUy+lMyF0VjCn9BC1XSuegYhSvTgIdgi3 vm8w== X-Gm-Message-State: ALyK8tI08l0SjhFUo9fh5a7tDkeYFc/464SRis+b4ILwebBOF86fACJ3wxTjVYck1SmtRw== X-Received: by 10.98.74.10 with SMTP id x10mr860109pfa.3.1464129368690; Tue, 24 May 2016 15:36:08 -0700 (PDT) Received: from dl.caveonetworks.com ([50.233.148.158]) by smtp.gmail.com with ESMTPSA id q129sm56717382pfb.16.2016.05.24.15.36.00 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 24 May 2016 15:36:02 -0700 (PDT) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id u4OMZxWW019055; Tue, 24 May 2016 15:35:59 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id u4OMZxdp019054; Tue, 24 May 2016 15:35:59 -0700 From: David Daney To: Will Deacon , linux-arm-kernel@lists.infradead.org, Mark Rutland , Catalin Marinas , Tony Luck , Fenghua Yu , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, "Rafael J. Wysocki" , Len Brown , Rob Herring , Frank Rowand , Grant Likely , Robert Moore , Lv Zheng , Hanjun Guo , Marc Zyngier , linux-ia64@vger.kernel.org, linux-acpi@vger.kernel.org, devel@acpica.org Cc: linux-kernel@vger.kernel.org, Robert Richter , David Daney Subject: [PATCH v7 05/15] acpi, numa: move acpi_numa_slit_init() to drivers/acpi/numa.c Date: Tue, 24 May 2016 15:35:35 -0700 Message-Id: <1464129345-18985-6-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1464129345-18985-1-git-send-email-ddaney.cavm@gmail.com> References: <1464129345-18985-1-git-send-email-ddaney.cavm@gmail.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hanjun Guo Identical implementations of acpi_numa_slit_init() are used by both x86 and follow-on arm64 support. Move it to drivers/acpi/numa.c, and guard with CONFIG_X86 || CONFIG_ARM64 because ia64 has its own architecture specific implementation. No code change. Signed-off-by: Hanjun Guo Signed-off-by: Robert Richter Signed-off-by: David Daney --- arch/x86/mm/srat.c | 27 --------------------------- drivers/acpi/numa.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c index 90b6ed9..f242a11 100644 --- a/arch/x86/mm/srat.c +++ b/arch/x86/mm/srat.c @@ -42,33 +42,6 @@ static __init inline int srat_disabled(void) return acpi_numa < 0; } -/* - * Callback for SLIT parsing. pxm_to_node() returns NUMA_NO_NODE for - * I/O localities since SRAT does not list them. I/O localities are - * not supported at this point. - */ -void __init acpi_numa_slit_init(struct acpi_table_slit *slit) -{ - int i, j; - - for (i = 0; i < slit->locality_count; i++) { - const int from_node = pxm_to_node(i); - - if (from_node == NUMA_NO_NODE) - continue; - - for (j = 0; j < slit->locality_count; j++) { - const int to_node = pxm_to_node(j); - - if (to_node == NUMA_NO_NODE) - continue; - - numa_set_distance(from_node, to_node, - slit->entry[slit->locality_count * i + j]); - } - } -} - /* Callback for Proximity Domain -> x2APIC mapping */ void __init acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index fb2c0d6..7e0649d 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c @@ -197,6 +197,35 @@ static int __init slit_valid(struct acpi_table_slit *slit) return 1; } +#if defined(CONFIG_X86) || defined(CONFIG_ARM64) +/* + * Callback for SLIT parsing. pxm_to_node() returns NUMA_NO_NODE for + * I/O localities since SRAT does not list them. I/O localities are + * not supported at this point. + */ +void __init acpi_numa_slit_init(struct acpi_table_slit *slit) +{ + int i, j; + + for (i = 0; i < slit->locality_count; i++) { + const int from_node = pxm_to_node(i); + + if (from_node == NUMA_NO_NODE) + continue; + + for (j = 0; j < slit->locality_count; j++) { + const int to_node = pxm_to_node(j); + + if (to_node == NUMA_NO_NODE) + continue; + + numa_set_distance(from_node, to_node, + slit->entry[slit->locality_count * i + j]); + } + } +} +#endif /* defined(CONFIG_X86) || defined (CONFIG_ARM64) */ + static int __init acpi_parse_slit(struct acpi_table_header *table) { struct acpi_table_slit *slit = (struct acpi_table_slit *)table;