From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] x86/EPT: relax iPAT for "invalid" MFNs
Date: Tue, 11 Jun 2024 09:41:07 +0200 [thread overview]
Message-ID: <Zmf_k2meED8iG3H5@macbook> (raw)
In-Reply-To: <56063a8f-f569-4130-ac25-f0f064e288a1@suse.com>
On Mon, Jun 10, 2024 at 04:58:52PM +0200, Jan Beulich wrote:
> mfn_valid() is RAM-focused; it will often return false for MMIO. Yet
> access to actual MMIO space should not generally be restricted to UC
> only; especially video frame buffer accesses are unduly affected by such
> a restriction. Permit PAT use for directly assigned MMIO as long as the
> domain is known to have been granted some level of cache control.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> Considering that we've just declared PVH Dom0 "supported", this may well
> qualify for 4.19. The issue was specifically very noticable there.
>
> The conditional may be more complex than really necessary, but it's in
> line with what we do elsewhere. And imo better continue to be a little
> too restrictive, than moving to too lax.
>
> --- a/xen/arch/x86/mm/p2m-ept.c
> +++ b/xen/arch/x86/mm/p2m-ept.c
> @@ -503,7 +503,8 @@ int epte_get_entry_emt(struct domain *d,
>
> if ( !mfn_valid(mfn) )
> {
> - *ipat = true;
> + *ipat = type != p2m_mmio_direct ||
> + (!is_iommu_enabled(d) && !cache_flush_permitted(d));
Looking at this, shouldn't the !mfn_valid special case be removed, and
mfns without a valid page be processed normally, so that the guest
MTRR values are taken into account, and no iPAT is enforced?
I also think this likely wants a:
Fixes: 81fd0d3ca4b2 ('x86/hvm: simplify 'mmio_direct' check in epte_get_entry_emt()')
As AFAICT before that commit direct MMIO regions would set iPAT to WB,
which would result in the correct attributes (albeit guest MTRR was
still ignored).
Thanks, Roger.
next prev parent reply other threads:[~2024-06-11 7:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 14:58 [PATCH] x86/EPT: relax iPAT for "invalid" MFNs Jan Beulich
2024-06-10 15:00 ` [PATCH for-4.19] " Jan Beulich
2024-06-11 10:40 ` Oleksii K.
2024-06-11 7:41 ` Roger Pau Monné [this message]
2024-06-11 8:26 ` [PATCH] " Jan Beulich
2024-06-11 9:02 ` Roger Pau Monné
2024-06-11 9:33 ` Jan Beulich
2024-06-11 11:08 ` Roger Pau Monné
2024-06-11 11:52 ` Jan Beulich
2024-06-11 13:52 ` Roger Pau Monné
2024-06-11 14:53 ` Jan Beulich
2024-06-11 16:21 ` Roger Pau Monné
2024-06-12 11:52 ` Jan Beulich
2024-06-11 13:55 ` 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=Zmf_k2meED8iG3H5@macbook \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.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.