Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1563773
| From | Thomas Garnier <thgarnie@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v1 1/3] x86/mm: Adapt MODULES_END based on Fixmap section size |
| Date | 2017-01-20 17:50 +0100 |
| Message-ID | <t1KxX-1do-9@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
This patch aligns MODULES_END to the beginning of the Fixmap section.
It optimizes the space available for both sections. The address is
pre-computed based on the number of pages required by the Fixmap
section.
It will allow GDT remapping in the Fixmap section. The current
MODULES_END static address does not provide enough space for the kernel
to support a large number of processors.
Signed-off-by: Thomas Garnier <thgarnie@google.com>
---
Based on next-20170119
---
arch/x86/include/asm/fixmap.h | 8 ++++++++
arch/x86/include/asm/pgtable_64_types.h | 3 ---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h
index 8554f960e21b..c46289799b02 100644
--- a/arch/x86/include/asm/fixmap.h
+++ b/arch/x86/include/asm/fixmap.h
@@ -132,6 +132,14 @@ enum fixed_addresses {
extern void reserve_top_address(unsigned long reserve);
+/* On 64bit, the module sections ends with the start of the fixmap */
+#ifdef CONFIG_X86_64
+#define MODULES_VADDR (__START_KERNEL_map + KERNEL_IMAGE_SIZE)
+#define MODULES_END __fix_to_virt(__end_of_fixed_addresses + 1)
+#define MODULES_LEN (MODULES_END - MODULES_VADDR)
+#endif /* CONFIG_X86_64 */
+
+
#define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
diff --git a/arch/x86/include/asm/pgtable_64_types.h b/arch/x86/include/asm/pgtable_64_types.h
index 3a264200c62f..de8bace10200 100644
--- a/arch/x86/include/asm/pgtable_64_types.h
+++ b/arch/x86/include/asm/pgtable_64_types.h
@@ -66,9 +66,6 @@ typedef struct { pteval_t pte; } pte_t;
#define VMEMMAP_START __VMEMMAP_BASE
#endif /* CONFIG_RANDOMIZE_MEMORY */
#define VMALLOC_END (VMALLOC_START + _AC((VMALLOC_SIZE_TB << 40) - 1, UL))
-#define MODULES_VADDR (__START_KERNEL_map + KERNEL_IMAGE_SIZE)
-#define MODULES_END _AC(0xffffffffff000000, UL)
-#define MODULES_LEN (MODULES_END - MODULES_VADDR)
#define ESPFIX_PGD_ENTRY _AC(-2, UL)
#define ESPFIX_BASE_ADDR (ESPFIX_PGD_ENTRY << PGDIR_SHIFT)
#define EFI_VA_START ( -4 * (_AC(1, UL) << 30))
--
2.11.0.483.g087da7b7c-goog
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH v1 1/3] x86/mm: Adapt MODULES_END based on Fixmap section size Thomas Garnier <thgarnie@google.com> - 2017-01-20 17:50 +0100
[PATCH v1 2/3] x86: Remap GDT tables in the Fixmap section Thomas Garnier <thgarnie@google.com> - 2017-01-20 17:50 +0100
Re: [PATCH v1 2/3] x86: Remap GDT tables in the Fixmap section Andy Lutomirski <luto@amacapital.net> - 2017-01-21 02:00 +0100
Re: [PATCH v1 2/3] x86: Remap GDT tables in the Fixmap section Thomas Garnier <thgarnie@google.com> - 2017-01-21 02:20 +0100
Re: [PATCH v1 2/3] x86: Remap GDT tables in the Fixmap section Thomas Garnier <thgarnie@google.com> - 2017-01-25 21:20 +0100
Re: [PATCH v1 2/3] x86: Remap GDT tables in the Fixmap section kbuild test robot <lkp@intel.com> - 2017-01-21 03:40 +0100
[PATCH v1 3/3] x86: Make the GDT remapping read-only on 64 bit Thomas Garnier <thgarnie@google.com> - 2017-01-20 17:50 +0100
Re: [PATCH v1 3/3] x86: Make the GDT remapping read-only on 64 bit Andy Lutomirski <luto@amacapital.net> - 2017-01-21 02:20 +0100
Re: [PATCH v1 3/3] x86: Make the GDT remapping read-only on 64 bit Thomas Garnier <thgarnie@google.com> - 2017-01-21 02:20 +0100
Re: [PATCH v1 1/3] x86/mm: Adapt MODULES_END based on Fixmap section size Andy Lutomirski <luto@amacapital.net> - 2017-01-20 23:30 +0100
Re: [PATCH v1 1/3] x86/mm: Adapt MODULES_END based on Fixmap section size kbuild test robot <lkp@intel.com> - 2017-01-21 03:50 +0100
Re: [PATCH v1 1/3] x86/mm: Adapt MODULES_END based on Fixmap section size kbuild test robot <lkp@intel.com> - 2017-01-21 04:30 +0100
csiph-web