16 #include <linux/slab.h>
18 #include <linux/export.h>
21 #include <asm/cputable.h>
22 #include <asm/tlbflush.h>
45 WARN_ONCE(1,
"%s: unknown int type %d\n", __func__, type);
52 ppc_msgsnd(dbell_type, 0, tag);
64 ts = get_tlb_ts(gtlbe);
65 tid = get_tlb_tid(gtlbe);
66 lpid = vcpu_e500->
vcpu.kvm->arch.lpid;
69 val = (tid << 16) | ts;
70 eaddr = get_tlb_eaddr(gtlbe);
74 mtspr(SPRN_MAS6, val);
77 asm volatile(
"tlbsx 0, %[eaddr]\n" : : [eaddr]
"r" (eaddr));
78 val =
mfspr(SPRN_MAS1);
80 mtspr(SPRN_MAS1, val & ~MAS1_VALID);
81 asm volatile(
"tlbwe");
97 asm volatile(
"tlbilxlpid");
117 mtspr(SPRN_LPID, vcpu->
kvm->arch.lpid);
118 mtspr(SPRN_EPCR, vcpu->
arch.shadow_epcr);
120 mtspr(SPRN_MSRP, vcpu->
arch.shadow_msrp);
127 mtspr(SPRN_GSPRG0, (
unsigned long)vcpu->
arch.shared->sprg0);
128 mtspr(SPRN_GSPRG1, (
unsigned long)vcpu->
arch.shared->sprg1);
129 mtspr(SPRN_GSPRG2, (
unsigned long)vcpu->
arch.shared->sprg2);
130 mtspr(SPRN_GSPRG3, (
unsigned long)vcpu->
arch.shared->sprg3);
132 mtspr(SPRN_GSRR0, vcpu->
arch.shared->srr0);
133 mtspr(SPRN_GSRR1, vcpu->
arch.shared->srr1);
136 mtspr(SPRN_GDEAR, vcpu->
arch.shared->dar);
137 mtspr(SPRN_GESR, vcpu->
arch.shared->esr);
142 kvmppc_load_guest_fp(vcpu);
150 vcpu->
arch.shared->sprg0 =
mfspr(SPRN_GSPRG0);
151 vcpu->
arch.shared->sprg1 =
mfspr(SPRN_GSPRG1);
152 vcpu->
arch.shared->sprg2 =
mfspr(SPRN_GSPRG2);
153 vcpu->
arch.shared->sprg3 =
mfspr(SPRN_GSPRG3);
155 vcpu->
arch.shared->srr0 =
mfspr(SPRN_GSRR0);
156 vcpu->
arch.shared->srr1 =
mfspr(SPRN_GSRR1);
159 vcpu->
arch.shared->dar =
mfspr(SPRN_GDEAR);
160 vcpu->
arch.shared->esr =
mfspr(SPRN_GESR);
185 vcpu->
arch.shadow_epcr = SPRN_EPCR_DSIGS | SPRN_EPCR_DGTMI | \
188 vcpu->
arch.shadow_epcr |= SPRN_EPCR_ICM;
190 vcpu->
arch.shadow_msrp = MSRP_UCLEP | MSRP_DEP | MSRP_PMMP;
191 vcpu->
arch.eplc = EPC_EGS | (vcpu->
kvm->arch.lpid << EPC_ELPID_SHIFT);
210 sregs->
u.
e.impl.fsl.features = 0;
211 sregs->
u.
e.impl.fsl.svr = vcpu_e500->
svr;
212 sregs->
u.
e.impl.fsl.hid0 = vcpu_e500->
hid0;
213 sregs->
u.
e.impl.fsl.mcar = vcpu_e500->
mcar;
217 sregs->
u.
e.ivor_high[3] =
231 vcpu_e500->
svr = sregs->
u.
e.impl.fsl.svr;
232 vcpu_e500->
hid0 = sregs->
u.
e.impl.fsl.hid0;
233 vcpu_e500->
mcar = sregs->
u.
e.impl.fsl.mcar;
245 sregs->
u.
e.ivor_high[3];
250 sregs->
u.
e.ivor_high[4];
252 sregs->
u.
e.ivor_high[5];
269 vcpu = &vcpu_e500->
vcpu;
272 vcpu->
arch.oldpir = 0xffffffff;
283 if (!vcpu->
arch.shared)
317 kvm->
arch.lpid = lpid;
326 static int __init kvmppc_e500mc_init(
void)
340 static void __exit kvmppc_e500mc_exit(
void)