All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Juergen Gross <jgross@suse.com>,
	xen-devel@lists.xenproject.org,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] xen/pvh: enable and set default MTRR type
Date: Wed, 9 May 2018 12:30:16 +0100	[thread overview]
Message-ID: <20180509113016.tavac64ba5fu3tob__46601.9337800846$1525865365$gmane$org@MacBook-Pro-de-Roger.local> (raw)
In-Reply-To: <fbe18be3-0e2e-723f-a625-015c6aad89a3@citrix.com>

On Wed, May 09, 2018 at 11:56:40AM +0100, Andrew Cooper wrote:
> On 09/05/18 11:21, Roger Pau Monne wrote:
> > On PVH MTRR is not initialized by the firmware (because there's no
> > firmware), so the kernel is started with MTRR disabled which means all
> > memory accesses are UC.
> >
> > So far there have been no issues (ie: slowdowns) caused by this
> > because PVH only supported DomU mode without passed-through devices,
> > so Xen was using WB as the default memory type instead of UC.
> >
> > Fix this by enabling MTRR and setting the default type to WB. Linux
> > will use PAT to set the actual memory cache attributes.
> >
> > Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> I'd argue that this is a bug in PVH starting state.

Do you mean that MTRR should be setup before starting the guest?

> Do you know what mechanism is used to bodge things to WB in the first
> place?

If you mean when passthorugh is not used (ie: no IOMMU), then it's at
epte_get_entry_emt, grep for need_iommu(d) (line ~801).

> I'm not sure that setting the default MTRR type is going to be a
> clever idea in hindsight when we come to doing PCI Passthrough support.

Setting the default type to WB is also set by hvmloader, it's just
that hvmloader also sets some of the fixed and variable ranges to UC
in order to cover the iomem areas.

The expectations when doing pci-passthrough is that the guest will
always use paging and PAT in order to set the appropriate cache
attributes, or else the guest itself will have to program the UC MTRR
ranges, I admit that's not very nice however.

What about enabling the default MTRR type and setting it to WB in the
toolstack for PVH? IMO doing it Xen itself would be wrong.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-05-09 11:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 10:21 [PATCH v2 0/3] xen/pvh: Dom0 support Roger Pau Monne
2018-05-09 10:21 ` [PATCH v2 1/3] xen/pvh: enable and set default MTRR type Roger Pau Monne
2018-05-09 10:21 ` Roger Pau Monne
2018-05-09 10:56   ` [Xen-devel] " Andrew Cooper
2018-05-09 11:30     ` Roger Pau Monné
2018-05-09 15:11       ` Roger Pau Monné
2018-05-10 11:52         ` Wei Liu
2018-05-10 11:52         ` Wei Liu
2018-05-11  7:33         ` Juergen Gross
2018-05-11  7:33         ` [Xen-devel] " Juergen Gross
2018-05-09 15:11       ` Roger Pau Monné
2018-05-09 11:30     ` Roger Pau Monné [this message]
2018-05-09 10:56   ` Andrew Cooper
2018-05-09 10:21 ` [PATCH v2 2/3] xen/store: do not store local values in xen_start_info Roger Pau Monne
2018-05-09 10:21 ` Roger Pau Monne
2018-05-11  7:34   ` Juergen Gross
2018-05-11  7:34   ` Juergen Gross
2018-05-17  6:43   ` Juergen Gross
2018-05-17  6:43   ` Juergen Gross
2018-05-09 10:21 ` [PATCH v2 3/3] xen: share start flags between PV and PVH Roger Pau Monne
2018-05-09 10:21 ` Roger Pau Monne
2018-05-09 16:34   ` kbuild test robot
2018-05-09 16:34   ` kbuild test robot
2018-05-09 21:47   ` Stefano Stabellini
2018-05-09 21:47   ` Stefano Stabellini

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='20180509113016.tavac64ba5fu3tob__46601.9337800846$1525865365$gmane$org@MacBook-Pro-de-Roger.local' \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --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.