x86: mm: Re-use the early_ioremap fixed area
The temp fixed area is only used during boot for early_ioremap(), and it is unused when ioremap() is functional. vmalloc/pkmap area become available after early boot so the temp fixed area is available for re-use. The virtual address is more precious on i386, especially turning on high memory. So we can re-use the virtual address space. Remove the now unused defines FIXADDR_BOOT_START and FIXADDR_BOOT_SIZE. Signed-off-by: Minfei Huang <mnfhuang@gmail.com> Cc: pbonzini@redhat.com Cc: bp@suse.de Link: http://lkml.kernel.org/r/1414582717-32729-1-git-send-email-mnfhuang@gmail.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
96e70f8328
commit
63e7b6d90c
3 changed files with 16 additions and 15 deletions
|
@ -136,9 +136,7 @@ enum fixed_addresses {
|
||||||
extern void reserve_top_address(unsigned long reserve);
|
extern void reserve_top_address(unsigned long reserve);
|
||||||
|
|
||||||
#define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
|
#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_START (FIXADDR_TOP - FIXADDR_SIZE)
|
||||||
#define FIXADDR_BOOT_START (FIXADDR_TOP - FIXADDR_BOOT_SIZE)
|
|
||||||
|
|
||||||
extern int fixmaps_set;
|
extern int fixmaps_set;
|
||||||
|
|
||||||
|
|
|
@ -38,17 +38,20 @@ extern unsigned long highstart_pfn, highend_pfn;
|
||||||
/*
|
/*
|
||||||
* Ordering is:
|
* Ordering is:
|
||||||
*
|
*
|
||||||
* FIXADDR_TOP
|
* high memory on: high_memory off:
|
||||||
* fixed_addresses
|
* FIXADDR_TOP FIXADDR_TOP
|
||||||
* FIXADDR_START
|
* fixed addresses fixed addresses
|
||||||
* temp fixed addresses
|
* FIXADDR_START FIXADDR_START
|
||||||
* FIXADDR_BOOT_START
|
* temp fixed addresses/persistent kmap area VMALLOC_END
|
||||||
* Persistent kmap area
|
* PKMAP_BASE temp fixed addresses/vmalloc area
|
||||||
* PKMAP_BASE
|
* VMALLOC_END VMALLOC_START
|
||||||
* VMALLOC_END
|
* vmalloc area high_memory
|
||||||
* Vmalloc area
|
* VMALLOC_START
|
||||||
* VMALLOC_START
|
* high_memory
|
||||||
* high_memory
|
*
|
||||||
|
* The temp fixed area is only used during boot for early_ioremap(), and
|
||||||
|
* it is unused when the ioremap() is functional. vmalloc/pkmap area become
|
||||||
|
* available after early boot so the temp fixed area is available for re-use.
|
||||||
*/
|
*/
|
||||||
#define LAST_PKMAP_MASK (LAST_PKMAP-1)
|
#define LAST_PKMAP_MASK (LAST_PKMAP-1)
|
||||||
#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
|
#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
|
||||||
|
|
|
@ -37,13 +37,13 @@ extern bool __vmalloc_start_set; /* set once high_memory is set */
|
||||||
#define LAST_PKMAP 1024
|
#define LAST_PKMAP 1024
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PKMAP_BASE ((FIXADDR_BOOT_START - PAGE_SIZE * (LAST_PKMAP + 1)) \
|
#define PKMAP_BASE ((FIXADDR_START - PAGE_SIZE * (LAST_PKMAP + 1)) \
|
||||||
& PMD_MASK)
|
& PMD_MASK)
|
||||||
|
|
||||||
#ifdef CONFIG_HIGHMEM
|
#ifdef CONFIG_HIGHMEM
|
||||||
# define VMALLOC_END (PKMAP_BASE - 2 * PAGE_SIZE)
|
# define VMALLOC_END (PKMAP_BASE - 2 * PAGE_SIZE)
|
||||||
#else
|
#else
|
||||||
# define VMALLOC_END (FIXADDR_BOOT_START - 2 * PAGE_SIZE)
|
# define VMALLOC_END (FIXADDR_START - 2 * PAGE_SIZE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MODULES_VADDR VMALLOC_START
|
#define MODULES_VADDR VMALLOC_START
|
||||||
|
|
Loading…
Add table
Reference in a new issue