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>,
Paul Durrant <paul@xen.org>
Subject: Re: [PATCH v5 12/15] VT-d: replace all-contiguous page tables by superpage mappings
Date: Thu, 2 Jun 2022 12:31:17 +0200 [thread overview]
Message-ID: <YpiRdYJP5f65pRYG@Air-de-Roger> (raw)
In-Reply-To: <749f47ee-9258-c3a5-fab2-125c1bdda845@suse.com>
On Thu, Jun 02, 2022 at 11:58:48AM +0200, Jan Beulich wrote:
> On 02.06.2022 11:35, Roger Pau Monné wrote:
> > On Fri, May 27, 2022 at 01:19:55PM +0200, Jan Beulich wrote:
> >> When a page table ends up with all contiguous entries (including all
> >> identical attributes), it can be replaced by a superpage entry at the
> >> next higher level. The page table itself can then be scheduled for
> >> freeing.
> >>
> >> The adjustment to LEVEL_MASK is merely to avoid leaving a latent trap
> >> for whenever we (and obviously hardware) start supporting 512G mappings.
> >>
> >> Note that cache sync-ing is likely more strict than necessary. This is
> >> both to be on the safe side as well as to maintain the pattern of all
> >> updates of (potentially) live tables being accompanied by a flush (if so
> >> needed).
> >>
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
> >
> > Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
>
> Thanks.
>
> >> ---
> >> Unlike the freeing of all-empty page tables, this causes quite a bit of
> >> back and forth for PV domains, due to their mapping/unmapping of pages
> >> when they get converted to/from being page tables. It may therefore be
> >> worth considering to delay re-coalescing a little, to avoid doing so
> >> when the superpage would otherwise get split again pretty soon. But I
> >> think this would better be the subject of a separate change anyway.
> >>
> >> Of course this could also be helped by more "aware" kernel side
> >> behavior: They could avoid immediately mapping freed page tables
> >> writable again, in anticipation of re-using that same page for another
> >> page table elsewhere.
> >
> > Could we provide an option to select whether to use super-pages for
> > IOMMU, so that PV domains could keep the previous behavior?
>
> Hmm, I did (a while ago) consider adding a command line option, largely
> to have something in case of problems, but here you're asking about a
> per-domain setting. Possible, sure, but I have to admit I'm always
> somewhat hesitant when it comes to changes requiring to touch the tool
> stack in non-trivial ways (required besides a separate Dom0 control).
Well, per-domain is always better IMO, but I don't want to block you
on this, so I guess a command line option would be OK.
Per-domain would IMO be helpful in this case because an admin might
wish to disable IOMMU super-pages just for PV guests, in order to
prevent the back-and-forth in that case. We could also do so with a
command line option but it's not the most user-friendly approach.
> It's also not clear what granularity we'd want to allow control at:
> Just yes/no, or also an upper bound on the page sizes permitted, or
> even a map of (dis)allowed page sizes?
I would be fine with just yes/no. I don't think we need to complicate
the logic, this should be a fallback in case things don't work as
expected.
> Finally, what would the behavior be for HVM guests using shared page
> tables? Should the IOMMU option there also suppress CPU-side large
> pages? Or should the IOMMU option, when not fulfillable with shared
> page tables, lead to use of separate page tables (and an error if
> shared page tables were explicitly requested)?
I think the option should error out (or be ignored?) when used with
shared page tables, there are already options to control the page
sizes for the CPU side page tables, and those should be used when
using shared page tables.
Thanks, Roger.
next prev parent reply other threads:[~2022-06-02 10:32 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-27 11:10 [PATCH v5 00/15] IOMMU: superpage support when not sharing pagetables Jan Beulich
2022-05-27 11:12 ` [PATCH v5 01/15] IOMMU/x86: restrict IO-APIC mappings for PV Dom0 Jan Beulich
2022-05-31 14:40 ` Roger Pau Monné
2022-05-31 15:40 ` Jan Beulich
2022-05-31 16:15 ` Roger Pau Monné
2022-06-01 7:10 ` Jan Beulich
2022-06-01 8:17 ` Roger Pau Monné
2022-06-01 15:10 ` Jan Beulich
2022-05-27 11:12 ` [PATCH v5 02/15] IOMMU/x86: perform PV Dom0 mappings in batches Jan Beulich
2022-05-31 16:01 ` Roger Pau Monné
2022-06-01 7:30 ` Jan Beulich
2022-06-01 9:08 ` Roger Pau Monné
2022-05-27 11:13 ` [PATCH v5 03/15] IOMMU/x86: support freeing of pagetables Jan Beulich
2022-05-31 16:25 ` Roger Pau Monné
2022-06-01 7:32 ` Jan Beulich
2022-06-01 9:24 ` Roger Pau Monné
2022-06-01 15:25 ` Jan Beulich
2022-06-02 8:57 ` Roger Pau Monné
2022-05-27 11:13 ` [PATCH v5 04/15] AMD/IOMMU: allow use of superpage mappings Jan Beulich
2022-05-27 11:14 ` [PATCH v5 05/15] VT-d: " Jan Beulich
2022-05-27 11:16 ` [PATCH v5 06/15] IOMMU: fold flush-all hook into "flush one" Jan Beulich
2022-05-27 11:17 ` [PATCH v5 07/15] x86: introduce helper for recording degree of contiguity in page tables Jan Beulich
2022-06-01 11:29 ` Roger Pau Monné
2022-06-01 12:11 ` Jan Beulich
2022-06-01 13:02 ` Roger Pau Monné
2022-05-27 11:17 ` [PATCH v5 08/15] IOMMU/x86: prefill newly allocate " Jan Beulich
2022-06-01 12:59 ` Roger Pau Monné
2022-06-01 13:17 ` Jan Beulich
2022-05-27 11:18 ` [PATCH v5 09/15] AMD/IOMMU: free all-empty " Jan Beulich
2022-05-27 11:19 ` [PATCH v5 10/15] VT-d: " Jan Beulich
2022-05-27 11:19 ` [PATCH v5 11/15] AMD/IOMMU: replace all-contiguous page tables by superpage mappings Jan Beulich
2022-05-27 11:19 ` [PATCH v5 12/15] VT-d: " Jan Beulich
2022-06-02 9:35 ` Roger Pau Monné
2022-06-02 9:58 ` Jan Beulich
2022-06-02 10:31 ` Roger Pau Monné [this message]
2022-05-27 11:20 ` [PATCH v5 13/15] IOMMU/x86: add perf counters for page table splitting / coalescing Jan Beulich
2022-05-27 11:20 ` [PATCH v5 14/15] VT-d: fold iommu_flush_iotlb{,_pages}() Jan Beulich
2022-05-27 11:21 ` [PATCH v5 15/15] VT-d: fold dma_pte_clear_one() into its only caller Jan Beulich
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=YpiRdYJP5f65pRYG@Air-de-Roger \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=paul@xen.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.