[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1499665896-23731-2-git-send-email-n-horiguchi@ah.jp.nec.com>
Date: Mon, 10 Jul 2017 14:51:36 +0900
From: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
Cc: Baoquan He <bhe@...hat.com>, Kees Cook <keescook@...omium.org>,
linux-kernel@...r.kernel.org, <x86@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...nel.org>,
<izumi.taku@...fujitsu.com>, Thomas Garnier <thgarnie@...gle.com>,
<fanc.fnst@...fujitsu.com>,
Matt Fleming <matt@...eblueprint.co.uk>,
"Jun'ichi Nomura" <j-nomura@...jp.nec.com>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>
Subject: [PATCH v3 2/2] x86/efi: clean up dead code around efi_reserve_boot_services()
EFI_BOOT_SERVICES_{CODE|DATA} regions never overlap the kernel now,
so we can clean up the check in efi_reserve_boot_services().
Signed-off-by: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
---
arch/x86/platform/efi/quirks.c | 23 +----------------------
1 file changed, 1 insertion(+), 22 deletions(-)
diff --git next-20170705/arch/x86/platform/efi/quirks.c next-20170705_patched/arch/x86/platform/efi/quirks.c
index 8a99a2e..191f6f7 100644
--- next-20170705/arch/x86/platform/efi/quirks.c
+++ next-20170705_patched/arch/x86/platform/efi/quirks.c
@@ -292,27 +292,6 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size)
efi_memmap_install(new_phys, num_entries);
}
-/*
- * Helper function for efi_reserve_boot_services() to figure out if we
- * can free regions in efi_free_boot_services().
- *
- * Use this function to ensure we do not free regions owned by somebody
- * else. We must only reserve (and then free) regions:
- *
- * - Not within any part of the kernel
- * - Not the BIOS reserved area (E820_TYPE_RESERVED, E820_TYPE_NVS, etc)
- */
-static bool can_free_region(u64 start, u64 size)
-{
- if (start + size > __pa_symbol(_text) && start <= __pa_symbol(_end))
- return false;
-
- if (!e820__mapped_all(start, start+size, E820_TYPE_RAM))
- return false;
-
- return true;
-}
-
void __init efi_reserve_boot_services(void)
{
efi_memory_desc_t *md;
@@ -350,7 +329,7 @@ void __init efi_reserve_boot_services(void)
* one else cares about it. We own it and can
* free it later.
*/
- if (can_free_region(start, size))
+ if (e820__mapped_all(start, start+size, E820_TYPE_RAM))
continue;
}
--
2.7.0
Powered by blists - more mailing lists