Commit aefd16b0 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[PATCH] ppc64: Remove redundant uses of physRpn_to_absRpn

physRpn_to_absRpn is a no-op on non-iSeries platforms, remove the two
redundant calls.

There's only one caller on iSeries so fold the logic in there so we can get
rid of it completely.
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent ce217952
...@@ -41,6 +41,7 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va, ...@@ -41,6 +41,7 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
unsigned long prpn, unsigned long vflags, unsigned long prpn, unsigned long vflags,
unsigned long rflags) unsigned long rflags)
{ {
unsigned long arpn;
long slot; long slot;
hpte_t lhpte; hpte_t lhpte;
int secondary = 0; int secondary = 0;
...@@ -70,8 +71,10 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va, ...@@ -70,8 +71,10 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
slot &= 0x7fffffffffffffff; slot &= 0x7fffffffffffffff;
} }
arpn = phys_to_abs(prpn << PAGE_SHIFT) >> PAGE_SHIFT;
lhpte.v = (va >> 23) << HPTE_V_AVPN_SHIFT | vflags | HPTE_V_VALID; lhpte.v = (va >> 23) << HPTE_V_AVPN_SHIFT | vflags | HPTE_V_VALID;
lhpte.r = (physRpn_to_absRpn(prpn) << HPTE_R_RPN_SHIFT) | rflags; lhpte.r = (arpn << HPTE_R_RPN_SHIFT) | rflags;
/* Now fill in the actual HPTE */ /* Now fill in the actual HPTE */
HvCallHpt_addValidate(slot, secondary, &lhpte); HvCallHpt_addValidate(slot, secondary, &lhpte);
......
...@@ -278,7 +278,6 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group, ...@@ -278,7 +278,6 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
unsigned long va, unsigned long prpn, unsigned long va, unsigned long prpn,
unsigned long vflags, unsigned long rflags) unsigned long vflags, unsigned long rflags)
{ {
unsigned long arpn = physRpn_to_absRpn(prpn);
unsigned long lpar_rc; unsigned long lpar_rc;
unsigned long flags; unsigned long flags;
unsigned long slot; unsigned long slot;
...@@ -289,7 +288,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group, ...@@ -289,7 +288,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
if (vflags & HPTE_V_LARGE) if (vflags & HPTE_V_LARGE)
hpte_v &= ~(1UL << HPTE_V_AVPN_SHIFT); hpte_v &= ~(1UL << HPTE_V_AVPN_SHIFT);
hpte_r = (arpn << HPTE_R_RPN_SHIFT) | rflags; hpte_r = (prpn << HPTE_R_RPN_SHIFT) | rflags;
/* Now fill in the actual HPTE */ /* Now fill in the actual HPTE */
/* Set CEC cookie to 0 */ /* Set CEC cookie to 0 */
......
...@@ -51,7 +51,6 @@ long native_hpte_insert(unsigned long hpte_group, unsigned long va, ...@@ -51,7 +51,6 @@ long native_hpte_insert(unsigned long hpte_group, unsigned long va,
unsigned long prpn, unsigned long vflags, unsigned long prpn, unsigned long vflags,
unsigned long rflags) unsigned long rflags)
{ {
unsigned long arpn = physRpn_to_absRpn(prpn);
hpte_t *hptep = htab_address + hpte_group; hpte_t *hptep = htab_address + hpte_group;
unsigned long hpte_v, hpte_r; unsigned long hpte_v, hpte_r;
int i; int i;
...@@ -74,7 +73,7 @@ long native_hpte_insert(unsigned long hpte_group, unsigned long va, ...@@ -74,7 +73,7 @@ long native_hpte_insert(unsigned long hpte_group, unsigned long va,
hpte_v = (va >> 23) << HPTE_V_AVPN_SHIFT | vflags | HPTE_V_VALID; hpte_v = (va >> 23) << HPTE_V_AVPN_SHIFT | vflags | HPTE_V_VALID;
if (vflags & HPTE_V_LARGE) if (vflags & HPTE_V_LARGE)
va &= ~(1UL << HPTE_V_AVPN_SHIFT); va &= ~(1UL << HPTE_V_AVPN_SHIFT);
hpte_r = (arpn << HPTE_R_RPN_SHIFT) | rflags; hpte_r = (prpn << HPTE_R_RPN_SHIFT) | rflags;
hptep->r = hpte_r; hptep->r = hpte_r;
/* Guarantee the second dword is visible before the valid bit */ /* Guarantee the second dword is visible before the valid bit */
......
...@@ -56,14 +56,6 @@ static inline unsigned long phys_to_abs(unsigned long pa) ...@@ -56,14 +56,6 @@ static inline unsigned long phys_to_abs(unsigned long pa)
return chunk_to_addr(chunk) + (pa & MSCHUNKS_OFFSET_MASK); return chunk_to_addr(chunk) + (pa & MSCHUNKS_OFFSET_MASK);
} }
static inline unsigned long
physRpn_to_absRpn(unsigned long rpn)
{
unsigned long pa = rpn << PAGE_SHIFT;
unsigned long aa = phys_to_abs(pa);
return (aa >> PAGE_SHIFT);
}
/* A macro so it can take pointers or unsigned long. */ /* A macro so it can take pointers or unsigned long. */
#define abs_to_phys(aa) lmb_abs_to_phys((unsigned long)(aa)) #define abs_to_phys(aa) lmb_abs_to_phys((unsigned long)(aa))
......
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