21 #include <linux/kernel.h>
24 #include <asm/machdep.h>
46 static long ps3_hpte_insert(
unsigned long hpte_group,
unsigned long vpn,
47 unsigned long pa,
unsigned long rflags,
unsigned long vflags,
53 u64 evicted_v, evicted_r;
54 u64 hpte_v_array[4], hpte_rs;
64 hpte_v = hpte_encode_v(vpn, psize, ssize) | vflags |
HPTE_V_VALID;
74 &evicted_v, &evicted_r);
78 pr_info(
"%s:result=%d vpn=%lx pa=%lx ix=%lx v=%llx r=%llx\n",
79 __func__, result, vpn, pa, hpte_group, hpte_v, hpte_r);
87 inserted_index & ~0x3UL,
88 &hpte_v_array[0], &hpte_v_array[1],
89 &hpte_v_array[2], &hpte_v_array[3],
94 ret = (inserted_index & 7) | (1 << 3);
96 ret = inserted_index & 7;
98 spin_unlock_irqrestore(&ps3_htab_lock, flags);
103 static long ps3_hpte_remove(
unsigned long hpte_group)
105 panic(
"ps3_hpte_remove() not implemented");
109 static long ps3_hpte_updatepp(
unsigned long slot,
unsigned long newpp,
110 unsigned long vpn,
int psize,
int ssize,
int local)
113 u64 hpte_v, want_v, hpte_rs;
118 want_v = hpte_encode_v(vpn, psize, ssize);
123 &hpte_v_array[0], &hpte_v_array[1],
124 &hpte_v_array[2], &hpte_v_array[3],
128 pr_info(
"%s: res=%d read vpn=%lx slot=%lx psize=%d\n",
129 __func__, result, vpn, slot, psize);
133 hpte_v = hpte_v_array[slot % 4];
152 spin_unlock_irqrestore(&ps3_htab_lock, flags);
156 static void ps3_hpte_updateboltedpp(
unsigned long newpp,
unsigned long ea,
157 int psize,
int ssize)
159 panic(
"ps3_hpte_updateboltedpp() not implemented");
162 static void ps3_hpte_invalidate(
unsigned long slot,
unsigned long vpn,
163 int psize,
int ssize,
int local)
173 pr_info(
"%s: res=%d vpn=%lx slot=%lx psize=%d\n",
174 __func__, result, vpn, slot, psize);
178 spin_unlock_irqrestore(&ps3_htab_lock, flags);
181 static void ps3_hpte_clear(
void)
183 unsigned long hpte_count = (1UL << ppc64_pft_size) >> 4;
186 for (i = 0; i < hpte_count; i++)
195 ppc_md.hpte_invalidate = ps3_hpte_invalidate;
196 ppc_md.hpte_updatepp = ps3_hpte_updatepp;
197 ppc_md.hpte_updateboltedpp = ps3_hpte_updateboltedpp;
198 ppc_md.hpte_insert = ps3_hpte_insert;
199 ppc_md.hpte_remove = ps3_hpte_remove;
200 ppc_md.hpte_clear_all = ps3_hpte_clear;