xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"stefano.stabellini@eu.citrix.com"
	<stefano.stabellini@eu.citrix.com>
Subject: Re: [HYBRID]: XEN_EMULATE_PREFIX in user process
Date: Thu, 28 Jun 2012 18:26:02 -0700	[thread overview]
Message-ID: <20120628182602.6cc9b432@mantra.us.oracle.com> (raw)
In-Reply-To: <20120629010903.GC4902@phenom.dumpdata.com>

On Thu, 28 Jun 2012 21:09:03 -0400
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:

> On Thu, Jun 28, 2012 at 06:00:07PM -0700, Mukesh Rathor wrote:
> > Hi,
> > 
> > Booting latest upstream pv linux as dom0, I noticed dm_mapper, user
> > level process, is running with XEN_EMULATE_PREFIX cpuid. I am
> > wondering if the prefix is statically put there, or how its put
> > there?
> 
> That is impressive. It should be only be in the kernel via the pvops
> cpuid call which does this:
> 
>  252         asm(XEN_EMULATE_PREFIX "cpuid"
>  253                 : "=a" (*ax),
>  254                   "=b" (*bx),
>  255                   "=c" (*cx),
>  256                   "=d" (*dx)
>  257                 : "0" (*ax), "2" (*cx));
>  258 
> 
> 
> > 
> > For hybrid, the hvm container traps cpuid, so we don't need to
> > prefix cpuid. Less code if I don't have to worry about trapping the
> > invalid op. There seems places where the cpuid is run without the
> > xen prefix in user mode.
> 
> Right, you can make the .cpuid pvops call point to the native.

Yup. In the kernel I do that already.

> > 
> > BTW, for cpuid vmexit, if kernel mode I call pv_cpuid, if user
> > mode, I just return cpuid values, as that's what would happen
> > without the HVM container.
> 
> You mean in PV mode in user-space you would get the unfiltered cpuid
> value? Yes, that is true. Which is why I am surprised that dm_mapper
> (are you sure it is not a kernel thread?) is doing that.

User mode:

RIP: 0x0000000000400692 CS: 0x0033

[0]xkdb> dd 0x0000000000400680 32 0
0000000000400680:  89f88953e5894855 db8500000000b9d3
0000000000400690:  0f6e65780b0f0574 4e89045e890689a2

thanks,
Mukesh

  reply	other threads:[~2012-06-29  1:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-29  1:00 [HYBRID]: XEN_EMULATE_PREFIX in user process Mukesh Rathor
2012-06-29  1:09 ` Konrad Rzeszutek Wilk
2012-06-29  1:26   ` Mukesh Rathor [this message]
2012-06-29  8:09     ` Ian Campbell
2012-06-29 18:15       ` Mukesh Rathor
2012-06-29 19:07         ` Mukesh Rathor
2012-06-29 22:04           ` Ian Campbell
2012-06-29 22:50             ` Mukesh Rathor
2012-07-02  8:27               ` Jan Beulich
2012-07-02  9:29                 ` Ian Campbell
2012-07-02 18:18                 ` Mukesh Rathor
2012-06-29  7:56 ` Jan Beulich
2012-06-29  8:07   ` Ian Campbell
2012-06-29  8:15     ` Jan Beulich
2012-06-29 21:18   ` Mukesh Rathor

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=20120628182602.6cc9b432@mantra.us.oracle.com \
    --to=mukesh.rathor@oracle.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Xen-devel@lists.xensource.com \
    --cc=konrad.wilk@oracle.com \
    --cc=stefano.stabellini@eu.citrix.com \
    /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).