From patchwork Fri Aug 28 14:48:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Gamal X-Patchwork-Id: 44516 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7SEn3Ww020061 for ; Fri, 28 Aug 2009 14:49:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751848AbZH1Os7 (ORCPT ); Fri, 28 Aug 2009 10:48:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751858AbZH1Os7 (ORCPT ); Fri, 28 Aug 2009 10:48:59 -0400 Received: from mail-fx0-f217.google.com ([209.85.220.217]:44403 "EHLO mail-fx0-f217.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751839AbZH1Os6 (ORCPT ); Fri, 28 Aug 2009 10:48:58 -0400 Received: by mail-fx0-f217.google.com with SMTP id 17so1616063fxm.37 for ; Fri, 28 Aug 2009 07:49:00 -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=Av1oNfvwF2AV8MLv3nWBDSRHqodJNsEllitKjKpDv9M=; b=CM2ABGkn+83DiHW/KzRKHb2WJIXDUFT8OE5CGo013tpmN8/6s1ONsk/cuMKXv+rdVq hkCAjAGZl2vuHjubXRtr+cZIzwxu02moQWyym/tBjCMTCnN4p7hGP7pf2dsXWeoUlnTo EdWnmNblqxkdBvPoYI7UWW5GqKqZXeNoKLGBE= 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=YTxUbG7t3eJp9KgB2gNe+I54AHyxZtyPct8hUAC+Vi9Xp0hiuW4RBfdn4dNS4iGHfY j8yEOfJipamMZDE4jk+2LvNKOQt5GjOlbawggcJT3wdA5ucLE1zSzmFR8KrpJK56py6R QuXdLj2wEsEs+i4I5Awr1q74/PYFH0JYV+Zro= Received: by 10.102.197.11 with SMTP id u11mr330876muf.97.1251470940531; Fri, 28 Aug 2009 07:49:00 -0700 (PDT) Received: from localhost ([41.237.159.104]) by mx.google.com with ESMTPS id u9sm5592124muf.37.2009.08.28.07.48.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 28 Aug 2009 07:49:00 -0700 (PDT) From: Mohammed Gamal To: avi@redhat.com Cc: kvm@vger.kernel.org, Mohammed Gamal Subject: [PATCH 2/2] Handle emulation failure in userspace Date: Fri, 28 Aug 2009 16:48:53 +0200 Message-Id: <1251470933-14500-2-git-send-email-m.gamal005@gmail.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1251470933-14500-1-git-send-email-m.gamal005@gmail.com> References: <1251470933-14500-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 Since we return to userspace from KVM on invalid state emulation failure, let qemu handle it. Signed-off-by: Mohammed Gamal --- qemu-kvm.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/qemu-kvm.c b/qemu-kvm.c index b59e403..a1648e0 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1029,6 +1029,14 @@ int kvm_run(kvm_vcpu_context_t vcpu, void *env) r = kvm_s390_handle_reset(kvm, vcpu, run); break; #endif + case KVM_EXIT_INTERNAL_ERROR: + kvm_show_regs(vcpu); + fprintf(stderr, "\nKVM internal error. Suberror: %d\n", + run->internal.suberror); + if (run->internal.suberror == KVM_INTERNAL_ERROR_EMULATION) + fprintf(stderr, "emulation failure, check dmesg for details\n"); + abort(); + break; default: if (kvm_arch_run(vcpu)) { fprintf(stderr, "unhandled vm exit: 0x%x\n", run->exit_reason);