x86/mm: Re-use the early_ioremap fixed area
PATCH 1/1 x86/mm: Re-use the early_ioremap fixed area
The FIXADDR_BOOT area is only used during boot for early_ioremap, and it is unused when the ioremap is functional. vmalloc becomes available after early boot so the FIXADDR_BOOT_START area is available for reuse.
The virtual address is more precious on i386, especially turning on the high memory. So we can reuse the virtual address whichever we can.
The macros of FIXADDR_BOOT_START and FIXADDR_BOOT_SIZE donot use any more.
Signed-off-by Minfei Huang <[email protected]>
--- arch/x86/include/asm/fixmap.h | 2 -- arch/x86/include/asm/highmem.h | 4 +--- arch/x86/include/asm/pgtable_32_types.h | 4 ++-- 3 files changed, 3 insertions(+), 7 deletions(-)
arch/x86/include/asm/fixmap.h +0 -2
@@ -136,9 +136,7 @@ enum fixed_addresses {extern void reserve_top_address (unsigned long reserve);#define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT) -#define FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) -#define FIXADDR_BOOT_START (FIXADDR_TOP - FIXADDR_BOOT_SIZE)extern int fixmaps_set;
arch/x86/include/asm/highmem.h +1 -3
@@ -41,9 +41,7 @@ extern unsigned long highstart_pfn, highend_pfn;* FIXADDR_TOP * fixed_addresses * FIXADDR_START -* temp fixed addresses -* FIXADDR_BOOT_START -* Persistent kmap area +* temp fixed addresses / Persistent kmap area * PKMAP_BASE * VMALLOC_END * Vmalloc area
arch/x86/include/asm/pgtable_32_types.h +2 -2
@@ -37,13 +37,13 @@ extern bool __vmalloc_start_set; /* set once high_memory is set */#define LAST_PKMAP 1024#endif -#define PKMAP_BASE ((FIXADDR_BOOT_START - PAGE_SIZE * (LAST_PKMAP + 1)) \ +#define PKMAP_BASE ((FIXADDR_START - PAGE_SIZE * (LAST_PKMAP + 1)) \ & PMD_MASK)#ifdef CONFIG_HIGHMEM # define VMALLOC_END (PKMAP_BASE - 2 * PAGE_SIZE)#else -# define VMALLOC_END (FIXADDR_BOOT_START - 2 * PAGE_SIZE) +# define VMALLOC_END (FIXADDR_START - 2 * PAGE_SIZE)#endif #define MODULES_VADDR VMALLOC_START
Signature · 1 line
1.8.3.1
arch/x86/include/asm/highmem.h extern unsigned long highstart_pfn, highend_pfn; · line 45
Quoted 10 lines · Minfei Huang
arch/x86/include/asm/highmem.h +0
-2@@ -41,9 +41,7 @@ extern unsigned long highstart_pfn, highend_pfn;* FIXADDR_TOP * fixed_addresses * FIXADDR_START -* temp fixed addresses -* FIXADDR_BOOT_START
We should at least add a comment here which makes it clear, that PKMAP/VMALLOC area is used for early_ioremap() during early boot.
Thanks,
tglx