From patchwork Wed May 19 21:16:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Gamal X-Patchwork-Id: 101064 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 o4JLGVbK022953 for ; Wed, 19 May 2010 21:16:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751390Ab0ESVQ3 (ORCPT ); Wed, 19 May 2010 17:16:29 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]:40493 "EHLO mail-ww0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353Ab0ESVQ3 (ORCPT ); Wed, 19 May 2010 17:16:29 -0400 Received: by wwb18 with SMTP id 18so63184wwb.19 for ; Wed, 19 May 2010 14:16:27 -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=rJfLTK2uTmfhoVk0NpdY951R4rEfpul353R9Q27yTFE=; b=d14MoqsB07oDUZx0T7e6UpWz6TfasH2hdJVUkcYepIt0uCA2+5ulXzp460TopSjnVJ 5bf0io2sitblofFC7aN+vkCe4VB1IlBjpQ0zAfyrcnqNT1o5C+uJw+h3XX1JHN35UMbM wD9ABOxMOO/7f1TjxSSae5Ibj/C5IinxUOpnM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=t9abVm+tORFqMz320fRVgsQz2/7W9xzAeusCvvKZG98WTpm3+fxhhR+5P8ZBKB+6l9 UudRWz90RE8KoIxf6/+XH0UMrbPhXni6k/TxfZssq6mf88BYV2E74Y5LxZHhK43lUneO 7OqWtPHnvCemyVMxZSp/nMP2zpMc8AMefFDv8= Received: by 10.216.158.1 with SMTP id p1mr5537494wek.202.1274303787778; Wed, 19 May 2010 14:16:27 -0700 (PDT) Received: from localhost ([41.239.69.139]) by mx.google.com with ESMTPS id k13sm3370418wed.23.2010.05.19.14.16.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 19 May 2010 14:16:27 -0700 (PDT) From: Mohammed Gamal To: avi@redhat.com Cc: mtosatti@redhat.com, anthony@codemonkey.ws, kvm@vger.kernel.org, Mohammed Gamal Subject: [PATCH] Print a user-friendly message on failed vmentry Date: Thu, 20 May 2010 00:16:22 +0300 Message-Id: <1274303782-21497-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]); Wed, 19 May 2010 21:16:31 +0000 (UTC) diff --git a/qemu-kvm.c b/qemu-kvm.c index 35a4c8a..deb4df8 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -106,6 +106,20 @@ static int handle_unhandled(uint64_t reason) return -EINVAL; } +static int handle_failed_vmentry(uint64_t reason) +{ + fprintf(stderr, "kvm: vm entry failed with error 0x%" PRIx64 "\n\n", reason); + fprintf(stderr, "If you're runnning a guest on an Intel machine, it can be\n"); + fprintf(stderr, "most-likely due to the guest going into an invalid state\n"); + fprintf(stderr, "for Intel VT. For example, the guest maybe running in big\n"); + fprintf(stderr, "real mode which is not supported by Intel VT.\n\n"); + fprintf(stderr, "You may want to try enabling real mode emulation in KVM.\n"); + fprintf(stderr, "To Enable it, you may run the following commands as root:\n"); + fprintf(stderr, "# rmmod kvm_intel\n"); + fprintf(stderr, "# rmmod kvm\n"); + fprintf(stderr, "# modprobe kvm_intel emulate_invalid_guest_state=1\n"); + return -EINVAL; +} static inline void set_gsi(kvm_context_t kvm, unsigned int gsi) { @@ -586,7 +600,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,