All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Brannon <cmb@prgmr.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Sarah Newman <srn@prgmr.com>, Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Crash with nested HVM and Linux v5.1+
Date: Wed, 02 Oct 2019 13:55:44 -0700	[thread overview]
Message-ID: <87pnje50kv.fsf@cmbmachine.messageid.invalid> (raw)
In-Reply-To: <e05593f6-f223-2c7d-d607-ea76c9204f17@citrix.com> (Andrew Cooper's message of "Wed, 2 Oct 2019 18:41:32 +0100")

Andrew Cooper <andrew.cooper3@citrix.com> writes:

> (XEN) traps.c:1576: GPF (0000): ffff82d08031a80f [vmx.c#vmx_msr_read_intercept+0x387/0x3fd] -> ffff82d08037c9f2
> (XEN) traps.c:1576: GPF (0000): ffff82d08031a80f [vmx.c#vmx_msr_read_intercept+0x387/0x3fd] -> ffff82d08037c9f2
> (d2) xs_write(/vm/95f11fc0-b9e7-47ff-8523-bacab35b96b6/rtc/timeoffset): EACCES
> (XEN) d1v1 Unhandled nested vmexit: reason 51
> (XEN) domain_crash called from vvmx.c:2671
> (XEN) Domain 1 (vcpu#1) crashed on cpu#2:
>
> 51 is the RDTSCP intercept.  It seems that noone has ever tried executing a
> RDTSCP instruction in nested virt yet... which goes to show how untested this
> all is.
>
> Can you see about giving this patch a spin?
>
> ~Andrew
>
> diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
> index fdf449bfd1..6696bd6240 100644
> --- a/xen/arch/x86/hvm/vmx/vvmx.c
> +++ b/xen/arch/x86/hvm/vmx/vvmx.c
> @@ -2491,6 +2491,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
>              nvcpu->nv_vmexit_pending = 1;
>          break;
>      case EXIT_REASON_RDTSC:
> +    case EXIT_REASON_RDTSCP:
>          ctrl = __n2_exec_control(v);
>          if ( ctrl & CPU_BASED_RDTSC_EXITING )
>              nvcpu->nv_vmexit_pending = 1;
> @@ -2501,6 +2502,8 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
>               * avoiding changing guest_tsc and messing up timekeeping in L1
>               */
>              msr_split(regs, hvm_get_guest_tsc(v) + get_vvmcs(v,
> TSC_OFFSET));
> +            if ( exit_reason == EXIT_REASON_RDTSCP )
> +                regs->rcx = v->arch.msrs->tsc_aux;
>              update_guest_eip();
>  
>              return 1;

Hi Andrew,
This patch works for me.  The L2 domU boots successfully.

Thank you!

-- Chris

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

      reply	other threads:[~2019-10-02 20:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <aecc7e18-40ff-8bb8-467c-24bfe99ee8f1@prgmr.com>
     [not found] ` <470f5ce1-d43f-a5dd-a00d-e2ec339b06c0@suse.com>
2019-10-02 16:50   ` [Xen-devel] Crash with nested HVM and Linux v5.1+ Chris Brannon
2019-10-02 17:41     ` Andrew Cooper
2019-10-02 20:55       ` Chris Brannon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pnje50kv.fsf@cmbmachine.messageid.invalid \
    --to=cmb@prgmr.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=srn@prgmr.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.