All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Paul Durrant <paul.durrant@citrix.com>, xen-devel@lists.xenproject.org
Cc: Kevin Tian <kevin.tian@intel.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Tamas K Lengyel <tamas@tklengyel.com>,
	Jan Beulich <jbeulich@suse.com>,
	Brian Woods <brian.woods@amd.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Subject: Re: [PATCH v14 9/9] mm / iommu: split need_iommu() into has_iommu_pt() and need_iommu_pt_sync()
Date: Thu, 4 Oct 2018 18:15:42 +0100	[thread overview]
Message-ID: <b8cb7f69-3144-8c4c-61bc-3fda8efaf0b2@arm.com> (raw)
In-Reply-To: <20181004104547.32316-10-paul.durrant@citrix.com>

Hi Paul,

On 04/10/2018 11:45, Paul Durrant wrote:
> The name 'need_iommu()' is a little confusing as it suggests a domain needs
> to use the IOMMU but something might not be set up yet, when in fact it
> represents a tri-state value (not a boolean as might be expected) where
> -1 means 'IOMMU mappings being set up' and 1 means 'IOMMU mappings have
> been fully set up'.
> 
> Two different meanings are also inferred from the macro it in various
> places in the code:
> 
> - Some callers want to test whether a domain has IOMMU mappings at all
> - Some callers want to test whether they need to synchronize the domain's
>    P2M and IOMMU mappings
> 
> This patch replaces the 'need_iommu' tri-state value with a defined
> enumeration and adds a boolean flag 'need_sync' to separate these meanings,
> and places both of these in struct domain_iommu, rather than directly in
> struct domain.
> This patch also creates two new boolean macros:
> 
> - 'has_iommu_pt()' evaluates to true if a domain has IOMMU mappings, even
>    if they are still under construction.
> - 'need_iommu_pt_sync()' evaluates to true if a domain requires explicit
>    synchronization of the P2M and IOMMU mappings.
> 
> All callers of need_iommu() are then modified to use the macro appropriate
> to what they are trying to test, except for the instance in
> xen/drivers/passthrough/pci.c:assign_device() which has simply been
> removed since it appears to be unnecessary.
> 
> NOTE: There are some callers of need_iommu() that strictly operate on
>        the hardware domain. In some of these case a more global flag is
>        used instead.
> 
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>

For the Arm bits:

Acked-by: Julien Grall <julien.grall@arm.com>

Cheers,

-- 
Julien Grall

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

  parent reply	other threads:[~2018-10-04 17:15 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 10:45 [PATCH v14 0/9] paravirtual IOMMU pre-requisites and clean-up Paul Durrant
2018-10-04 10:45 ` [PATCH v14 1/9] iommu: introduce the concept of DFN Paul Durrant
2018-10-04 10:45 ` [PATCH v14 2/9] iommu: make use of type-safe DFN and MFN in exported functions Paul Durrant
2018-10-04 15:14   ` George Dunlap
2018-10-04 10:45 ` [PATCH v14 3/9] iommu: push use of type-safe DFN and MFN into iommu_ops Paul Durrant
2018-10-04 13:04   ` Paul Durrant
2018-10-04 13:07     ` Julien Grall
2018-10-04 10:45 ` [PATCH v14 4/9] iommu: don't domain_crash() inside iommu_map/unmap_page() Paul Durrant
2018-10-04 16:29   ` George Dunlap
2018-10-04 16:36     ` Paul Durrant
2018-10-05  7:33       ` Jan Beulich
2018-10-05  9:02         ` Paul Durrant
     [not found]           ` <F5DD545D-610B-40C7-827C-4CEAA2DF5F04@citrix.com>
     [not found]             ` <8B147463-7834-4525-AC10-36922338876F@citrix.com>
     [not found]               ` <b6add5ff3b6647eaab63265dbaf923bd@AMSPEX02CL03.citrite.net>
2018-10-05 10:31                 ` Paul Durrant
     [not found]                 ` <28341D09-548F-460C-8B22-43CA61EA1308@citrix.com>
2018-10-05 10:37                   ` George Dunlap
2018-10-05 10:38                   ` Paul Durrant
2018-10-05 11:17                     ` Jan Beulich
2018-10-05 11:44                       ` Paul Durrant
2018-10-04 10:45 ` [PATCH v14 5/9] memory: add check_get_page_from_gfn() as a wrapper Paul Durrant
2018-10-04 16:02   ` George Dunlap
2018-10-04 10:45 ` [PATCH v14 6/9] vtd: add missing check for shared EPT Paul Durrant
2018-10-04 10:45 ` [PATCH v14 7/9] vtd: add lookup_page method to iommu_ops Paul Durrant
2018-12-24 15:15   ` Andrew Cooper
2019-01-03  8:58     ` Paul Durrant
2018-10-04 10:45 ` [PATCH v14 8/9] mm / iommu: include need_iommu() test in iommu_use_hap_pt() Paul Durrant
2018-10-04 14:02   ` Jan Beulich
2018-10-04 16:23   ` George Dunlap
2018-10-05 16:03   ` Wei Liu
2018-10-05 16:13     ` Paul Durrant
2018-10-04 10:45 ` [PATCH v14 9/9] mm / iommu: split need_iommu() into has_iommu_pt() and need_iommu_pt_sync() Paul Durrant
2018-10-04 14:11   ` Jan Beulich
2018-10-04 16:23   ` George Dunlap
2018-10-04 17:15   ` Julien Grall [this message]
2018-10-05 14:50   ` Jan Beulich
2018-10-05 15:19     ` Paul Durrant

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=b8cb7f69-3144-8c4c-61bc-3fda8efaf0b2@arm.com \
    --to=julien.grall@arm.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=brian.woods@amd.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=konrad.wilk@oracle.com \
    --cc=paul.durrant@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tamas@tklengyel.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@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.