Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp394026ybh; Sun, 12 Jul 2020 09:43:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFB9VxfcSng/CWqcjMQfAunNYe4rEXWUjF0ZrkJasXuPUHk93D+FhVViNp9eusTEN/PCQd X-Received: by 2002:a17:907:20b0:: with SMTP id pw16mr15969104ejb.551.1594572194319; Sun, 12 Jul 2020 09:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594572194; cv=none; d=google.com; s=arc-20160816; b=REkjMsqFx7Wo5Tvj4Jchl5CYL+GTYYG0twyXQk95hcA/0XeQiDKB1UUKx3b8IqHi+g b/JNm6z+5/o+n1nkxO9Mdx2GSZWatLvuVGg1d1bEoeWv2q/YtvfFAJSDoXfPJvQ3BARi m/Jplv2Js72NseYWyc/PSFu3AKBVra+7BH2x3V+gpLTb7+bRr2nXO6hWRpGZM+ItYQuc D2PsLbMfJI/MXs8f27F39FudeCLXQAYnpogRaXPnqb6K9iKgvQ69ucBK6I3bUFlqXhV1 SOF2DQXSrOGH0/AifP+QNd37XII50w29MNUf0hNXJhyaGUcd4JebfvAho6cY5qJfeUwZ 8aug== 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=L8LtlVcEqZ+syF67eEIRo7NDAf2iJO5pUeOl1sUe52E=; b=a0nl1iw/XQktKtauIHsxiwrbt8kDx1Uu2GZPwo8e7nL1YeW/Awj61EtC95WDa7x51a Pe6SLpgPi1gE8YQcNCuobMAGL6wGyig/0XSAiVuSAcG3ksfHazdktOYFkvSM/lL3oRPC 76VeXff+vk8+JdSoxkXRq0Znx+C3Xii5gCG2rOf+Z52+AwapSRPOnExkRB14gl2EJM+q OPdIJs2lR/vXDnsMMWGkDBy/FBBvAD11yOP1n9+0obWEN6YAOBJFwi/19Q2RRBcuKyBu DdrLkjwexkF/e+z6uUSrWVDgeRjpm0S3AQ22QCz8S6fh5sU8ClVI5fWtEJ5IdIsbp2k4 X+kw== 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 i13si7443081ejp.659.2020.07.12.09.42.51; Sun, 12 Jul 2020 09:43:14 -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 S1729128AbgGLQme (ORCPT + 99 others); Sun, 12 Jul 2020 12:42:34 -0400 Received: from mga07.intel.com ([134.134.136.100]:13126 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728854AbgGLQmd (ORCPT ); Sun, 12 Jul 2020 12:42:33 -0400 IronPort-SDR: FF6XeiqkPdqfMQFxMm//36mLus+s6GfrMHtZMrt5Ev6xnTi9XvB5IvXhWDD48bmmsRKF9A9hnB HRN17hnPIBWw== X-IronPort-AV: E=McAfee;i="6000,8403,9680"; a="213360336" X-IronPort-AV: E=Sophos;i="5.75,344,1589266800"; d="scan'208";a="213360336" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2020 09:42:32 -0700 IronPort-SDR: vuN4F6cf8GZ85GNhIg635lh3ZyhnX8QwjZttALN46Nm39+rtKtw/P8royU9cXz1nW98QFcqt8B MCSwjjmZGIiA== X-IronPort-AV: E=Sophos;i="5.75,344,1589266800"; d="scan'208";a="359832829" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2020 09:42:32 -0700 Subject: [PATCH v2 02/22] x86/numa: Add 'nohmat' option From: Dan Williams To: linux-nvdimm@lists.01.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, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, hch@lst.de, joao.m.martins@oracle.com Date: Sun, 12 Jul 2020 09:26:16 -0700 Message-ID: <159457117650.754248.15655699240005524226.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <159457116473.754248.7879464730875147365.stgit@dwillia2-desk3.amr.corp.intel.com> References: <159457116473.754248.7879464730875147365.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 --- arch/x86/mm/numa.c | 2 ++ drivers/acpi/numa/hmat.c | 8 +++++++- include/acpi/acpi_numa.h | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index ee24646dc44e..44fdf06d497e 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 */