Patchwork [2/8] KVM: PPC: Only WARN on invalid emulation

login
register
mail settings
Submitter Alexander Graf
Date Jan. 10, 2013, 12:45 p.m.
Message ID <1357821912-24922-3-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/210994/
State New
Headers show

Comments

Alexander Graf - Jan. 10, 2013, 12:45 p.m.
When we hit an emulation result that we didn't expect, that is an error,
but it's nothing that warrants a BUG(), because it can be guest triggered.

So instead, let's only WARN() the user that this happened.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/kvm/powerpc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index be83fca..e2225e5 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -237,7 +237,8 @@  int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu)
 		r = RESUME_HOST;
 		break;
 	default:
-		BUG();
+		WARN_ON(1);
+		r = RESUME_GUEST;
 	}
 
 	return r;