All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>, Jan Beulich <JBeulich@suse.com>,
	Xen-devel <xen-devel@lists.xen.org>,
	Julien Grall <julien.grall@arm.com>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH v2 3/4] xen/dom0: Drop iommu_hwdom_inclusive entirely
Date: Fri, 4 Jan 2019 15:03:27 +0100	[thread overview]
Message-ID: <20190104140327.thl3ylvdgm4fzne2@mac.bytemobile.com> (raw)
In-Reply-To: <1546269383-32166-4-git-send-email-andrew.cooper3@citrix.com>

On Mon, Dec 31, 2018 at 03:16:22PM +0000, Andrew Cooper wrote:
> diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
> index c68a722..0ccb754 100644
> --- a/xen/drivers/passthrough/x86/iommu.c
> +++ b/xen/drivers/passthrough/x86/iommu.c
> @@ -169,10 +169,10 @@ static bool __hwdom_init hwdom_iommu_map(const struct domain *d,
>      default:
>          if ( type & RAM_TYPE_RESERVED )
>          {
> -            if ( !iommu_hwdom_inclusive && !iommu_hwdom_reserved )
> +            if ( !iommu_hwdom_reserved )
>                  return false;
>          }
> -        else if ( is_hvm_domain(d) || !iommu_hwdom_inclusive || pfn > max_pfn )
> +        else if ( is_hvm_domain(d) || pfn > max_pfn )
>              return false;

I think the switch can be simplified as:

switch ( type = page_get_ram_type(mfn) )
{
case RAM_TYPE_CONVENTIONAL:
    if ( iommu_hwdom_strict )
        return false;
    break;

default:
    if ( !(type & RAM_TYPE_RESERVED) )
        return false;
    /* fallthrough. */
case RAM_TYPE_RESERVED:
    if ( !iommu_hwdom_reserved )
       return false;
    break;
}

And the max_pfn parameter is no longer needed.

Roger.

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

  parent reply	other threads:[~2019-01-04 14:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-31 15:16 [PATCH v2 0/4] Functional and documentation improvements to dom0 setup Andrew Cooper
2018-12-31 15:16 ` [PATCH v2 1/4] xen/dom0: Improve documentation for dom0= and dom0-iommu= Andrew Cooper
2019-01-04 12:15   ` Roger Pau Monné
2018-12-31 15:16 ` [PATCH v2 2/4] x86/dom0: Improve dom0= useability Andrew Cooper
2019-01-04 12:17   ` Roger Pau Monné
2018-12-31 15:16 ` [PATCH v2 3/4] xen/dom0: Drop iommu_hwdom_inclusive entirely Andrew Cooper
2019-01-04 12:33   ` Roger Pau Monné
2019-01-04 12:46     ` Andrew Cooper
2019-01-04 12:54       ` Roger Pau Monné
2019-01-04 14:03   ` Roger Pau Monné [this message]
2018-12-31 15:16 ` [PATCH v2 4/4] xen/dom0: Add a dom0-iommu=none option Andrew Cooper
2019-01-04 12:38   ` Roger Pau Monné
2018-12-31 17:51 ` [PATCH v2 0/4] Functional and documentation improvements to dom0 setup Andrew Cooper

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=20190104140327.thl3ylvdgm4fzne2@mac.bytemobile.com \
    --to=roger.pau@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=sstabellini@kernel.org \
    --cc=wei.liu2@citrix.com \
    --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.