Commit 729b4f7d authored by David S. Miller's avatar David S. Miller

[SPARC64]: Verify vmalloc TLB misses more strictly.

Arrange the modules, OBP, and vmalloc areas such that a range
verification can be done quite minimally.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6a9b490d
...@@ -42,19 +42,15 @@ ...@@ -42,19 +42,15 @@
* executing (see inherit_locked_prom_mappings() rant). * executing (see inherit_locked_prom_mappings() rant).
*/ */
sparc64_vpte_nucleus: sparc64_vpte_nucleus:
/* Load 0xf0000000, which is LOW_OBP_ADDRESS. */ /* Note that kvmap below has verified that the address is
mov 0xf, %g5 * in the range MODULES_VADDR --> VMALLOC_END already. So
sllx %g5, 28, %g5 * here we need only check if it is an OBP address or not.
*/
/* Is addr >= LOW_OBP_ADDRESS? */ sethi %hi(LOW_OBP_ADDRESS), %g5
cmp %g4, %g5 cmp %g4, %g5
blu,pn %xcc, sparc64_vpte_patchme1 blu,pn %xcc, sparc64_vpte_patchme1
mov 0x1, %g5 mov 0x1, %g5
/* Load 0x100000000, which is HI_OBP_ADDRESS. */
sllx %g5, 32, %g5 sllx %g5, 32, %g5
/* Is addr < HI_OBP_ADDRESS? */
cmp %g4, %g5 cmp %g4, %g5
blu,pn %xcc, obp_iaddr_patch blu,pn %xcc, obp_iaddr_patch
nop nop
...@@ -156,26 +152,29 @@ obp_daddr_patch: ...@@ -156,26 +152,29 @@ obp_daddr_patch:
* rather, use information saved during inherit_prom_mappings() using 8k * rather, use information saved during inherit_prom_mappings() using 8k
* pagesize. * pagesize.
*/ */
.align 32
kvmap: kvmap:
/* Load 0xf0000000, which is LOW_OBP_ADDRESS. */ sethi %hi(MODULES_VADDR), %g5
mov 0xf, %g5 cmp %g4, %g5
sllx %g5, 28, %g5 blu,pn %xcc, longpath
mov (VMALLOC_END >> 24), %g5
sllx %g5, 24, %g5
cmp %g4, %g5
bgeu,pn %xcc, longpath
nop
/* Is addr >= LOW_OBP_ADDRESS? */ kvmap_check_obp:
sethi %hi(LOW_OBP_ADDRESS), %g5
cmp %g4, %g5 cmp %g4, %g5
blu,pn %xcc, vmalloc_addr blu,pn %xcc, kvmap_vmalloc_addr
mov 0x1, %g5 mov 0x1, %g5
/* Load 0x100000000, which is HI_OBP_ADDRESS. */
sllx %g5, 32, %g5 sllx %g5, 32, %g5
/* Is addr < HI_OBP_ADDRESS? */
cmp %g4, %g5 cmp %g4, %g5
blu,pn %xcc, obp_daddr_patch blu,pn %xcc, obp_daddr_patch
nop nop
vmalloc_addr: kvmap_vmalloc_addr:
/* If we get here, a vmalloc addr accessed, load kernel VPTE. */ /* If we get here, a vmalloc addr was accessed, load kernel VPTE. */
ldxa [%g3 + %g6] ASI_N, %g5 ldxa [%g3 + %g6] ASI_N, %g5
brgez,pn %g5, longpath brgez,pn %g5, longpath
nop nop
......
...@@ -24,21 +24,23 @@ ...@@ -24,21 +24,23 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/const.h> #include <asm/const.h>
/* The kernel image occupies 0x4000000 to 0x1000000 (4MB --> 16MB). /* The kernel image occupies 0x4000000 to 0x1000000 (4MB --> 32MB).
* The page copy blockops use 0x1000000 to 0x18000000 (16MB --> 24MB). * The page copy blockops can use 0x2000000 to 0x10000000.
* The PROM resides in an area spanning 0xf0000000 to 0x100000000. * The PROM resides in an area spanning 0xf0000000 to 0x100000000.
* The vmalloc area spans 0x140000000 to 0x200000000. * The vmalloc area spans 0x100000000 to 0x200000000.
* Since modules need to be in the lowest 32-bits of the address space,
* we place them right before the OBP area from 0x10000000 to 0xf0000000.
* There is a single static kernel PMD which maps from 0x0 to address * There is a single static kernel PMD which maps from 0x0 to address
* 0x400000000. * 0x400000000.
*/ */
#define TLBTEMP_BASE _AC(0x0000000001000000,UL) #define TLBTEMP_BASE _AC(0x0000000002000000,UL)
#define MODULES_VADDR _AC(0x0000000002000000,UL) #define MODULES_VADDR _AC(0x0000000010000000,UL)
#define MODULES_LEN _AC(0x000000007e000000,UL) #define MODULES_LEN _AC(0x00000000e0000000,UL)
#define MODULES_END _AC(0x0000000080000000,UL) #define MODULES_END _AC(0x00000000f0000000,UL)
#define VMALLOC_START _AC(0x0000000140000000,UL)
#define VMALLOC_END _AC(0x0000000200000000,UL)
#define LOW_OBP_ADDRESS _AC(0x00000000f0000000,UL) #define LOW_OBP_ADDRESS _AC(0x00000000f0000000,UL)
#define HI_OBP_ADDRESS _AC(0x0000000100000000,UL) #define HI_OBP_ADDRESS _AC(0x0000000100000000,UL)
#define VMALLOC_START _AC(0x0000000100000000,UL)
#define VMALLOC_END _AC(0x0000000200000000,UL)
/* XXX All of this needs to be rethought so we can take advantage /* XXX All of this needs to be rethought so we can take advantage
* XXX cheetah's full 64-bit virtual address space, ie. no more hole * XXX cheetah's full 64-bit virtual address space, ie. no more hole
......
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