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

powerpc/mm/32s: use _PAGE_EXEC in setbat()

Do not set IBAT when setbat() is called without _PAGE_EXEC
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 160985f3
...@@ -131,6 +131,7 @@ unsigned long __init mmu_mapin_ram(unsigned long base, unsigned long top) ...@@ -131,6 +131,7 @@ unsigned long __init mmu_mapin_ram(unsigned long base, unsigned long top)
* Set up one of the I/D BAT (block address translation) register pairs. * Set up one of the I/D BAT (block address translation) register pairs.
* The parameters are not checked; in particular size must be a power * The parameters are not checked; in particular size must be a power
* of 2 between 128k and 256M. * of 2 between 128k and 256M.
* On 603+, only set IBAT when _PAGE_EXEC is set
*/ */
void __init setbat(int index, unsigned long virt, phys_addr_t phys, void __init setbat(int index, unsigned long virt, phys_addr_t phys,
unsigned int size, pgprot_t prot) unsigned int size, pgprot_t prot)
...@@ -157,11 +158,12 @@ void __init setbat(int index, unsigned long virt, phys_addr_t phys, ...@@ -157,11 +158,12 @@ void __init setbat(int index, unsigned long virt, phys_addr_t phys,
bat[1].batu |= 1; /* Vp = 1 */ bat[1].batu |= 1; /* Vp = 1 */
if (flags & _PAGE_GUARDED) { if (flags & _PAGE_GUARDED) {
/* G bit must be zero in IBATs */ /* G bit must be zero in IBATs */
bat[0].batu = bat[0].batl = 0; flags &= ~_PAGE_EXEC;
} else {
/* make IBAT same as DBAT */
bat[0] = bat[1];
} }
if (flags & _PAGE_EXEC)
bat[0] = bat[1];
else
bat[0].batu = bat[0].batl = 0;
} else { } else {
/* 601 cpu */ /* 601 cpu */
if (bl > BL_8M) if (bl > BL_8M)
......
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