All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Julien Grall <julien.grall@arm.com>
Subject: Re: [PATCH] x86/HVM: correct notion of new CPL in task switch emulation
Date: Fri, 2 Jun 2017 21:33:16 +0100	[thread overview]
Message-ID: <33f5ac81-3aac-1090-de90-5b08222c4980@citrix.com> (raw)
In-Reply-To: <4397a7ed-a6c5-375a-1abf-9a3b0212e4ec@citrix.com>

On 02/06/17 21:02, Andrew Cooper wrote:
> On 01/06/17 13:11, Jan Beulich wrote:
>> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> I have finally managed to reproduce the original vmentry failure with an
> XTF test.

FWIW, the vmentry failure is quite subtle.

%es gets reloaded first.  If the new TSS uses RPL0 data selectors, the
load fails, and #TS[%es] is yielded.

(d3) Going to userspace
(XEN) ** d3v0 Inject event { v 0x02, t 2, ec ffffffff }
(XEN) ** d3v0 Inject event { v 0x0a, t 3, ec 0018 }
(XEN) ** d3v0 Inject event { v 0x0a, t 3, ec 0018 }
(XEN) d3v0 Triple fault - invoking HVM shutdown action 1
(XEN) *** Dumping Dom3 vcpu#0 state: ***
(XEN) ----[ Xen-4.10-unstable  x86_64  debug=y   Tainted:    H ]----

For some reason I haven't gotten to the bottom of yet, end up calling
__vmx_inject_exception() twice while handling the task switch path.  We
shouldn't be.

If however the TSS uses RPL3 data selectors, the %es load succeeds, then
the %cs load succeeds (rpl is 0 as this is an external interrupt
delivery).  The %ss load then fails because the old dpl is 3 (being in
userspace) but the new dpl is 0.  This then yields #TS[%ss], but the
VMCS is in a state with %cs and %ss disagreeing.

~Andrew

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

  reply	other threads:[~2017-06-02 20:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01 12:11 [PATCH] x86/HVM: correct notion of new CPL in task switch emulation Jan Beulich
2017-06-02 20:02 ` Andrew Cooper
2017-06-02 20:33   ` Andrew Cooper [this message]
2017-06-06  7:06     ` Jan Beulich
2017-06-06 10:21       ` Andrew Cooper
2017-06-06 17:14   ` Julien Grall
2017-06-05 13:06 ` Andrew Cooper
2017-06-06  6:42   ` Jan Beulich
2017-06-06 10:21     ` Andrew Cooper

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=33f5ac81-3aac-1090-de90-5b08222c4980@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=xen-devel@lists.xenproject.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.