LKML Archive on
help / color / mirror / Atom feed
From: "Jan Beulich" <>
To: "Boris Ostrovsky" <>
Cc: "xen-devel" <>,
	"Juergen Gross" <>, <>
Subject: Re: [PATCH v3 1/2] xen/PVH: Set up GS segment for stack canary
Date: Fri, 18 May 2018 01:31:32 -0600	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

>>> On 17.05.18 at 19:47, <> wrote:
> On 05/17/2018 11:02 AM, Jan Beulich wrote:
>>>>> On 17.05.18 at 16:47, <> wrote:
>>> @@ -64,6 +67,9 @@ ENTRY(pvh_start_xen)
>>>  	mov %eax,%es
>>>  	mov %eax,%ss
>>> +	mov $PVH_CANARY_SEL,%eax
>>> +	mov %eax,%gs
>> I doubt this is needed for 64-bit (you could equally well load zero or leave
>> in place what's there in that case),
> I don't understand this.

The actual selector value doesn't matter on 64-bit. Hence you could
omit the load altogether, or you could use plain zero. No need for the
(non-zero) selector, or (by implication) the GDT descriptor.

>>  and loading the selector before setting
>> the base address in the descriptor won't have the intended effect.
> I wasn't sure about this either but then I noticed that
> secondary_startup_64() does it in the same order (although not using the
> MSR).

Well, for one they load a null selector, which is independent of setting up
any GDT descriptors. I also don't understand why you say "although not
using the MSR" when they clearly do. And then, as said above (and also
in a comment in secondary_startup_64()), the actual selector value (and
when / if at all it is loaded) doesn't matter on 64-bit. The ordering does
matter on 32-bit though.


  reply	other threads:[~2018-05-18  7:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 14:47 [PATCH v3 0/2] PVH GDT fixes Boris Ostrovsky
2018-05-17 14:47 ` [PATCH v3 1/2] xen/PVH: Set up GS segment for stack canary Boris Ostrovsky
2018-05-17 15:02   ` Jan Beulich
2018-05-17 17:47     ` Boris Ostrovsky
2018-05-18  7:31       ` Jan Beulich [this message]
2018-05-17 14:47 ` [PATCH v3 2/2] xen/PVH: Make GDT selectors PVH-specific Boris Ostrovsky

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:

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

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH v3 1/2] xen/PVH: Set up GS segment for stack canary' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).