xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: z <alfred.z.song@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: "Ian Campbell" <Ian.Campbell@citrix.com>,
	"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	ian.jackson@eu.citrix.com,
	"Zhuo Song" <songzhuo.sz@alibaba-inc.com>,
	"马涛(伯瑜)" <boyu.mt@alibaba-inc.com>,
	jinsong.liu@alibaba-inc.com, xen-devel@lists.xen.org
Subject: Re: [PATCH v2 1/2] xc_cpuid_x86.c: Simplify masking conditions and remove redundant work
Date: Tue, 9 Sep 2014 22:43:33 +0800	[thread overview]
Message-ID: <CAEzNp8asZrAVTSuse0sgM9n5y+aL2+-yOipvxX+var2m0UrOrA@mail.gmail.com> (raw)
In-Reply-To: <540F1B640200007800032AF7@mail.emea.novell.com>


[-- Attachment #1.1: Type: text/plain, Size: 1985 bytes --]

On Tue, Sep 9, 2014 at 9:23 PM, Jan Beulich <JBeulich@suse.com> wrote:

> >>> On 09.09.14 at 14:29, <andrew.cooper3@citrix.com> wrote:
> > On Intel, syscall is strictly only available in long mode, being an AMD
> > instruction mandated in the 64bit spec.
> >
> > is_64bit is disappearing as Xen is unconditionally 64bit these days, but
> > preventing the guest using PAE will preclude it being able to enter long
> > mode.
> >
> > I would agree that it is not necessarily obvious, and based on this
> > consideration, I think it would be better to keep the variable
> > "is_64bit" as it is more informative than "is_pae" in the contexts used.
>
> Or drop the conditional, as suggested before. After all I don't think
> Intel CPUs advertise the bit in CPUID only when in long mode. Plus
> even if they did, what we do (did) here still wouldn't match their
> behavior (since is_64bit really is a hypervisor property, not a guest
> one). I.e. at the tools level we should leave the flag as is. And if
> indeed CPUID output changes when entering long mode (didn't
> check the spec), this could only be mimicked in hypervisor code
> anyway.
>
> Jan
>
>
Hi, Jan

Generally, I agree with you.
Another implicit reason is Xen is always 64-bit now, which also means that
the Intel CPU (if not AMD) on which the hypervisor is running should be
64-bit.
The SYSCALL could be reported to guest as long as the CPU supports it and
it would be emulated once guest run its own CPUID, and is_pae could even be
dropped to some extent. But from performance point of view, there might be
more work in the handler of vmexit (e.g. adding more bits to be emulated).

And I agree with you is_pae does not mean the guest must be long mode,
instead, it is long mode _or_ pae mode.  In pae mode, SYSCALL should not be
exported to guest either. So the conditional is_pae for SYSCALL is not that
accurate (as you said it is partial effective). Maybe we need a better way
here. But I can not figure it out yet.

Zhuo

[-- Attachment #1.2: Type: text/html, Size: 2819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2014-09-09 14:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09  4:31 [PATCH v2 1/2] xc_cpuid_x86.c: Simplify masking conditions and remove redundant work Zhuo Song
2014-09-09  4:31 ` [PATCH v2 2/2] xc_cpuid_x86.c: Remove limit for RDTSCP Zhuo Song
2014-09-09 10:45 ` [PATCH v2 1/2] xc_cpuid_x86.c: Simplify masking conditions and remove redundant work Jan Beulich
2014-09-09 12:21   ` Ian Campbell
2014-09-09 12:29     ` Andrew Cooper
2014-09-09 12:43       ` Ian Campbell
2014-09-09 12:49         ` Andrew Cooper
2014-09-09 13:09           ` z
2014-09-09 13:23       ` Jan Beulich
2014-09-09 14:43         ` z [this message]
2014-09-09 14:49           ` Jan Beulich
2014-09-09 15:13             ` z
2014-09-10  2:06               ` z
2014-09-10  9:19                 ` Jan Beulich
2014-09-09 12:38     ` z
2014-09-09 13:19     ` Jan Beulich

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=CAEzNp8asZrAVTSuse0sgM9n5y+aL2+-yOipvxX+var2m0UrOrA@mail.gmail.com \
    --to=alfred.z.song@gmail.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boyu.mt@alibaba-inc.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jinsong.liu@alibaba-inc.com \
    --cc=songzhuo.sz@alibaba-inc.com \
    --cc=stefano.stabellini@eu.citrix.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 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).