Commit a67beca0 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/32: make KVIRT_TOP dependent on FIXMAP_START

When we add KASAN shadow area, KVIRT_TOP can't be anymore fixed
at 0xfe000000.

This patch uses FIXADDR_START to define KVIRT_TOP.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 7934cea7
...@@ -134,15 +134,24 @@ static inline bool pte_user(pte_t pte) ...@@ -134,15 +134,24 @@ static inline bool pte_user(pte_t pte)
#define PGDIR_MASK (~(PGDIR_SIZE-1)) #define PGDIR_MASK (~(PGDIR_SIZE-1))
#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
#ifndef __ASSEMBLY__
int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
#endif /* !__ASSEMBLY__ */
/* /*
* This is the bottom of the PKMAP area with HIGHMEM or an arbitrary * This is the bottom of the PKMAP area with HIGHMEM or an arbitrary
* value (for now) on others, from where we can start layout kernel * value (for now) on others, from where we can start layout kernel
* virtual space that goes below PKMAP and FIXMAP * virtual space that goes below PKMAP and FIXMAP
*/ */
#include <asm/fixmap.h>
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
#define KVIRT_TOP PKMAP_BASE #define KVIRT_TOP PKMAP_BASE
#else #else
#define KVIRT_TOP (0xfe000000UL) /* for now, could be FIXMAP_BASE ? */ #define KVIRT_TOP FIXADDR_START
#endif #endif
/* /*
...@@ -373,8 +382,6 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma, ...@@ -373,8 +382,6 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma,
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 3 }) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 3 })
#define __swp_entry_to_pte(x) ((pte_t) { (x).val << 3 }) #define __swp_entry_to_pte(x) ((pte_t) { (x).val << 3 })
int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
/* Generic accessors to PTE bits */ /* Generic accessors to PTE bits */
static inline int pte_write(pte_t pte) { return !!(pte_val(pte) & _PAGE_RW);} static inline int pte_write(pte_t pte) { return !!(pte_val(pte) & _PAGE_RW);}
static inline int pte_read(pte_t pte) { return 1; } static inline int pte_read(pte_t pte) { return 1; }
......
...@@ -64,15 +64,24 @@ extern int icache_44x_need_flush; ...@@ -64,15 +64,24 @@ extern int icache_44x_need_flush;
#define pgd_ERROR(e) \ #define pgd_ERROR(e) \
pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
#ifndef __ASSEMBLY__
int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
#endif /* !__ASSEMBLY__ */
/* /*
* This is the bottom of the PKMAP area with HIGHMEM or an arbitrary * This is the bottom of the PKMAP area with HIGHMEM or an arbitrary
* value (for now) on others, from where we can start layout kernel * value (for now) on others, from where we can start layout kernel
* virtual space that goes below PKMAP and FIXMAP * virtual space that goes below PKMAP and FIXMAP
*/ */
#include <asm/fixmap.h>
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
#define KVIRT_TOP PKMAP_BASE #define KVIRT_TOP PKMAP_BASE
#else #else
#define KVIRT_TOP (0xfe000000UL) /* for now, could be FIXMAP_BASE ? */ #define KVIRT_TOP FIXADDR_START
#endif #endif
/* /*
...@@ -379,8 +388,6 @@ static inline int pte_young(pte_t pte) ...@@ -379,8 +388,6 @@ static inline int pte_young(pte_t pte)
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 3 }) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 3 })
#define __swp_entry_to_pte(x) ((pte_t) { (x).val << 3 }) #define __swp_entry_to_pte(x) ((pte_t) { (x).val << 3 })
int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#endif /* __ASM_POWERPC_NOHASH_32_PGTABLE_H */ #endif /* __ASM_POWERPC_NOHASH_32_PGTABLE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment