aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/kernel/iSeries_htab.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2005-09-23 00:47:58 -0400
committerStephen Rothwell <sfr@canb.auug.org.au>2005-09-23 00:47:58 -0400
commit4c55130b2aa93370f1bf52d2304394e91cf8ee39 (patch)
tree522c7f510775f221c4e8046bc238a618db4768df /arch/ppc64/kernel/iSeries_htab.c
parentba293fff085fde5b9f1b5a57c8abb1a8098d0c59 (diff)
ppc64 iSeries: Update create_pte_mapping to replace iSeries_bolt_kernel()
early_setup() calls htab_initialize() which is similar, but not identical to iSeries_bolt_kernel(). On iSeries the Hypervisor has already inserted some ptes for us, and we simply have to detect that and bolt them. iSeries_hpte_bolt_or_insert() implements that logic. For the case of a non-existing pte we just call iSeries_hpte_insert(). This appears to work, although it's not entirely equivalent to the old code in iSeries_make_pte() which panicked if we got a secondary slot. Not sure if that's important. Finally we call iSeries_hpte_bolt_or_insert() from create_pte_mapping(), which is called from htab_initialize() for each lmb region. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch/ppc64/kernel/iSeries_htab.c')
-rw-r--r--arch/ppc64/kernel/iSeries_htab.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/ppc64/kernel/iSeries_htab.c b/arch/ppc64/kernel/iSeries_htab.c
index 2192055a90a0..9a2be3abf349 100644
--- a/arch/ppc64/kernel/iSeries_htab.c
+++ b/arch/ppc64/kernel/iSeries_htab.c
@@ -84,6 +84,25 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
84 return (secondary << 3) | (slot & 7); 84 return (secondary << 3) | (slot & 7);
85} 85}
86 86
87long iSeries_hpte_bolt_or_insert(unsigned long hpte_group,
88 unsigned long va, unsigned long prpn, unsigned long vflags,
89 unsigned long rflags)
90{
91 long slot;
92 hpte_t lhpte;
93
94 slot = HvCallHpt_findValid(&lhpte, va >> PAGE_SHIFT);
95
96 if (lhpte.v & HPTE_V_VALID) {
97 /* Bolt the existing HPTE */
98 HvCallHpt_setSwBits(slot, 0x10, 0);
99 HvCallHpt_setPp(slot, PP_RWXX);
100 return 0;
101 }
102
103 return iSeries_hpte_insert(hpte_group, va, prpn, vflags, rflags);
104}
105
87static unsigned long iSeries_hpte_getword0(unsigned long slot) 106static unsigned long iSeries_hpte_getword0(unsigned long slot)
88{ 107{
89 hpte_t hpte; 108 hpte_t hpte;