From patchwork Sun Jun 6 11:10:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Gamal X-Patchwork-Id: 104541 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o56BBNuk026801 for ; Sun, 6 Jun 2010 11:11:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756174Ab0FFLLV (ORCPT ); Sun, 6 Jun 2010 07:11:21 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:42820 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755311Ab0FFLLU (ORCPT ); Sun, 6 Jun 2010 07:11:20 -0400 Received: by wyi11 with SMTP id 11so1765296wyi.19 for ; Sun, 06 Jun 2010 04:11:19 -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; bh=KIfpCO70pQJu6zCVbpUMOiflbYm7UdDd2AwPWhUZvSM=; b=OcjbXaVEJSAoSU9Z54sA8wNIdnmshYtq3Z0iZZn0dKbTKJgmjEPUT2lieGvz4EOHKc 9fWvvUytvR1dhCZ6Vk4uC6RUaEbEaqcdrSrJA1MqVb6l0LbhocNtqXfroORYYrAsR3vX 1DjcyElYCujveniNTFTB3aV/TqCht0zBKbZUs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=Zc/BC3avVKi6GfGGT/QWvFZtw2/0QvknVjQ4sqbbgt0tf5qaY5blDNfNaVcEGUotSs CfV1pE3VPIzQvF61ca6LyOdFh6q4kgk4rQpSu6RmtCh+FLLUjW6biVr2MXvLenZnEKDm T/FBsfeTyx6IaMUdysewV0L622C+qg2n975sM= Received: by 10.227.151.138 with SMTP id c10mr2171481wbw.219.1275822679551; Sun, 06 Jun 2010 04:11:19 -0700 (PDT) Received: from localhost ([41.238.105.61]) by mx.google.com with ESMTPS id z33sm27844983wbd.1.2010.06.06.04.11.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 06 Jun 2010 04:11:17 -0700 (PDT) From: Mohammed Gamal To: avi@redhat.com Cc: mtosatti@redhat.com, anthony@codemonkey.ws, ryanh@us.ibm.com, kvm@vger.kernel.org, Mohammed Gamal Subject: [PATCH] Print a user-friendly message on failed vmentry Date: Sun, 6 Jun 2010 14:10:16 +0300 Message-Id: <1275822616-5042-1-git-send-email-m.gamal005@gmail.com> X-Mailer: git-send-email 1.7.0.4 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, 06 Jun 2010 11:11:23 +0000 (UTC) diff --git a/qemu-kvm.c b/qemu-kvm.c index 9534b31..1a66f55 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -106,6 +106,24 @@ static int handle_unhandled(uint64_t reason) return -EINVAL; } +#define VMX_INVALID_GUEST_STATE 0x80000021 + +static int handle_failed_vmentry(uint64_t reason) +{ + fprintf(stderr, "kvm: vm entry failed with error 0x%" PRIx64 "\n\n", reason); + + /* Perhaps we will need to check if this machine is intel since exit reason 0x21 + has a different interpretation on SVM */ + if (reason == VMX_INVALID_GUEST_STATE) { + fprintf(stderr, "If you're runnning a guest on an Intel machine without\n"); + fprintf(stderr, "unrestricted mode support, the failure can be most likely\n"); + fprintf(stderr, "due to the guest entering an invalid state for Intel VT.\n"); + fprintf(stderr, "For example, the guest maybe running in big real mode\n"); + fprintf(stderr, "which is not supported on less recent Intel processors.\n\n"); + } + + return -EINVAL; +} static inline void set_gsi(kvm_context_t kvm, unsigned int gsi) { @@ -586,7 +604,7 @@ int kvm_run(CPUState *env) r = handle_unhandled(run->hw.hardware_exit_reason); break; case KVM_EXIT_FAIL_ENTRY: - r = handle_unhandled(run->fail_entry.hardware_entry_failure_reason); + r = handle_failed_vmentry(run->fail_entry.hardware_entry_failure_reason); break; case KVM_EXIT_EXCEPTION: fprintf(stderr, "exception %d (%x)\n", run->ex.exception,