[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH 1/2] backends/iommufd: Remove check on number of backend user
|
From: |
Duan, Zhenzhong |
|
Subject: |
RE: [PATCH 1/2] backends/iommufd: Remove check on number of backend users |
|
Date: |
Thu, 4 Jan 2024 01:53:47 +0000 |
>-----Original Message-----
>From: Cédric Le Goater <clg@redhat.com>
>Subject: Re: [PATCH 1/2] backends/iommufd: Remove check on number of
>backend users
>
>Hello Zhenzhong,
>
>On 1/3/24 02:40, Duan, Zhenzhong wrote:
>> Hi Cédric,
>>
>>> -----Original Message-----
>>> From: Cédric Le Goater <clg@redhat.com>
>>> Sent: Tuesday, January 2, 2024 8:32 PM
>>> To: qemu-devel@nongnu.org
>>> Cc: Liu, Yi L <yi.l.liu@intel.com>; Eric Auger <eric.auger@redhat.com>;
>Duan,
>>> Zhenzhong <zhenzhong.duan@intel.com>; Cédric Le Goater
>>> <clg@redhat.com>
>>> Subject: [PATCH 1/2] backends/iommufd: Remove check on number of
>>> backend users
>>>
>>> QOM already has a ref count on objects and it will assert much
>>> earlier, when INT_MAX is reached.
>>>
>>> Signed-off-by: Cédric Le Goater <clg@redhat.com>
>>
>> IIUC, /dev/iommu is opened on demand, be->users is used to catch
>underflow
>> or overflow due to mismatched iommufd_backend_connect/disconnect
>> pairs.
>>
>> It looks different from object ref count in purpose, but I agree
>> a correctly written code will never trigger such overflow/underflow.
>
>Well, we could limit the number of devices sharing the same iommufd
>backend but UINT32_MAX seems really too large and the object refcount
>will fail earlier anyhow. The max open files per process limit will
>also be reached before, since vfio opens a /dev/vfio/devices/vfiox
>file per device.
Clear, thanks Cédric.
>
>So, this check didn't seem necessary after all.
>
>> So, for the series:
>> Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
>
>You should reply to the cover letter with your R-b tag so that
>it applies on the whole series.
Sure.
BRs.
Zhenzhong
- [PATCH 0/2] backends/iommufd: Remove mutex, Cédric Le Goater, 2024/01/02
- [PATCH 2/2] backends/iommufd: Remove mutex, Cédric Le Goater, 2024/01/02
- Re: [PATCH 0/2] backends/iommufd: Remove mutex, Eric Auger, 2024/01/02
- RE: [PATCH 0/2] backends/iommufd: Remove mutex, Duan, Zhenzhong, 2024/01/03
- Re: [PATCH 0/2] backends/iommufd: Remove mutex, Cédric Le Goater, 2024/01/04