[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-f56ab9a5b73ca2aee777ccdf2d355ae2dd31db5a@git.kernel.org>
Date: Mon, 21 Aug 2017 02:15:36 -0700
From: tip-bot for Ard Biesheuvel <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: matt@...eblueprint.co.uk, torvalds@...ux-foundation.org,
hpa@...or.com, peterz@...radead.org, mingo@...nel.org,
tglx@...utronix.de, linux-kernel@...r.kernel.org,
mark.rutland@....com, ard.biesheuvel@...aro.org
Subject: [tip:efi/core] efi/arm: Don't mark ACPI reclaim memory as
MEMBLOCK_NOMAP
Commit-ID: f56ab9a5b73ca2aee777ccdf2d355ae2dd31db5a
Gitweb: http://git.kernel.org/tip/f56ab9a5b73ca2aee777ccdf2d355ae2dd31db5a
Author: Ard Biesheuvel <ard.biesheuvel@...aro.org>
AuthorDate: Fri, 18 Aug 2017 20:49:34 +0100
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 21 Aug 2017 09:43:49 +0200
efi/arm: Don't mark ACPI reclaim memory as MEMBLOCK_NOMAP
On ARM, regions of memory that are described by UEFI as having special
significance to the firmware itself are omitted from the linear mapping.
This is necessary since we cannot guarantee that alternate mappings of
the same physical region will use attributes that are compatible with
the ones we use for the linear mapping, and aliases with mismatched
attributes are prohibited by the architecture.
The above does not apply to ACPI reclaim regions: such regions have no
special significance to the firmware, and it is up to the OS to decide
whether or not to preserve them after it has consumed their contents,
and for how long, after which time the OS can use the memory in any way
it likes. In the Linux case, such regions are preserved indefinitely,
and are simply treated the same way as other 'reserved' memory types.
Punching holes into the linear mapping causes page table fragmentation,
which increases TLB pressure, and so we should avoid doing so if we can.
So add a special case for regions of type EFI_ACPI_RECLAIM_MEMORY, and
memblock_reserve() them instead of marking them MEMBLOCK_NOMAP.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@...aro.org>
Acked-by: Mark Rutland <mark.rutland@....com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Matt Fleming <matt@...eblueprint.co.uk>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-efi@...r.kernel.org
Link: http://lkml.kernel.org/r/20170818194947.19347-2-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
drivers/firmware/efi/arm-init.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
index 1027d7b4..0aa4ce7 100644
--- a/drivers/firmware/efi/arm-init.c
+++ b/drivers/firmware/efi/arm-init.c
@@ -159,6 +159,7 @@ static __init int is_usable_memory(efi_memory_desc_t *md)
switch (md->type) {
case EFI_LOADER_CODE:
case EFI_LOADER_DATA:
+ case EFI_ACPI_RECLAIM_MEMORY:
case EFI_BOOT_SERVICES_CODE:
case EFI_BOOT_SERVICES_DATA:
case EFI_CONVENTIONAL_MEMORY:
@@ -211,6 +212,10 @@ static __init void reserve_regions(void)
if (!is_usable_memory(md))
memblock_mark_nomap(paddr, size);
+
+ /* keep ACPI reclaim memory intact for kexec etc. */
+ if (md->type == EFI_ACPI_RECLAIM_MEMORY)
+ memblock_reserve(paddr, size);
}
}
}
Powered by blists - more mailing lists