[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/2] x86/vmx: Print the problematic MSR if a vmentry fails



>>> On 13.10.16 at 13:15, <andrew.cooper3@xxxxxxxxxx> wrote:
> Sample error looks like:
> 
>   (XEN) Failed vm entry (exit reason 0x80000022) caused by MSR loading (entry 
> 13).
>   (XEN)   msr 0000068a, val 1fff800000102af0, (mbz 0)
>   (XEN) ************* VMCS Area **************
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
with

> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -3104,8 +3104,23 @@ static void vmx_failed_vmentry(unsigned int 
> exit_reason,
>          printk("caused by invalid guest state (%ld).\n", exit_qualification);
>          break;
>      case EXIT_REASON_MSR_LOADING:
> -        printk("caused by MSR entry %ld loading.\n", exit_qualification);
> +    {
> +        unsigned long idx = exit_qualification - 1;
> +        struct vmx_msr_entry *msr;

... preferably const here (and the declaration perhaps moved into
the more narrow scope it's needed in), ...

> +        printk("caused by MSR loading (entry %ld).\n", idx);

... %lu (plus ideally the full stop dropped) here, and ...

> +        if ( idx > (PAGE_SIZE / sizeof(*msr)) )

... >= here.

> +            printk("  Entry out of range\n");
> +        else
> +        {
> +            msr = &curr->arch.hvm_vmx.msr_area[idx];
> +
> +            printk("  msr %08x, val %016"PRIx64", (mbz %#x)\n",

I'm also unsure about the usefulness of the commas here - at least
the second one seems a little strange with the value in parentheses.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.