From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: [PATCH 2/4] KVM: PPC: Only WARN on invalid emulation Date: Tue, 18 Dec 2012 16:54:15 -0600 Message-ID: <1355871255.5138.2@snotra> References: <1355834323-27592-3-git-send-email-agraf@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; delsp=Yes; format=Flowed Content-Transfer-Encoding: 8BIT Cc: , KVM list , Marcelo Tosatti , Gleb Natapov To: Alexander Graf Return-path: Received: from tx2ehsobe001.messaging.microsoft.com ([65.55.88.11]:18073 "EHLO tx2outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751233Ab2LRWyZ convert rfc822-to-8bit (ORCPT ); Tue, 18 Dec 2012 17:54:25 -0500 In-Reply-To: <1355834323-27592-3-git-send-email-agraf@suse.de> (from agraf@suse.de on Tue Dec 18 06:38:41 2012) Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On 12/18/2012 06:38:41 AM, Alexander Graf wrote: > 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 > --- > arch/powerpc/kvm/powerpc.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > 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; Do you have a specific way of a guest triggering this in mind, or is it just being cautious? The guest probably shouldn't be allowed to spam the kernel log with WARNs either. Is a traceback even useful here? -Scott