All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: 'Stefano Stabellini' <sstabellini@kernel.org>
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"julien.grall@arm.com" <julien.grall@arm.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH for-4.12] xen/iommu: fix dev assignment on ARM after 91d4eca7
Date: Tue, 8 Jan 2019 08:30:26 +0000	[thread overview]
Message-ID: <5d65341a1ccc44e7ab058de441996e15@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <alpine.DEB.2.10.1901071039230.800@sstabellini-ThinkPad-X260>

> -----Original Message-----
[snip]
> >
> > The use of iommu_use_hap_pt() here is indeed a problem, but I think it
> would be sufficient to move the line "hd->status =
> IOMMU_STATUS_initializing" to just before the if rather than to a
> completely separate function.
> 
> Yes, that works too.
> 
> ---
> xen/iommu: fix dev assignment on ARM after 91d4eca7
> 
> Fix device assignment on ARM after 91d4eca7 "mm / iommu: split
> need_iommu() into has_iommu_pt() and need_iommu_pt_sync()".
> 
> arch_iommu_populate_page_table returns -ENOSYS which causes
> iommu_construct to return early, although it is not an error.
> 
> hd->status needs to be set to IOMMU_STATUS_initializing before calling
> iommu_use_hap_pt, otherwise iommu_use_hap_pt will return the wrong
> value.
> 
> Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>

LGTM so you can add...

Reviewed-by: Paul Durrant <paul.durrant@citrix.com>

> 
> diff --git a/xen/drivers/passthrough/iommu.c
> b/xen/drivers/passthrough/iommu.c
> index ac62d7f..a6f69f4 100644
> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -261,11 +261,11 @@ int iommu_construct(struct domain *d)
>      if ( hd->status == IOMMU_STATUS_initialized )
>          return 0;
> 
> +    hd->status = IOMMU_STATUS_initializing;
>      if ( !iommu_use_hap_pt(d) )
>      {
>          int rc;
> 
> -        hd->status = IOMMU_STATUS_initializing;
>          hd->need_sync = true;
> 
>          rc = arch_iommu_populate_page_table(d);
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-01-08  8:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-03  0:28 [PATCH for-4.12] xen/iommu: fix dev assignment on ARM after 91d4eca7 Stefano Stabellini
2019-01-03  0:50 ` Andrew Cooper
2019-01-03 18:19   ` Stefano Stabellini
2019-01-04  9:03     ` Paul Durrant
2019-01-04 17:46       ` Stefano Stabellini
2019-01-07  8:56         ` Paul Durrant
2019-01-07 18:40           ` Stefano Stabellini
2019-01-08  8:30             ` Paul Durrant [this message]
2019-01-08  8:47               ` Jan Beulich
2019-01-08 18:50                 ` Stefano Stabellini

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=5d65341a1ccc44e7ab058de441996e15@AMSPEX02CL03.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.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.