> @@ -222,6 +130,7 @@ int kvmppc_emulate_instruction(struct kv > int rc; > int rs; > int rt; > + int ws; > int sprn; > int dcrn; > enum emulation_result emulated = EMULATE_DONE; > @@ -630,33 +539,18 @@ int kvmppc_emulate_instruction(struct kv > break; > > case 978: > /* tlbwe */ > - emulated = kvmppc_emul_tlbwe(vcpu, inst); > + ra = get_ra(inst); > + rs = get_rs(inst); > + ws = get_ws(inst); > + emulated = kvmppc_emul_tlbwe(vcpu, ra, rs, ws); > break; E500 has no argument in instructions tlbwe and tlbsx, different from 44x. So ra, rs, ws are redundant to e500. Maybe we can keep the old interface: kvmppc_emul_tlbwe(vcpu, inst), kvmppc_emul_tlbsx(vcpu, inst) and move instruction operations get_ra(), get_rs(), get_ws() etc. to a header file. What do you think about it? > > - case 914: { > /* tlbsx */ > - int index; > - unsigned int as = get_mmucr_sts(vcpu); > - unsigned int pid = get_mmucr_stid(vcpu); > - > + case 914: > /* tlbsx */ > rt = get_rt(inst); > ra = get_ra(inst); > rb = get_rb(inst); > rc = get_rc(inst); > - > - ea = vcpu->arch.gpr[rb]; > - if (ra) > - ea += vcpu->arch.gpr[ra]; > - > - index = kvmppc_44x_tlb_index(vcpu, ea, pid, as); > - if (rc) { > - if (index < 0) > - vcpu->arch.cr &= ~0x20000000; > - else > - vcpu->arch.cr |= 0x20000000; > - } > - vcpu->arch.gpr[rt] = index; > - > - } > + emulated = kvmppc_emul_tlbsx(vcpu, rt, > ra, rb, rc); > break; > > case 790: > /* lhbrx */ > -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html