All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: A couple of HVMlite loose ends
Date: Wed, 13 Jan 2016 16:56:01 +0100	[thread overview]
Message-ID: <56967391.1080300@suse.com> (raw)
In-Reply-To: <569671EC.7010101@citrix.com>

On 13/01/16 16:49, Roger Pau Monné wrote:
> Hello,
> 
> While working on a HVMlite Dom0 implementation I've found a couple of
> loose ends with the design that I would like to comment because it's not
> clear to me what's the best direction to take.
> 
> 1. HVM CPUID and Dom0.
> 
> Sadly the way CPUID is handled inside of Xen varies between PV and HVM.
> On PV guests AFAICT we mostly do black-listing (I think this is the
> right term), which means we pick the native CPUID result and then
> perform a series of filter operations in order to remove features which
> should not be exposed to a PV guest. On the other hand, for HVM guests
> we pre-populate an array (d->arch.cpuids) during domain build time, and
> the contents of that array is what is returned to the guest when a CPUID
> instruction is executed.
> 
> This is a problem for a HVMlite Dom0, since the code that populates this
> array resides in libxc, and when creating a HVMlite Dom0 from Xen itself
> (using a properly arranged Dom0 builder) this array doesn't get
> populated at all, leading to wrong CPUID information being returned to
> the guest. I can see two solutions to this problem:
> 
>  a) Switch CPUID handling for HVMlite Dom0 to the PV one, like it's done
> for PVH Dom0.
> 
>  b) Duplicate the code in libxc into the Xen HVMlite Dom0 builder and
> populate d->arch.cpuids.

Make this "move the code from libxc into xen/common/lib<blah> and use
the code from libxc and the hypervisor".

> I'm leaning towards option "b)", because I would like HVMlite to behave
> as a HVM guest as much as possible, but I would like to hear opinions
> from others before taking either route.

I'd prefer the modified b) version, too.

> 2. HVM MTRR and Dom0.
> 
> MTRR ranges are initialised from hvmloader, which means that although we
> expose the MTRR functionality to HVMlite guests (and AFAICT the
> functionality is fully complete/usable), the initial state in which a
> guest finds the MTRR ranges is not expected, leading to errors. Again, I
> see three ways to solve this:
> 
>  a) Mask the MTRR functionality from CPUID for HVMlite guests. This
> requires adding a XEN_X86_EMU_MTRR flag to the bitmap introduced in arch
> domain.
> 
>  b) Setting up the initial MTRR state from libxl/libxc for HVMlite DomU
> and from the Xen domain builder for HVMlite Dom0. This again implies
> some functional duplication of MTRR related code, since now we would
> have 3 different places where MTRR is setup. One inside hvmloader for
> classic HVM guests, another one inside of libxl/libxc for HVMlite DomU
> and yet another one in the Dom0 building for HVMlite Dom0.

Same as above.

> 
>  c) Be aware of this fact and change the OS code so that it will setup
> the initial MTRR ranges correctly.
> 
> Again, I'm leaning towards "b)", because that's the one that's closest
> to native and what we do for classic HVM guests, but would like to hear
> opinions.

And again as above. :-)


Juergen

  parent reply	other threads:[~2016-01-13 15:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 15:49 A couple of HVMlite loose ends Roger Pau Monné
2016-01-13 15:54 ` David Vrabel
2016-01-13 16:07   ` Roger Pau Monné
2016-01-13 16:10   ` Jan Beulich
2016-01-13 15:56 ` Juergen Gross [this message]
2016-01-13 16:01   ` Roger Pau Monné
2016-01-13 16:05     ` Juergen Gross
2016-01-13 16:13 ` Jan Beulich
2016-01-13 16:17   ` Andrew Cooper
2016-01-13 16:26     ` Jan Beulich
2016-01-13 16:30       ` Andrew Cooper
2016-01-13 17:03         ` Boris Ostrovsky
2016-01-13 17:14           ` Andrew Cooper
2016-01-13 16:14 ` 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=56967391.1080300@suse.com \
    --to=jgross@suse.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --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.