[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v12 04/13] virtio-iommu: Add the iommu regions
From: |
Auger Eric |
Subject: |
Re: [PATCH v12 04/13] virtio-iommu: Add the iommu regions |
Date: |
Tue, 14 Jan 2020 09:48:19 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
Hi Peter,
On 1/13/20 9:06 PM, Peter Xu wrote:
> On Thu, Jan 09, 2020 at 03:43:10PM +0100, Eric Auger wrote:
>> +/**
>> + * The bus number is used for lookup when SID based operations occur.
>> + * In that case we lazily populate the IOMMUPciBus array from the bus hash
>> + * table. At the time the IOMMUPciBus is created (iommu_find_add_as), the
>> bus
>> + * numbers may not be always initialized yet.
>> + */
>> +static IOMMUPciBus *iommu_find_iommu_pcibus(VirtIOIOMMU *s, uint8_t bus_num)
>> +{
>> + IOMMUPciBus *iommu_pci_bus = s->iommu_pcibus_by_bus_num[bus_num];
>> +
>> + if (!iommu_pci_bus) {
>> + GHashTableIter iter;
>> +
>> + g_hash_table_iter_init(&iter, s->as_by_busptr);
>> + while (g_hash_table_iter_next(&iter, NULL, (void
>> **)&iommu_pci_bus)) {
>> + if (pci_bus_num(iommu_pci_bus->bus) == bus_num) {
>> + s->iommu_pcibus_by_bus_num[bus_num] = iommu_pci_bus;
>> + return iommu_pci_bus;
>> + }
>> + }
>
> Btw, we may need to:
>
> return NULL;
Yes. By the way Yi's patch "intel_iommu: a fix to
vtd_find_as_from_bus_num()" also applies to SMMU code. I will send a patch.
Thanks
Eric
>
> here.
>
>> + }
>> + return iommu_pci_bus;
>> +}
>
- [PATCH v12 00/13] VIRTIO-IOMMU device, Eric Auger, 2020/01/09
- [PATCH v12 01/13] migration: Support QLIST migration, Eric Auger, 2020/01/09
- [PATCH v12 02/13] virtio-iommu: Add skeleton, Eric Auger, 2020/01/09
- [PATCH v12 03/13] virtio-iommu: Decode the command payload, Eric Auger, 2020/01/09
- [PATCH v12 04/13] virtio-iommu: Add the iommu regions, Eric Auger, 2020/01/09
- Re: [PATCH v12 04/13] virtio-iommu: Add the iommu regions, Peter Xu, 2020/01/13
- Re: [PATCH v12 04/13] virtio-iommu: Add the iommu regions,
Auger Eric <=
- [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Eric Auger, 2020/01/09
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Peter Xu, 2020/01/13
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Auger Eric, 2020/01/14
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Peter Xu, 2020/01/14
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Auger Eric, 2020/01/15
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Peter Xu, 2020/01/15
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Auger Eric, 2020/01/15
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Auger Eric, 2020/01/15
[PATCH v12 06/13] virtio-iommu: Implement attach/detach command, Eric Auger, 2020/01/09
[PATCH v12 07/13] virtio-iommu: Implement map/unmap, Eric Auger, 2020/01/09