diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2011-04-14 18:25:21 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-04-15 12:55:18 -0500 |
commit | d7dd2ff11b7fcd425aca5a875983c862d19a67ae (patch) | |
tree | 6ad74d89d2355861b513eefb763ea6103a8d68e7 /arch/parisc/kernel/head.S | |
parent | e38f5b745075828ac51b12c8c95c85a7be4a3ec7 (diff) | |
download | op-kernel-dev-d7dd2ff11b7fcd425aca5a875983c862d19a67ae.zip op-kernel-dev-d7dd2ff11b7fcd425aca5a875983c862d19a67ae.tar.gz |
[PARISC] only make executable areas executable
Currently parisc has the whole kernel marked as RWX, meaning any
kernel page at all is eligible to be executed. This can cause a
theoretical problem on systems with combined I/D TLB because the act
of referencing a page causes a TLB insertion with an executable bit.
This TLB entry may be used by the CPU as the basis for speculating the
page into the I-Cache. If this speculated page is subsequently used
for a user process, there is the possibility we will get a stale
I-cache line picked up as the binary executes.
As a point of good practise, only mark actual kernel text pages as
executable. The same has to be done for init_text pages, but they're
converted to data pages (and the I-Cache flushed) when the init memory
is released.
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'arch/parisc/kernel/head.S')
-rw-r--r-- | arch/parisc/kernel/head.S | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S index 145c5e4..37aabd7 100644 --- a/arch/parisc/kernel/head.S +++ b/arch/parisc/kernel/head.S @@ -106,8 +106,9 @@ $bss_loop: #endif - /* Now initialize the PTEs themselves */ - ldo 0+_PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */ + /* Now initialize the PTEs themselves. We use RWX for + * everything ... it will get remapped correctly later */ + ldo 0+_PAGE_KERNEL_RWX(%r0),%r3 /* Hardwired 0 phys addr start */ ldi (1<<(KERNEL_INITIAL_ORDER-PAGE_SHIFT)),%r11 /* PFN count */ load32 PA(pg0),%r1 |