All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v2] x86/p2m-pt: tighten conditions of IOMMU mapping updates
Date: Thu, 1 Oct 2015 15:42:22 +0100	[thread overview]
Message-ID: <560D464E.2010908@citrix.com> (raw)
In-Reply-To: <560D611502000078000A7751@prv-mh.provo.novell.com>

On 01/10/15 15:36, Jan Beulich wrote:
>>>> On 01.10.15 at 15:34, <andrew.cooper3@citrix.com> wrote:
>> On 01/10/15 11:25, Jan Beulich wrote:
>>> @@ -645,11 +665,12 @@ p2m_pt_set_entry(struct p2m_domain *p2m,
>>>           && (gfn + (1UL << page_order) - 1 > p2m->max_mapped_pfn) )
>>>          p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
>>>  
>>> -    if ( iommu_enabled && need_iommu(p2m->domain) )
>>> +    if ( iommu_enabled && need_iommu(p2m->domain) &&
>>> +         (iommu_old_flags != iommu_pte_flags || old_mfn != mfn_x(mfn)) )
>>>      {
>>>          if ( iommu_use_hap_pt(p2m->domain) )
>>>          {
>>> -            if ( old_mfn && (old_mfn != mfn_x(mfn)) )
>>> +            if ( iommu_old_flags )
>>>                  amd_iommu_flush_pages(p2m->domain, gfn, page_order);
>> iommu_hap_pt_share is hardwired to 0 on AMD, making this if() clause
>> effectively dead.  Is this what you mean by your second TBD?  I would
>> suggest dropping it.
> Yes, that's what I mean.
>
>>>          }
>>>          else
>>>
>>>
>> In this else clause there is a now-shadowed "flags" which might better
>> be renamed to iommu_flags to avoid confusion.
>>
>> There is also an extra shadowed 'i' which could do with removing, as it
>> introduces a 64bit->32bit truncation (which is not currently a problem).
> See the (not re-submitted because it didn't really change) follow-up
> patch
> (http://lists.xenproject.org/archives/html/xen-devel/2015-09/msg02585.html)
> which deletes that pointless variable altogether.

Ah - I appear to have missed that in my review queue - apologies. 
Consider it Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

As for the logic presented in this patch, I believe it is correct, so
also Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

  reply	other threads:[~2015-10-01 14:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-01 10:25 [PATCH v2] x86/p2m-pt: tighten conditions of IOMMU mapping updates Jan Beulich
2015-10-01 13:34 ` Andrew Cooper
2015-10-01 14:36   ` Jan Beulich
2015-10-01 14:42     ` Andrew Cooper [this message]
2015-10-01 14:55 ` Wei Liu
2015-10-01 16:16 ` George Dunlap
2015-10-02  7:31   ` Jan Beulich
2015-10-02  9:16     ` Wei Liu
2015-10-02  9:25       ` Jan Beulich
2015-10-02  9:44       ` George Dunlap
2015-10-02  9:47     ` George Dunlap
2015-10-02 11:23       ` Jan Beulich
2015-10-02 12:19     ` Tim Deegan

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=560D464E.2010908@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.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.