[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 08/41] intel_iommu: support device iotlb descript
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PULL 08/41] intel_iommu: support device iotlb descriptor |
Date: |
Thu, 19 Jan 2017 10:07:37 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
On 19/01/2017 04:32, Jason Wang wrote:
>>
>>>
>>>> + addr &= ~(sz - 1);
>>>> + } else {
>>>> + sz = VTD_PAGE_SIZE;
>>>> + }
>>>> + entry.target_as = &vtd_dev_as->as;
>>>> + entry.addr_mask = sz - 1;
>>>> + entry.iova = addr;
>>> If S=1, entry.iova must mask away the 1 bits that specified the size.
>>> For example,
>>>
>>> addr = 0xabcd1000
>>>
>>> has cto64(0xabcd1) == 1, so it indicates a 16K invalidation from
>>> 0xabcd0000 to 0xabcd3fff. The "1" must be masked away with "addr & -sz"
>>> or "addr & ~entry.addr_mask".
>>>
>>> Thanks,
>>>
>>> Paolo
>>
>> Good catch.
>
> It should be addr & ~(sz - 1) I think? And it has been done above :)
Oh, of course!
Paolo
- Re: [Qemu-devel] [PULL 04/41] virtio: convert to use DMA api, (continued)
[Qemu-devel] [PULL 07/41] exec: introduce address_space_get_iotlb_entry(), Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 08/41] intel_iommu: support device iotlb descriptor, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 09/41] virtio-pci: address space translation service (ATS) support, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 10/41] acpi: add ATSR for q35, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 11/41] memory: handle alias for iommu notifier, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 12/41] memory: handle alias in memory_region_is_iommu(), Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 13/41] doc/pcie: correct command line examples, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 14/41] virtio-crypto: use the correct length for cipher operation, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 15/41] cryptodev: introduce a new is_used property, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 16/41] cryptodev: wrap the ready flag, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 17/41] virtio-crypto-pci: add check for cryptodev object, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 18/41] virtio-crypto: avoid one cryptodev device is used by multiple virtio crypto devices, Michael S. Tsirkin, 2017/01/10