Commit cbca567e authored by Akira Iguchi's avatar Akira Iguchi Committed by Paul Mackerras

[POWERPC] Celleb: improve MMU hashtable locking

Disabling IRQ is required only in invalidation.  This changes
"spin_lock_irqsave" to "spin_lock" in other ops.
Signed-off-by: default avatarKou Ishizaki <kou.ishizaki@toshiba.co.jp>
Signed-off-by: default avatarAkira Iguchi <akira2.iguchi@toshiba.co.jp>
Acked-by: default avatarArnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 1f1fec94
...@@ -95,7 +95,6 @@ static long beat_lpar_hpte_insert(unsigned long hpte_group, ...@@ -95,7 +95,6 @@ static long beat_lpar_hpte_insert(unsigned long hpte_group,
unsigned long lpar_rc; unsigned long lpar_rc;
unsigned long slot; unsigned long slot;
unsigned long hpte_v, hpte_r; unsigned long hpte_v, hpte_r;
unsigned long flags;
/* same as iseries */ /* same as iseries */
if (vflags & HPTE_V_SECONDARY) if (vflags & HPTE_V_SECONDARY)
...@@ -115,17 +114,17 @@ static long beat_lpar_hpte_insert(unsigned long hpte_group, ...@@ -115,17 +114,17 @@ static long beat_lpar_hpte_insert(unsigned long hpte_group,
if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE)) if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE))
hpte_r &= ~_PAGE_COHERENT; hpte_r &= ~_PAGE_COHERENT;
spin_lock_irqsave(&beat_htab_lock, flags); spin_lock(&beat_htab_lock);
if ((lpar_rc = beat_read_mask(hpte_group)) == 0) { if ((lpar_rc = beat_read_mask(hpte_group)) == 0) {
if (!(vflags & HPTE_V_BOLTED)) if (!(vflags & HPTE_V_BOLTED))
DBG_LOW(" full\n"); DBG_LOW(" full\n");
spin_unlock_irqrestore(&beat_htab_lock, flags); spin_unlock(&beat_htab_lock);
return -1; return -1;
} }
lpar_rc = beat_insert_htab_entry(0, hpte_group, lpar_rc << 48, lpar_rc = beat_insert_htab_entry(0, hpte_group, lpar_rc << 48,
hpte_v, hpte_r, &slot); hpte_v, hpte_r, &slot);
spin_unlock_irqrestore(&beat_htab_lock, flags); spin_unlock(&beat_htab_lock);
/* /*
* Since we try and ioremap PHBs we don't own, the pte insert * Since we try and ioremap PHBs we don't own, the pte insert
...@@ -189,7 +188,6 @@ static long beat_lpar_hpte_updatepp(unsigned long slot, ...@@ -189,7 +188,6 @@ static long beat_lpar_hpte_updatepp(unsigned long slot,
{ {
unsigned long lpar_rc; unsigned long lpar_rc;
unsigned long dummy0, dummy1, want_v; unsigned long dummy0, dummy1, want_v;
unsigned long flags;
want_v = hpte_encode_v(va, psize); want_v = hpte_encode_v(va, psize);
...@@ -197,17 +195,17 @@ static long beat_lpar_hpte_updatepp(unsigned long slot, ...@@ -197,17 +195,17 @@ static long beat_lpar_hpte_updatepp(unsigned long slot,
"avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ", "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ",
want_v & HPTE_V_AVPN, slot, psize, newpp); want_v & HPTE_V_AVPN, slot, psize, newpp);
spin_lock_irqsave(&beat_htab_lock, flags); spin_lock(&beat_htab_lock);
dummy0 = beat_lpar_hpte_getword0(slot); dummy0 = beat_lpar_hpte_getword0(slot);
if ((dummy0 & ~0x7FUL) != (want_v & ~0x7FUL)) { if ((dummy0 & ~0x7FUL) != (want_v & ~0x7FUL)) {
DBG_LOW("not found !\n"); DBG_LOW("not found !\n");
spin_unlock_irqrestore(&beat_htab_lock, flags); spin_unlock(&beat_htab_lock);
return -1; return -1;
} }
lpar_rc = beat_write_htab_entry(0, slot, 0, newpp, 0, 7, &dummy0, lpar_rc = beat_write_htab_entry(0, slot, 0, newpp, 0, 7, &dummy0,
&dummy1); &dummy1);
spin_unlock_irqrestore(&beat_htab_lock, flags); spin_unlock(&beat_htab_lock);
if (lpar_rc != 0 || dummy0 == 0) { if (lpar_rc != 0 || dummy0 == 0) {
DBG_LOW("not found !\n"); DBG_LOW("not found !\n");
return -1; return -1;
...@@ -256,18 +254,17 @@ static void beat_lpar_hpte_updateboltedpp(unsigned long newpp, ...@@ -256,18 +254,17 @@ static void beat_lpar_hpte_updateboltedpp(unsigned long newpp,
int psize) int psize)
{ {
unsigned long lpar_rc, slot, vsid, va, dummy0, dummy1; unsigned long lpar_rc, slot, vsid, va, dummy0, dummy1;
unsigned long flags;
vsid = get_kernel_vsid(ea); vsid = get_kernel_vsid(ea);
va = (vsid << 28) | (ea & 0x0fffffff); va = (vsid << 28) | (ea & 0x0fffffff);
spin_lock_irqsave(&beat_htab_lock, flags); spin_lock(&beat_htab_lock);
slot = beat_lpar_hpte_find(va, psize); slot = beat_lpar_hpte_find(va, psize);
BUG_ON(slot == -1); BUG_ON(slot == -1);
lpar_rc = beat_write_htab_entry(0, slot, 0, newpp, 0, 7, lpar_rc = beat_write_htab_entry(0, slot, 0, newpp, 0, 7,
&dummy0, &dummy1); &dummy0, &dummy1);
spin_unlock_irqrestore(&beat_htab_lock, flags); spin_unlock(&beat_htab_lock);
BUG_ON(lpar_rc != 0); BUG_ON(lpar_rc != 0);
} }
......
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