From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEAA9C433DF for ; Tue, 13 Oct 2020 23:49:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9140422201 for ; Tue, 13 Oct 2020 23:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602632946; bh=nx3lfTYJUtpRqVLwOqY3FO6xklQ1b7eyznbALbP++jg=; h=Date:From:To:Subject:In-Reply-To:Reply-To:List-ID:From; b=ZmJGZafKsi2PZJbhh7RKrSgqmLsJqbB0+iEjBVshBdk1OEJQqIakL6uTjKq4OAAkE 6lM97Ghk+HznDcr4iGkbrN/WcPOwsZ13ZBVi60qrVSxXK328KyEASjQsFJcwW2M6WR JcKKXuSrmA+ORr4GLPx1bRU9xn4TD2BUTkxWxqTQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727949AbgJMXtG (ORCPT ); Tue, 13 Oct 2020 19:49:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:60744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727154AbgJMXtG (ORCPT ); Tue, 13 Oct 2020 19:49:06 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 43E5221D81; Tue, 13 Oct 2020 23:49:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602632945; bh=nx3lfTYJUtpRqVLwOqY3FO6xklQ1b7eyznbALbP++jg=; h=Date:From:To:Subject:In-Reply-To:From; b=AnVRWYW6hX3Wh330l1db1oSC8lb4ZD/wv9vGbvws0QI6npnUTo/EJQjN+F3xwE6g5 OcePKexY1+xRkpoXC/7zkPA4g8WzjPUGvmmQUbaq4kZu4iZQIVQ8ZlEMb9jiPq9bSB 1Fvpo2SbeAnbA/fyWo5T3Kq47YNQezF8zXIe3QJA= Date: Tue, 13 Oct 2020 16:49:02 -0700 From: Andrew Morton To: airlied@linux.ie, akpm@linux-foundation.org, ard.biesheuvel@linaro.org, ardb@kernel.org, benh@kernel.crashing.org, bhelgaas@google.com, boris.ostrovsky@oracle.com, bp@alien8.de, Brice.Goglin@inria.fr, bskeggs@redhat.com, catalin.marinas@arm.com, dan.j.williams@intel.com, daniel@ffwll.ch, dave.hansen@linux.intel.com, dave.jiang@intel.com, david@redhat.com, gregkh@linuxfoundation.org, hpa@zytor.com, hulkci@huawei.com, ira.weiny@intel.com, jgg@mellanox.com, jglisse@redhat.com, jgross@suse.com, jmoyer@redhat.com, joao.m.martins@oracle.com, Jonathan.Cameron@huawei.com, justin.he@arm.com, linux-mm@kvack.org, lkp@intel.com, luto@kernel.org, mingo@redhat.com, mm-commits@vger.kernel.org, mpe@ellerman.id.au, pasha.tatashin@soleen.com, paulus@ozlabs.org, peterz@infradead.org, rafael.j.wysocki@intel.com, rdunlap@infradead.org, richard.weiyang@linux.alibaba.com, rppt@linux.ibm.com, sstabellini@kernel.org, tglx@linutronix.de, thomas.lendacky@amd.com, torvalds@linux-foundation.org, vgoyal@redhat.com, vishal.l.verma@intel.com, will@kernel.org, yanaijie@huawei.com Subject: [patch 027/181] x86/numa: add 'nohmat' option Message-ID: <20201013234902.xbhrv_jOp%akpm@linux-foundation.org> In-Reply-To: <20201013164658.3bfd96cc224d8923e66a9f4e@linux-foundation.org> User-Agent: s-nail v14.8.16 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org =46rom: Dan Williams Subject: x86/numa: add 'nohmat' option Disable parsing of the HMAT for debug, to workaround broken platform instances, or cases where it is otherwise not wanted. [rdunlap@infradead.org: fix build when CONFIG_ACPI is not set] Link: https://lkml.kernel.org/r/70e5ee34-9809-a997-7b49-499e4be61307@infr= adead.org Link: https://lkml.kernel.org/r/159643095540.4062302.732962081968036212.stg= it@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Signed-off-by: Randy Dunlap Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Ard Biesheuvel Cc: Ard Biesheuvel Cc: Benjamin Herrenschmidt Cc: Ben Skeggs Cc: Brice Goglin Cc: Catalin Marinas Cc: Daniel Vetter Cc: Dave Jiang Cc: David Airlie Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: Ira Weiny Cc: Jason Gunthorpe Cc: Jeff Moyer Cc: Jia He Cc: Joao Martins Cc: Jonathan Cameron Cc: Michael Ellerman Cc: Mike Rapoport Cc: Paul Mackerras Cc: Pavel Tatashin Cc: "Rafael J. Wysocki" Cc: Tom Lendacky Cc: Vishal Verma Cc: Wei Yang Cc: Will Deacon Cc: Bjorn Helgaas Cc: Boris Ostrovsky Cc: Hulk Robot Cc: Jason Yan Cc: "J=C3=A9r=C3=B4me Glisse" Cc: Juergen Gross Cc: kernel test robot Cc: Randy Dunlap Cc: Stefano Stabellini Cc: Vivek Goyal Signed-off-by: Andrew Morton --- Documentation/x86/x86_64/boot-options.rst | 4 ++++ arch/x86/mm/numa.c | 2 ++ drivers/acpi/numa/hmat.c | 8 +++++++- include/acpi/acpi_numa.h | 8 ++++++++ include/linux/acpi.h | 2 ++ 5 files changed, 23 insertions(+), 1 deletion(-) --- a/arch/x86/mm/numa.c~x86-numa-add-nohmat-option +++ a/arch/x86/mm/numa.c @@ -41,6 +41,8 @@ static __init int numa_setup(char *opt) return numa_emu_cmdline(opt + 5); if (!strncmp(opt, "noacpi", 6)) disable_srat(); + if (!strncmp(opt, "nohmat", 6)) + disable_hmat(); return 0; } early_param("numa", numa_setup); --- a/Documentation/x86/x86_64/boot-options.rst~x86-numa-add-nohmat-option +++ a/Documentation/x86/x86_64/boot-options.rst @@ -173,6 +173,10 @@ NUMA numa=3Dnoacpi Don't parse the SRAT table for NUMA setup =20 + numa=3Dnohmat + Don't parse the HMAT table for NUMA setup, or soft-reserved memory + partitioning. + numa=3Dfake=3D[MG] If given as a memory unit, fills all system RAM with nodes of size interleaved over physical nodes. --- a/drivers/acpi/numa/hmat.c~x86-numa-add-nohmat-option +++ a/drivers/acpi/numa/hmat.c @@ -26,6 +26,12 @@ #include =20 static u8 hmat_revision; +static int hmat_disable __initdata; + +void __init disable_hmat(void) +{ + hmat_disable =3D 1; +} =20 static LIST_HEAD(targets); static LIST_HEAD(initiators); @@ -814,7 +820,7 @@ static __init int hmat_init(void) enum acpi_hmat_type i; acpi_status status; =20 - if (srat_disabled()) + if (srat_disabled() || hmat_disable) return 0; =20 status =3D acpi_get_table(ACPI_SIG_SRAT, 0, &tbl); --- a/include/acpi/acpi_numa.h~x86-numa-add-nohmat-option +++ a/include/acpi/acpi_numa.h @@ -27,4 +27,12 @@ static inline void disable_srat(void) { } #endif /* CONFIG_ACPI_NUMA */ + +#ifdef CONFIG_ACPI_HMAT +extern void disable_hmat(void); +#else /* CONFIG_ACPI_HMAT */ +static inline void disable_hmat(void) +{ +} +#endif /* CONFIG_ACPI_HMAT */ #endif /* __ACP_NUMA_H */ --- a/include/linux/acpi.h~x86-numa-add-nohmat-option +++ a/include/linux/acpi.h @@ -709,6 +709,8 @@ static inline u64 acpi_arch_get_root_poi #define ACPI_HANDLE_FWNODE(fwnode) (NULL) #define ACPI_DEVICE_CLASS(_cls, _msk) .cls =3D (0), .cls_msk =3D (0), =20 +#include + struct fwnode_handle; =20 static inline bool acpi_dev_found(const char *hid) _