All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Paul Durrant <Paul.Durrant@citrix.com>, Wei Liu <wl@xen.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [Xen-devel] [PATCH] x86/p2m: fix non-translated handling of iommu mappings
Date: Tue, 23 Jul 2019 14:40:24 +0200	[thread overview]
Message-ID: <20190723124024.raxi6fba5wkshybv@Air-de-Roger> (raw)
In-Reply-To: <379d08e8-9a22-7687-54a3-650f0baa72b5@suse.com>

On Tue, Jul 23, 2019 at 10:32:41AM +0000, Jan Beulich wrote:
> On 22.07.2019 17:32, Roger Pau Monne wrote:
> > The current usage of need_iommu_pt_sync in p2m for non-translated
> > guests is wrong because it doesn't correctly handle a relaxed PV
> > hardware domain, that has need_sync set to false, but still need
> > entries to be added from calls to {set/clear}_identity_p2m_entry.
> > 
> > Adjust the code in guest_physmap_add_page to also check whether the
> > domain has an iommu instead of whether it needs syncing or not in
> > order to take a reference to a page to be mapped.
> 
> Why this seemingly unrelated change? I ask because ...
> 
> > --- a/xen/arch/x86/mm/p2m.c
> > +++ b/xen/arch/x86/mm/p2m.c
> > @@ -836,7 +836,7 @@ guest_physmap_add_page(struct domain *d, gfn_t gfn, mfn_t mfn,
> >            */
> >           for ( i = 0; i < (1UL << page_order); ++i, ++page )
> >           {
> > -            if ( !need_iommu_pt_sync(d) )
> > +            if ( !has_iommu_pt(d) )
> >                   /* nothing */;
> >               else if ( get_page_and_type(page, d, PGT_writable_page) )
> >                   put_page_and_type(page);
> 
> ... this parallels the code in iommu_hwdom_init(), which similarly
> uses need_iommu_pt_sync() (and during the prior discussion you did
> agree with Paul that it shouldn't be changed). IOW the patch for
> now can have my R-b only with this change and the respective part
> of the description dropped.

OK, this is again not needed for a relaxed PV hardware domain because
all RAM is already mapped on the iommu page tables.

Let me update the commit and resend.

Thanks, Roger.

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

  reply	other threads:[~2019-07-23 12:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 15:32 [Xen-devel] [PATCH] x86/p2m: fix non-translated handling of iommu mappings Roger Pau Monne
2019-07-22 15:33 ` Paul Durrant
2019-07-23 10:32 ` Jan Beulich
2019-07-23 12:40   ` Roger Pau Monné [this message]
2019-08-20  1:57 ` Roman Shaposhnik
2019-08-20  7:36   ` 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=20190723124024.raxi6fba5wkshybv@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=Paul.Durrant@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=wl@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.