Commit 782b5971 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branch 'acpi-mm'

* acpi-mm:
  ACPI: HMAT: use %u instead of %d to print u32 values
  ACPI: NUMA: HMAT: fix a section mismatch
  ACPI: HMAT: don't mix pxm and nid when setting memory target processor_pxm
  ACPI: NUMA: HMAT: Register "soft reserved" memory as an "hmem" device
  ACPI: NUMA: HMAT: Register HMAT at device_initcall level
  device-dax: Add a driver for "hmem" devices
  dax: Fix alloc_dax_region() compile warning
  lib: Uplevel the pmem "region" ida to a global allocator
  x86/efi: Add efi_fake_mem support for EFI_MEMORY_SP
  arm/efi: EFI soft reservation to memblock
  x86/efi: EFI soft reservation to E820 enumeration
  efi: Common enable/disable infrastructure for EFI soft reservation
  x86/efi: Push EFI_MEMMAP check into leaf routines
  efi: Enumerate EFI_MEMORY_SP
  ACPI: NUMA: Establish a new drivers/acpi/numa/ directory
parents 995e2ef0 0f1839d0
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -1168,7 +1168,8 @@
			Format: {"off" | "on" | "skip[mbr]"}

	efi=		[EFI]
			Format: { "old_map", "nochunk", "noruntime", "debug" }
			Format: { "old_map", "nochunk", "noruntime", "debug",
				  "nosoftreserve" }
			old_map [X86-64]: switch to the old ioremap-based EFI
			runtime services mapping. 32-bit still uses this one by
			default.
@@ -1177,6 +1178,12 @@
			firmware implementations.
			noruntime : disable EFI runtime services support
			debug: enable misc debug output
			nosoftreserve: The EFI_MEMORY_SP (Specific Purpose)
			attribute may cause the kernel to reserve the
			memory range for a memory mapping driver to
			claim. Specify efi=nosoftreserve to disable this
			reservation and treat the memory by its base type
			(i.e. EFI_CONVENTIONAL_MEMORY / "System RAM").

	efi_no_storage_paranoia [EFI; X86]
			Using this parameter you can use more than 50% of
@@ -1189,15 +1196,21 @@
			updating original EFI memory map.
			Region of memory which aa attribute is added to is
			from ss to ss+nn.

			If efi_fake_mem=2G@4G:0x10000,2G@0x10a0000000:0x10000
			is specified, EFI_MEMORY_MORE_RELIABLE(0x10000)
			attribute is added to range 0x100000000-0x180000000 and
			0x10a0000000-0x1120000000.

			If efi_fake_mem=8G@9G:0x40000 is specified, the
			EFI_MEMORY_SP(0x40000) attribute is added to
			range 0x240000000-0x43fffffff.

			Using this parameter you can do debugging of EFI memmap
			related feature. For example, you can do debugging of
			related features. For example, you can do debugging of
			Address Range Mirroring feature even if your box
			doesn't support it.
			doesn't support it, or mark specific memory as
			"soft reserved".

	efivar_ssdt=	[EFI; X86] Name of an EFI variable that contains an SSDT
			that is to be dynamically loaded by Linux. If there are
+2 −0
Original line number Diff line number Diff line
@@ -1061,6 +1061,8 @@ int arch_add_memory(int nid, u64 start, u64 size,
	__create_pgd_mapping(swapper_pg_dir, start, __phys_to_virt(start),
			     size, PAGE_KERNEL, __pgd_pgtable_alloc, flags);

	memblock_clear_nomap(start, size);

	return __add_pages(nid, start >> PAGE_SHIFT, size >> PAGE_SHIFT,
			   restrictions);
}
+5 −1
Original line number Diff line number Diff line
@@ -554,6 +554,10 @@ setup_e820(struct boot_params *params, struct setup_data *e820ext, u32 e820ext_s
		case EFI_BOOT_SERVICES_CODE:
		case EFI_BOOT_SERVICES_DATA:
		case EFI_CONVENTIONAL_MEMORY:
			if (efi_soft_reserve_enabled() &&
			    (d->attribute & EFI_MEMORY_SP))
				e820_type = E820_TYPE_SOFT_RESERVED;
			else
				e820_type = E820_TYPE_RAM;
			break;

+39 −7
Original line number Diff line number Diff line
@@ -132,8 +132,14 @@ char *skip_spaces(const char *str)
#include "../../../../lib/ctype.c"
#include "../../../../lib/cmdline.c"

enum parse_mode {
	PARSE_MEMMAP,
	PARSE_EFI,
};

static int
parse_memmap(char *p, unsigned long long *start, unsigned long long *size)
parse_memmap(char *p, unsigned long long *start, unsigned long long *size,
		enum parse_mode mode)
{
	char *oldp;

@@ -156,8 +162,29 @@ parse_memmap(char *p, unsigned long long *start, unsigned long long *size)
		*start = memparse(p + 1, &p);
		return 0;
	case '@':
		/* memmap=nn@ss specifies usable region, should be skipped */
		if (mode == PARSE_MEMMAP) {
			/*
			 * memmap=nn@ss specifies usable region, should
			 * be skipped
			 */
			*size = 0;
		} else {
			unsigned long long flags;

			/*
			 * efi_fake_mem=nn@ss:attr the attr specifies
			 * flags that might imply a soft-reservation.
			 */
			*start = memparse(p + 1, &p);
			if (p && *p == ':') {
				p++;
				if (kstrtoull(p, 0, &flags) < 0)
					*size = 0;
				else if (flags & EFI_MEMORY_SP)
					return 0;
			}
			*size = 0;
		}
		/* Fall through */
	default:
		/*
@@ -172,7 +199,7 @@ parse_memmap(char *p, unsigned long long *start, unsigned long long *size)
	return -EINVAL;
}

static void mem_avoid_memmap(char *str)
static void mem_avoid_memmap(enum parse_mode mode, char *str)
{
	static int i;

@@ -187,7 +214,7 @@ static void mem_avoid_memmap(char *str)
		if (k)
			*k++ = 0;

		rc = parse_memmap(str, &start, &size);
		rc = parse_memmap(str, &start, &size, mode);
		if (rc < 0)
			break;
		str = k;
@@ -238,7 +265,6 @@ static void parse_gb_huge_pages(char *param, char *val)
	}
}


static void handle_mem_options(void)
{
	char *args = (char *)get_cmd_line_ptr();
@@ -271,7 +297,7 @@ static void handle_mem_options(void)
		}

		if (!strcmp(param, "memmap")) {
			mem_avoid_memmap(val);
			mem_avoid_memmap(PARSE_MEMMAP, val);
		} else if (strstr(param, "hugepages")) {
			parse_gb_huge_pages(param, val);
		} else if (!strcmp(param, "mem")) {
@@ -284,6 +310,8 @@ static void handle_mem_options(void)
				goto out;

			mem_limit = mem_size;
		} else if (!strcmp(param, "efi_fake_mem")) {
			mem_avoid_memmap(PARSE_EFI, val);
		}
	}

@@ -760,6 +788,10 @@ process_efi_entries(unsigned long minimum, unsigned long image_size)
		if (md->type != EFI_CONVENTIONAL_MEMORY)
			continue;

		if (efi_soft_reserve_enabled() &&
		    (md->attribute & EFI_MEMORY_SP))
			continue;

		if (efi_mirror_found &&
		    !(md->attribute & EFI_MEMORY_MORE_RELIABLE))
			continue;
+8 −0
Original line number Diff line number Diff line
@@ -28,6 +28,14 @@ enum e820_type {
	 */
	E820_TYPE_PRAM		= 12,

	/*
	 * Special-purpose memory is indicated to the system via the
	 * EFI_MEMORY_SP attribute. Define an e820 translation of this
	 * memory type for the purpose of reserving this range and
	 * marking it with the IORES_DESC_SOFT_RESERVED designation.
	 */
	E820_TYPE_SOFT_RESERVED	= 0xefffffff,

	/*
	 * Reserved RAM used by the kernel itself if
	 * CONFIG_INTEL_TXT=y is enabled, memory of this type
Loading