All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Paul Durrant <paul.durrant@citrix.com>
Subject: Re: [PATCH v2] x86/vtd: fix iommu_share_p2m_table
Date: Mon, 08 Oct 2018 08:26:18 -0600	[thread overview]
Message-ID: <5BBB690A02000078001EFA83@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <20181008135239.41160-1-roger.pau@citrix.com>

>>> On 08.10.18 at 15:52, <roger.pau@citrix.com> wrote:
> Commit 2916951c1 "mm / iommu: include need_iommu() test in
> iommu_use_hap_pt()" changed the check in iommu_share_p2m_table to use
> need_iommu(d) (as part of iommu_use_hap_pt) instead of iommu_enabled,
> which broke the check because at the point in domain construction
> where iommu_share_p2m_table is called need_iommu(d) will always return
> false.
> 
> Fix this by reverting to the previous logic.
> 
> While there turn the hap_enabled check into an ASSERT, since the only
> caller of iommu_share_p2m_table already performs the hap_enabled check
> before calling the function.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -505,7 +505,13 @@ int iommu_do_domctl(
>  
>  void iommu_share_p2m_table(struct domain* d)
>  {
> -    if ( iommu_use_hap_pt(d) )
> +    ASSERT(hap_enabled(d));
> +    /*
> +     * iommu_use_hap_pt cannot be used here because at the point in the domain
> +     * construction where iommu_share_p2m_table get called need_iommu(d) will
> +     * always return false.
> +     */

I'm fighting with myself whether to shorten this comment while
committing - it's certainly not "brief".

Jan


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

      parent reply	other threads:[~2018-10-08 14:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-08 13:52 [PATCH v2] x86/vtd: fix iommu_share_p2m_table Roger Pau Monne
2018-10-08 14:00 ` Paul Durrant
2018-10-08 14:26 ` Jan Beulich [this message]

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=5BBB690A02000078001EFA83@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=paul.durrant@citrix.com \
    --cc=roger.pau@citrix.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.