aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-04-19 20:49:50 -0400
committerAvi Kivity <avi@redhat.com>2010-05-17 05:19:02 -0400
commitac21467182e562a71d8b4e098ea054e42700c0ff (patch)
tree814b2d6d7d11b21801be229476209bd16f156ea5 /arch/powerpc/kvm
parent6fc558258077d4e44b1780c0fd4ef93dd96c6fca (diff)
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>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r--arch/powerpc/kvm/book3s_64_mmu_host.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c
index 41af12fb1260..5545c45ea57f 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_host.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_host.c
@@ -231,10 +231,16 @@ int kvmppc_mmu_map_page(struct kvm_vcpu *vcpu, struct kvmppc_pte *orig_pte)
231 vcpu->arch.mmu.esid_to_vsid(vcpu, orig_pte->eaddr >> SID_SHIFT, &vsid); 231 vcpu->arch.mmu.esid_to_vsid(vcpu, orig_pte->eaddr >> SID_SHIFT, &vsid);
232 map = find_sid_vsid(vcpu, vsid); 232 map = find_sid_vsid(vcpu, vsid);
233 if (!map) { 233 if (!map) {
234 kvmppc_mmu_map_segment(vcpu, orig_pte->eaddr); 234 ret = kvmppc_mmu_map_segment(vcpu, orig_pte->eaddr);
235 WARN_ON(ret < 0);
235 map = find_sid_vsid(vcpu, vsid); 236 map = find_sid_vsid(vcpu, vsid);
236 } 237 }
237 BUG_ON(!map); 238 if (!map) {
239 printk(KERN_ERR "KVM: Segment map for 0x%llx (0x%lx) failed\n",
240 vsid, orig_pte->eaddr);
241 WARN_ON(true);
242 return -EINVAL;
243 }
238 244
239 vsid = map->host_vsid; 245 vsid = map->host_vsid;
240 va = hpt_va(orig_pte->eaddr, vsid, MMU_SEGSIZE_256M); 246 va = hpt_va(orig_pte->eaddr, vsid, MMU_SEGSIZE_256M);