mbox series

[v2,0/2] Two minor fixes on virtio-iommu and smmu

Message ID 20240125073706.339369-1-zhenzhong.duan@intel.com (mailing list archive)
Headers show
Series Two minor fixes on virtio-iommu and smmu | expand

Message

Duan, Zhenzhong Jan. 25, 2024, 7:37 a.m. UTC
Hi,

PATCH1 fixes a potential issue with vfio devices when reboot to a
different OS which set bus number differently from previous OS.
I didn't reproduce the issue in reality, but it's still possible
in theory. VTD doesn't have same issue as it use some verify logic
to ensure right iommu MR is picked.

PATCH2 does same thing for smmu.

v2:
- Remove redundant memset in realize (Cédric)
- Add a patch for smmu (Eric)
- Drop the patch to support PCI device alias for now, as it's tricky in
  using two different IOMMU MRs and Eric already sent a smarter fix.


Thanks
Zhenzhong

Zhenzhong Duan (2):
  virtio_iommu: Clear IOMMUPciBus pointer cache when system reset
  smmu: Clear SMMUPciBus pointer cache when system reset

 hw/arm/smmu-common.c     | 2 ++
 hw/virtio/virtio-iommu.c | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Eric Auger Jan. 29, 2024, 9:27 a.m. UTC | #1
Hi Zhenzhong,

On 1/25/24 08:37, Zhenzhong Duan wrote:
> Hi,
>
> PATCH1 fixes a potential issue with vfio devices when reboot to a
> different OS which set bus number differently from previous OS.
> I didn't reproduce the issue in reality, but it's still possible
> in theory. VTD doesn't have same issue as it use some verify logic
> to ensure right iommu MR is picked.
>
> PATCH2 does same thing for smmu.
>
> v2:
> - Remove redundant memset in realize (Cédric)
> - Add a patch for smmu (Eric)
> - Drop the patch to support PCI device alias for now, as it's tricky in
>   using two different IOMMU MRs and Eric already sent a smarter fix.

For the series:

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>

Thanks

Eric

>
>
> Thanks
> Zhenzhong
>
> Zhenzhong Duan (2):
>   virtio_iommu: Clear IOMMUPciBus pointer cache when system reset
>   smmu: Clear SMMUPciBus pointer cache when system reset
>
>  hw/arm/smmu-common.c     | 2 ++
>  hw/virtio/virtio-iommu.c | 4 ++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
Duan, Zhenzhong Jan. 29, 2024, 9:41 a.m. UTC | #2
>-----Original Message-----
>From: Eric Auger <eric.auger@redhat.com>
>Subject: Re: [PATCH v2 0/2] Two minor fixes on virtio-iommu and smmu
>
>Hi Zhenzhong,
>
>On 1/25/24 08:37, Zhenzhong Duan wrote:
>> Hi,
>>
>> PATCH1 fixes a potential issue with vfio devices when reboot to a
>> different OS which set bus number differently from previous OS.
>> I didn't reproduce the issue in reality, but it's still possible
>> in theory. VTD doesn't have same issue as it use some verify logic
>> to ensure right iommu MR is picked.
>>
>> PATCH2 does same thing for smmu.
>>
>> v2:
>> - Remove redundant memset in realize (Cédric)
>> - Add a patch for smmu (Eric)
>> - Drop the patch to support PCI device alias for now, as it's tricky in
>>   using two different IOMMU MRs and Eric already sent a smarter fix.
>
>For the series:
>
>Reviewed-by: Eric Auger <eric.auger@redhat.com>
>Tested-by: Eric Auger <eric.auger@redhat.com>

Thanks Eric.

BRs.
Zhenzhong