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 v2] x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()
Date: Thu, 27 Mar 2025 10:00:17 +0100 [thread overview]
Message-ID: <Z-UToaPviR7b73iG@macbook.local> (raw)
In-Reply-To: <b590b590-764a-4dfe-9e13-975122790329@suse.com>
On Tue, Mar 25, 2025 at 08:17:04AM +0100, Jan Beulich wrote:
> Handling of both grants and foreign pages was different between the two
> paths.
>
> While permitting access to grants would be desirable, doing so would
> require more involved handling; undo that for the time being. In
> particular the page reference obtained would prevent the owning domain
> from changing e.g. the page's type (after the grantee has released the
> last reference of the grant). Instead perhaps another reference on the
> grant would need obtaining. Which in turn would require determining
> which grant that was.
>
> Foreign pages in any event need permitting on both paths.
I've been wondering about this, and AFAICT the PV equivalent of this
function (the tail of get_page_from_gfn()) is much more limited in
that it just allows access to domain owned RAM or MMIO that has a
backing page (I expect mostly for the low 1MB?).
However for HVM domains we allow to take references to foreign mapped
pages and taking references to MMIO pages is not permitted.
Should the tail of get_page_from_gfn() also be adjusted to make use of
the newly introduced get_page_from_mfn_and_type(), thus unifying the
logic for both PV and HVM?
Could possibly be done in a separate change, I'm just trying to
understand why we have this seemingly different handling for PV vs
HVM.
Thanks, Roger.
next prev parent reply other threads:[~2025-03-27 9:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-25 7:17 [PATCH v2] x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn() Jan Beulich
2025-03-27 9:00 ` Roger Pau Monné [this message]
2025-03-27 9:24 ` Jan Beulich
2025-03-27 10:38 ` Roger Pau Monné
2025-03-27 10:54 ` Jan Beulich
2025-03-27 11:43 ` Roger Pau Monné
2025-03-27 11:44 ` Roger Pau Monné
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=Z-UToaPviR7b73iG@macbook.local \
--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.