Skip to content

Commit 3b0d310

Browse files
djbwtorvalds
authored andcommitted
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. [[email protected]: fix build when CONFIG_ACPI is not set] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]> Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Ben Skeggs <[email protected]> Cc: Brice Goglin <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Dave Jiang <[email protected]> Cc: David Airlie <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Ira Weiny <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: Jeff Moyer <[email protected]> Cc: Jia He <[email protected]> Cc: Joao Martins <[email protected]> Cc: Jonathan Cameron <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Pavel Tatashin <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Tom Lendacky <[email protected]> Cc: Vishal Verma <[email protected]> Cc: Wei Yang <[email protected]> Cc: Will Deacon <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Boris Ostrovsky <[email protected]> Cc: Hulk Robot <[email protected]> Cc: Jason Yan <[email protected]> Cc: "Jérôme Glisse" <[email protected]> Cc: Juergen Gross <[email protected]> Cc: kernel test robot <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Stefano Stabellini <[email protected]> Cc: Vivek Goyal <[email protected]> Link: https://lkml.kernel.org/r/159643095540.4062302.732962081968036212.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Linus Torvalds <[email protected]>
1 parent 2dd57d3 commit 3b0d310

File tree

5 files changed

+23
-1
lines changed

5 files changed

+23
-1
lines changed

Documentation/x86/x86_64/boot-options.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ NUMA
173173
numa=noacpi
174174
Don't parse the SRAT table for NUMA setup
175175

176+
numa=nohmat
177+
Don't parse the HMAT table for NUMA setup, or soft-reserved memory
178+
partitioning.
179+
176180
numa=fake=<size>[MG]
177181
If given as a memory unit, fills all system RAM with nodes of
178182
size interleaved over physical nodes.

arch/x86/mm/numa.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ static __init int numa_setup(char *opt)
4141
return numa_emu_cmdline(opt + 5);
4242
if (!strncmp(opt, "noacpi", 6))
4343
disable_srat();
44+
if (!strncmp(opt, "nohmat", 6))
45+
disable_hmat();
4446
return 0;
4547
}
4648
early_param("numa", numa_setup);

drivers/acpi/numa/hmat.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
#include <linux/sysfs.h>
2727

2828
static u8 hmat_revision;
29+
static int hmat_disable __initdata;
30+
31+
void __init disable_hmat(void)
32+
{
33+
hmat_disable = 1;
34+
}
2935

3036
static LIST_HEAD(targets);
3137
static LIST_HEAD(initiators);
@@ -814,7 +820,7 @@ static __init int hmat_init(void)
814820
enum acpi_hmat_type i;
815821
acpi_status status;
816822

817-
if (srat_disabled())
823+
if (srat_disabled() || hmat_disable)
818824
return 0;
819825

820826
status = acpi_get_table(ACPI_SIG_SRAT, 0, &tbl);

include/acpi/acpi_numa.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,12 @@ static inline void disable_srat(void)
2727
{
2828
}
2929
#endif /* CONFIG_ACPI_NUMA */
30+
31+
#ifdef CONFIG_ACPI_HMAT
32+
extern void disable_hmat(void);
33+
#else /* CONFIG_ACPI_HMAT */
34+
static inline void disable_hmat(void)
35+
{
36+
}
37+
#endif /* CONFIG_ACPI_HMAT */
3038
#endif /* __ACP_NUMA_H */

include/linux/acpi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,8 @@ static inline u64 acpi_arch_get_root_pointer(void)
709709
#define ACPI_HANDLE_FWNODE(fwnode) (NULL)
710710
#define ACPI_DEVICE_CLASS(_cls, _msk) .cls = (0), .cls_msk = (0),
711711

712+
#include <acpi/acpi_numa.h>
713+
712714
struct fwnode_handle;
713715

714716
static inline bool acpi_dev_found(const char *hid)

0 commit comments

Comments
 (0)