Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1804557pxa; Sun, 2 Aug 2020 22:19:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzN0bLZtzMd0dIR6ra2/tISmxFzXXlBu+mu35r2769jkn9OGO47auCmgEwWIIL14cLLUN+M X-Received: by 2002:aa7:da0e:: with SMTP id r14mr14429035eds.236.1596431977696; Sun, 02 Aug 2020 22:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596431977; cv=none; d=google.com; s=arc-20160816; b=NdgKOnIM/6/235D0hwVpLhfGc4u+6SK3IkECdk/ruxEG0SKEj7C+h3wCROmCT2pKu3 g3Ji6b5D6S7zUEHeq4mPA1DzeSqBkJ1xVRyjUtiFPpZb52AQiDZDSj1em0Mk5nd0bpFe lPXpFA3TKMg7/s3N9mgddGmpdATeqhaUBNnxSvT/fsIoHLRsyz7bzTEaE5c9t3l9Fkob B/T7wszCoVmgXcFJs+ZbMRZ/Z8un7z+bmCfVMus/RCkNZzreM61UFu5+DEGAbLWAoycv M+IjiVOT3Pbvxx0sxW3mKS0bPmOtNM3ReauFG5v5LbfYj3eL8OYarzBYV3dmPOrsaRR2 b+lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:ironport-sdr:ironport-sdr; bh=K28sNJ3E+o7pnFBoj8fZ3tUNa0srECBc2xykSjtvrqs=; b=L4gxyJHHqQ3TMnD5zXWv41nWOpU0xEcMFdEmvexXxivJTBcUHr5NLsqVL4eQUj4F94 W1uDGpD3Cg1ENPaGk/bL/U4ch1gn+JR7ZdE/zZaezGkyacXPGh43LyhugJufLYVtEzph lhaCrZ7f/MMEk1smp+Zam/Zwrqh5NPbcMywHOAGJgwiFkSroqiOx69XqtLsE3cqyV5IL K9NsGed9H852GDSmh+BlBmOslliQTazbF+/G8wAQ1m5IZqmdeKOd1dPH1dz2/T79o/zl bQTuTGUZ0BjOuOjmZ8XvJKOJqyTTk4No4/eGR4PH9+k1eM/EBwi8cDWzkgKtDBbZ55Jt DHTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si8772686ejr.507.2020.08.02.22.19.16; Sun, 02 Aug 2020 22:19:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728022AbgHCFSz (ORCPT + 99 others); Mon, 3 Aug 2020 01:18:55 -0400 Received: from mga12.intel.com ([192.55.52.136]:47415 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725976AbgHCFSy (ORCPT ); Mon, 3 Aug 2020 01:18:54 -0400 IronPort-SDR: +MKXqn1yhsMhbEDf2VlBGzzqeb8HwcJAexmSQHIHIEqYXSyDKKAh8trx/9Fu+69PMkYoSjIKk5 gSa3S70+aX6w== X-IronPort-AV: E=McAfee;i="6000,8403,9701"; a="131611084" X-IronPort-AV: E=Sophos;i="5.75,429,1589266800"; d="scan'208";a="131611084" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2020 22:18:54 -0700 IronPort-SDR: 5/uk95UVnaMbZWyxeU7dTtYZhuFlj2wOtG7bigVO/6+5nFuEJNdAXlTZNRMdq1Y362/HNuckmO C6sN7TVeb4PQ== X-IronPort-AV: E=Sophos;i="5.75,429,1589266800"; d="scan'208";a="466357180" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2020 22:18:53 -0700 Subject: [PATCH v4 02/23] x86/numa: Add 'nohmat' option From: Dan Williams To: akpm@linux-foundation.org Cc: x86@kernel.org, "Rafael J. Wysocki" , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , vishal.l.verma@intel.com, ard.biesheuvel@linaro.org, vishal.l.verma@intel.com, linux-mm@kvack.org, linux-nvdimm@lists.01.org, joao.m.martins@oracle.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org Date: Sun, 02 Aug 2020 22:02:35 -0700 Message-ID: <159643095540.4062302.732962081968036212.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <159643094279.4062302.17779410714418721328.stgit@dwillia2-desk3.amr.corp.intel.com> References: <159643094279.4062302.17779410714418721328.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Disable parsing of the HMAT for debug, to workaround broken platform instances, or cases where it is otherwise not wanted. Cc: x86@kernel.org Cc: "Rafael J. Wysocki" Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Signed-off-by: Dan Williams --- 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 ++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Documentation/x86/x86_64/boot-options.rst b/Documentation/x86/x86_64/boot-options.rst index 2b98efb5ba7f..324cefff92e7 100644 --- a/Documentation/x86/x86_64/boot-options.rst +++ b/Documentation/x86/x86_64/boot-options.rst @@ -173,6 +173,10 @@ NUMA numa=noacpi Don't parse the SRAT table for NUMA setup + numa=nohmat + Don't parse the HMAT table for NUMA setup, or soft-reserved memory + partitioning. + numa=fake=[MG] If given as a memory unit, fills all system RAM with nodes of size interleaved over physical nodes. diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 87c52822cc44..f3805bbaa784 100644 --- a/arch/x86/mm/numa.c +++ b/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); diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c index 2c32cfb72370..a12e36a12618 100644 --- a/drivers/acpi/numa/hmat.c +++ b/drivers/acpi/numa/hmat.c @@ -26,6 +26,12 @@ #include static u8 hmat_revision; +static int hmat_disable __initdata; + +void __init disable_hmat(void) +{ + hmat_disable = 1; +} 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; - if (srat_disabled()) + if (srat_disabled() || hmat_disable) return 0; status = acpi_get_table(ACPI_SIG_SRAT, 0, &tbl); diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h index 8784183b2204..0e9302285f14 100644 --- a/include/acpi/acpi_numa.h +++ b/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 */