KVM: PPC: Be more informative on BUG
We have a condition in the ppc64 host mmu code that should never occur. Unfortunately, it just did happen to me and I was rather puzzled on why, because BUG_ON doesn't tell me anything useful. So let's add some more debug output in case this goes wrong. Also change BUG to WARN, since I don't want to reboot every time I mess something up. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
6fc5582580
commit
ac21467182
1 changed files with 8 additions and 2 deletions
|
@ -231,10 +231,16 @@ int kvmppc_mmu_map_page(struct kvm_vcpu *vcpu, struct kvmppc_pte *orig_pte)
|
||||||
vcpu->arch.mmu.esid_to_vsid(vcpu, orig_pte->eaddr >> SID_SHIFT, &vsid);
|
vcpu->arch.mmu.esid_to_vsid(vcpu, orig_pte->eaddr >> SID_SHIFT, &vsid);
|
||||||
map = find_sid_vsid(vcpu, vsid);
|
map = find_sid_vsid(vcpu, vsid);
|
||||||
if (!map) {
|
if (!map) {
|
||||||
kvmppc_mmu_map_segment(vcpu, orig_pte->eaddr);
|
ret = kvmppc_mmu_map_segment(vcpu, orig_pte->eaddr);
|
||||||
|
WARN_ON(ret < 0);
|
||||||
map = find_sid_vsid(vcpu, vsid);
|
map = find_sid_vsid(vcpu, vsid);
|
||||||
}
|
}
|
||||||
BUG_ON(!map);
|
if (!map) {
|
||||||
|
printk(KERN_ERR "KVM: Segment map for 0x%llx (0x%lx) failed\n",
|
||||||
|
vsid, orig_pte->eaddr);
|
||||||
|
WARN_ON(true);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
vsid = map->host_vsid;
|
vsid = map->host_vsid;
|
||||||
va = hpt_va(orig_pte->eaddr, vsid, MMU_SEGSIZE_256M);
|
va = hpt_va(orig_pte->eaddr, vsid, MMU_SEGSIZE_256M);
|
||||||
|
|
Loading…
Add table
Reference in a new issue