From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mohammed Gamal Subject: Re: [PATCH][RESEND] Print a user-friendly message on failed vmentry Date: Tue, 1 Jun 2010 13:55:57 +0300 Message-ID: References: <1275334818-6064-1-git-send-email-m.gamal005@gmail.com> <4C04CC07.1000707@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: mtosatti@redhat.com, anthony@codemonkey.ws, ryanh@us.ibm.com, kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mail-fx0-f46.google.com ([209.85.161.46]:37684 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751783Ab0FAKz7 convert rfc822-to-8bit (ORCPT ); Tue, 1 Jun 2010 06:55:59 -0400 Received: by fxm8 with SMTP id 8so797509fxm.19 for ; Tue, 01 Jun 2010 03:55:58 -0700 (PDT) In-Reply-To: <4C04CC07.1000707@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jun 1, 2010 at 11:59 AM, Avi Kivity wrote: > On 05/31/2010 10:40 PM, Mohammed Gamal wrote: >> >> This patch address bug report in >> https://bugs.launchpad.net/qemu/+bug/530077. >> >> Failed vmentries were handled with handle_unhandled() which prints a >> rather >> unfriendly message to the user. This patch separates handling vmentr= y >> failures >> from unknown exit reasons and prints a friendly message to the user. >> >> >> >> +#define VMX_INVALID_GUEST_STATE 0x80000021 >> + >> +static int handle_failed_vmentry(uint64_t reason) >> +{ >> + =A0 =A0fprintf(stderr, "kvm: vm entry failed with error 0x%" PRIx6= 4 "\n\n", >> reason); >> + >> + =A0 =A0/* Perhaps we will need to check if this machine is intel s= ince exit >> reason 0x21 >> + =A0 =A0 =A0 has a different interpretation on SVM */ >> + =A0 =A0if (reason =3D=3D VMX_INVALID_GUEST_STATE) { >> + =A0 =A0 =A0 =A0fprintf(stderr, "If you're runnning a guest on an I= ntel machine >> without\n"); >> + =A0 =A0 =A0 =A0fprintf(stderr, "unrestricted mode support, the fai= lure can be >> most likely\n"); >> + =A0 =A0 =A0 =A0fprintf(stderr, "due to the guest entering an inval= id state for >> Intel VT.\n"); >> + =A0 =A0 =A0 =A0fprintf(stderr, "For example, the guest maybe runni= ng in big real >> mode\n"); >> + =A0 =A0 =A0 =A0fprintf(stderr, "which is not supported on less rec= ent Intel >> processors.\n\n"); >> + =A0 =A0 =A0 =A0fprintf(stderr, "You may want to try enabling KVM r= eal mode >> emulation. To\n"); >> + =A0 =A0 =A0 =A0fprintf(stderr, "enable it, you can run the followi= ng commands as >> root:\n"); >> + =A0 =A0 =A0 =A0fprintf(stderr, "# rmmod kvm_intel\n"); >> + =A0 =A0 =A0 =A0fprintf(stderr, "# rmmod kvm\n"); >> + =A0 =A0 =A0 =A0fprintf(stderr, "# modprobe kvm_intel >> emulate_invalid_guest_state=3D1\n\n"); >> + =A0 =A0 =A0 =A0fprintf(stderr, "WARNING: Real mode emulation is st= ill >> work-in-progress\n"); >> + =A0 =A0 =A0 =A0fprintf(stderr, "and thus it is not always guarante= ed to >> work.\n\n"); >> + =A0 =A0} >> + >> + =A0 =A0return -EINVAL; >> +} >> >> > > It's almost guaranteed to fail, isn't it? =A0Is there any guest which= fails > with emulated_invalid_guest_state=3D0 but works with e_i_g_s=3D1? > You're right! Perhaps I should remove the e_i_g_s bit from the message. What do you think? > -- > error compiling committee.c: too many arguments to function > >