All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Paul Durrant <paul.durrant@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Brian Woods <brian.woods@amd.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [PATCH v2 1/4] amd-iommu: add flush iommu_ops
Date: Tue, 04 Dec 2018 07:24:49 -0700	[thread overview]
Message-ID: <5C068E310200007800202B78@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <20181203174017.11956-2-paul.durrant@citrix.com>

>>> On 03.12.18 at 18:40, <paul.durrant@citrix.com> wrote:
> +static unsigned long flush_count(unsigned long dfn, unsigned int page_count,
> +                                 unsigned int order)
> +{
> +    unsigned long start = dfn / (1u << order);
> +    unsigned long end = DIV_ROUND_UP(dfn + page_count, (1u << order));

Luckily this in not in generic code, so the anomaly at the upper address
space end is not going to surface, and in particular not cause ...

> +    ASSERT(end > start);

... this to trigger. I therefore nevertheless wonder whether it
would't be better to use

    unsigned long start = dfn >> order;
    unsigned long end = (dfn + page_count - 1) >> order) + 1;

instead.

> --- a/xen/include/xen/iommu.h
> +++ b/xen/include/xen/iommu.h
> @@ -52,6 +52,11 @@ static inline bool_t dfn_eq(dfn_t x, dfn_t y)
>      return dfn_x(x) == dfn_x(y);
>  }
>  
> +static inline bool_t dfn_lt(dfn_t x, dfn_t y)
> +{
> +    return dfn_x(x) < dfn_x(y);
> +}

The revision log says this is gone ...

With it really gone, and irrespective of the other comment
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Of course one or both adjustments could be easily done while
committing, provided you agree and provided there's no other
need for a v3.

Jan



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

  reply	other threads:[~2018-12-04 14:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 17:40 [PATCH v2 0/4] iommu improvements Paul Durrant
2018-12-03 17:40 ` [PATCH v2 1/4] amd-iommu: add flush iommu_ops Paul Durrant
2018-12-04 14:24   ` Jan Beulich [this message]
2018-12-04 14:56     ` Paul Durrant
2018-12-03 17:40 ` [PATCH v2 2/4] iommu: rename wrapper functions Paul Durrant
2018-12-04 14:51   ` Jan Beulich
2018-12-04 15:00     ` Paul Durrant
2018-12-03 17:40 ` [PATCH v2 3/4] iommu: elide flushing for higher order map/unmap operations Paul Durrant
2018-12-04 15:16   ` Jan Beulich
2018-12-04 15:36     ` Paul Durrant
2018-12-04 16:01       ` Jan Beulich
2018-12-04 16:53         ` Paul Durrant
2018-12-04 17:20           ` Jan Beulich
2018-12-03 17:40 ` [PATCH v2 4/4] x86/mm/p2m: stop checking for IOMMU shared page tables in mmio_order() Paul Durrant
2018-12-04 15:20   ` Jan Beulich
2018-12-04 15:22     ` Paul Durrant
2018-12-04 15:36       ` Jan Beulich
2018-12-04 15:51   ` Jan Beulich

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=5C068E310200007800202B78@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=brian.woods@amd.com \
    --cc=paul.durrant@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=suravee.suthikulpanit@amd.com \
    --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.