All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Yang Z Zhang <yang.z.zhang@intel.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] VT-d/ATS: correct and clean up dev_invalidate_iotlb()
Date: Wed, 25 Jun 2014 13:50:56 +0100	[thread overview]
Message-ID: <53AAC5B0.9070008@citrix.com> (raw)
In-Reply-To: <53AAC54C020000780001D2A5@mail.emea.novell.com>

On 25/06/14 11:49, Jan Beulich wrote:
>>>> On 24.06.14 at 18:09, <andrew.cooper3@citrix.com> wrote:
>> On 24/06/14 15:25, Jan Beulich wrote:
>>> @@ -133,32 +135,37 @@ int dev_invalidate_iotlb(struct iommu *i
>>>              /* invalidate all translations: sbit=1,bit_63=0,bit[62:12]=1 */
>>>              sbit = 1;
>>>              addr = (~0 << PAGE_SHIFT_4K) & 0x7FFFFFFFFFFFFFFF;
>>> -            ret |= qinval_device_iotlb(iommu, pdev->ats_queue_depth,
>>> -                                       sid, sbit, addr);
>>> +            rc = qinval_device_iotlb(iommu, pdev->ats_queue_depth,
>>> +                                     sid, sbit, addr);
>>>              break;
>>>          case DMA_TLB_PSI_FLUSH:
>>>              if ( !device_in_domain(iommu, pdev, did) )
>>>                  break;
>>>  
>>> -            addr &= ~0 << (PAGE_SHIFT + size_order);
>>> -
>>>              /* if size <= 4K, set sbit = 0, else set sbit = 1 */
>>>              sbit = size_order ? 1 : 0;
>>>  
>>>              /* clear lower bits */
>>> -            addr &= (~0 << (PAGE_SHIFT + size_order));
>>> +            addr &= ~0 << PAGE_SHIFT_4K;
>> Doesn't this need to be ~0ULL as addr is u64?
> No (or else further up in the code shown as context the same
> would need to be done): Conversion here goes via sign-extension
> (effectively int -> int64_t -> uint64_t).
>
> Jan
>

Ok, in which case Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

  reply	other threads:[~2014-06-25 12:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24 14:25 [PATCH] VT-d/ATS: correct and clean up dev_invalidate_iotlb() Jan Beulich
2014-06-24 16:09 ` Andrew Cooper
2014-06-25 10:49   ` Jan Beulich
2014-06-25 12:50     ` Andrew Cooper [this message]
2014-06-30  8:35 ` Zhang, Yang Z

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=53AAC5B0.9070008@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yang.z.zhang@intel.com \
    /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.