All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Lucina <martin@lucina.net>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: "Jürgen Groß" <jgross@suse.com>,
	anil@recoil.org, "Andrew Cooper" <andrew.cooper3@citrix.com>,
	mirageos-devel@lists.xenproject.org, dave@recoil.org,
	xen-devel@lists.xenproject.org
Subject: Re: Xen PVH domU start-of-day VCPU state
Date: Tue, 26 May 2020 12:08:06 +0200	[thread overview]
Message-ID: <20200526100806.GD5942@nodbug.lucina.net> (raw)
In-Reply-To: <20200526093421.GA38408@Air-de-Roger>

On Tuesday, 26.05.2020 at 11:34, Roger Pau Monné wrote:
> On Tue, May 26, 2020 at 10:52:21AM +0200, Martin Lucina wrote:
> > On Monday, 25.05.2020 at 17:59, Andrew Cooper wrote:
> > > On 25/05/2020 17:42, Jürgen Groß wrote:
> > > > You need to setup virtual addressing and enable 64 bit mode before using
> > > > 64-bit GDT.
> > > >
> > > > See Mini-OS source arch/x86/x86_hvm.S
> > > 
> > > Or
> > > https://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen-test-framework.git;a=blob;f=arch/x86/hvm/head.S;h=f7dc72b58ab9ec68538f0087969ab6f72d181d80;hb=HEAD
> > > 
> > > But yes - Juergen is correct.  Until you have enabled long mode, lgdt
> > > will only load the bottom 32 bits of GDTR.base.
> > 
> > Ah, I missed Jurgen's and your reply here.
> > 
> > LGDT loading only the bottom 32 bits of GDTR.base shouldn't matter.
> > Examining gdt_ptr some more:
> > 
> >     (gdb) set architecture i386
> >     The target architecture is assumed to be i386
> >     (gdb) x /xh 0x108040
> >     0x108040:	0x002f
> >     (gdb) x /xw 0x108042
> >     0x108042:	0x00108000
> >     (gdb) x /6xb 0x108040
> >     0x108040:	0x2f	0x00	0x00	0x80	0x10	0x00
> >     (gdb) x /8xb 0x108040
> >     0x108040:	0x2f	0x00	0x00	0x80	0x10	0x00	0x00	0x00
> 
> Could you also print the GDT entry at 0x10 (ie: 0x108000 + 0x10), just
> to make sure it contains the right descriptor?

I triple-checked that on Friday, but here you go:

    (gdb) x /xg 0x108010
    0x108010:	0x00cf9b000000ffff
    (gdb) x /tg 0x108010
    0x108010:	0000000011001111100110110000000000000000000000001111111111111111

Translates to:

base_31_24 = { 0 }
g = 1 (4 kB)
b = 1 (32-bit)
l = 0 (32-bit)
avl = 0
limit_19_16 = { 1 }
p = 1
dpl = 0
s = 1
type = 1011 (code, exec/read, accessed)
base23_16 = { 0 }
base15_0 = { 0 }
limit_15_0 = { 1 }

type should technically not include accessed, but that shouldn't matter.
In any case, changing it to 1010 does not help.

Looks like I'll have to build a patched Xen as per Andrew's suggestion, and
dump the VMCS on the triple fault.

-mato


  parent reply	other threads:[~2020-05-26 10:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25 16:04 Xen PVH domU start-of-day VCPU state Martin Lucina
2020-05-25 16:42 ` Jürgen Groß
2020-05-25 16:59   ` Andrew Cooper
2020-05-26  8:52     ` Martin Lucina
2020-05-26  9:34       ` Roger Pau Monné
2020-05-26 10:03         ` Roger Pau Monné
2020-05-26 10:12           ` Martin Lucina
2020-05-26 10:32             ` Roger Pau Monné
2020-05-26 15:42             ` Martin Lucina
2020-05-26 16:30               ` Roger Pau Monné
2020-05-27  8:00                 ` Martin Lucina
2020-05-27 14:41                   ` Roger Pau Monné
2020-05-27 14:57                     ` Martin Lucina
2020-05-27 15:05                       ` Roger Pau Monné
2020-05-26 10:08         ` Martin Lucina [this message]
2020-05-26 10:58       ` Andrew Cooper
2020-05-26 11:54         ` Mail-Followup-To (was Re: Xen PVH domU start-of-day VCPU state) Martin Lucina
2020-05-26 11:58           ` Andrew Cooper
2020-05-26 12:41             ` Martin Lucina
2020-05-26 12:42               ` Andrew Cooper
2020-05-26 12:44                 ` Martin Lucina
2020-05-25 17:41 ` Xen PVH domU start-of-day VCPU state Andrew Cooper
2020-05-26  8:27   ` Martin Lucina

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=20200526100806.GD5942@nodbug.lucina.net \
    --to=martin@lucina.net \
    --cc=andrew.cooper3@citrix.com \
    --cc=anil@recoil.org \
    --cc=dave@recoil.org \
    --cc=jgross@suse.com \
    --cc=mirageos-devel@lists.xenproject.org \
    --cc=roger.pau@citrix.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.