From patchwork Sun Aug 8 18:11:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Gamal X-Patchwork-Id: 118288 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o78IBwYi016942 for ; Sun, 8 Aug 2010 18:11:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753784Ab0HHSL4 (ORCPT ); Sun, 8 Aug 2010 14:11:56 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:65533 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753553Ab0HHSL4 (ORCPT ); Sun, 8 Aug 2010 14:11:56 -0400 Received: by wyb39 with SMTP id 39so9255684wyb.19 for ; Sun, 08 Aug 2010 11:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=4QXmTaGD7P54CLX27ZPGv+k6+I+X3rBksSM17Hhve8M=; b=aUoRhqR2vMQuEyf+2LRMLh8SOb1uLynqufSq3NpVeMOxEfoWCWlKgBe/x0APXI1YiL drCgz7rq0RY5W8mlNjog1mDqtlZqHLGIuMkT5L+7xVJzE4L9W697urcquh5BXsv6xOJP f44uT+tOEdJ7+SLC5AHjaJXY5xn5w6wtNW/bM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=RynuzRniv4ep2JobTqVfmyPfKNU8cogr2A+i+snIyWaW0L80De023WWKXMFvv8r87B vCEwZdU16fUB6EP+9Fu7IJUKywx92vDmMuz0Ugc7DwPP7qL+SYomhPV8nwbuM80F7dCi uR1wwmRgPsM2Zwo8Lo8FkcNlJKkuw2jzBj6Xk= Received: by 10.227.138.5 with SMTP id y5mr12844526wbt.204.1281291114564; Sun, 08 Aug 2010 11:11:54 -0700 (PDT) Received: from localhost.localdomain ([188.48.101.98]) by mx.google.com with ESMTPS id u11sm2093508weq.31.2010.08.08.11.11.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Aug 2010 11:11:54 -0700 (PDT) From: Mohammed Gamal To: avi@redhat.com Cc: mtosatti@redhat.com, kvm@vger.kernel.org, Mohammed Gamal Subject: [PATCH v2 2/2] x86 emulator: Fix emulate_grp3 return values Date: Sun, 8 Aug 2010 21:11:38 +0300 Message-Id: <1281291098-4658-2-git-send-email-m.gamal005@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1281291098-4658-1-git-send-email-m.gamal005@gmail.com> References: <1281291098-4658-1-git-send-email-m.gamal005@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 08 Aug 2010 18:11:58 +0000 (UTC) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 790f700..32498e3 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -1405,9 +1405,9 @@ static inline int emulate_grp3(struct x86_emulate_ctxt *ctxt, emulate_1op_rax_rdx("idiv", c->src, *rax, *rdx, ctxt->eflags); break; default: - return 0; + return X86EMUL_UNHANDLEABLE; } - return 1; + return X86EMUL_CONTINUE; } static inline int emulate_grp45(struct x86_emulate_ctxt *ctxt, @@ -3158,7 +3158,7 @@ special_insn: ctxt->eflags ^= EFLG_CF; break; case 0xf6 ... 0xf7: /* Grp3 */ - if (!emulate_grp3(ctxt, ops)) + if (emulate_grp3(ctxt, ops) != X86EMUL_CONTINUE) goto cannot_emulate; break; case 0xf8: /* clc */