[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v1 1/6] memory: allow memory_region_register_iommu
From: |
Auger Eric |
Subject: |
Re: [Qemu-arm] [PATCH v1 1/6] memory: allow memory_region_register_iommu_notifier() to fail |
Date: |
Thu, 19 Sep 2019 13:45:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
Hi Peter,
On 9/16/19 5:23 AM, Peter Xu wrote:
> On Fri, Sep 13, 2019 at 10:36:10AM +0200, Eric Auger wrote:
>> Currently, when a notifier is attempted to be registered and its
>> flags are not supported (especially the MAP one) by the IOMMU MR,
>> we generally abruptly exit in the IOMMU code. The failure could be
>> handled more nicely in the caller and especially in the VFIO code.
>>
>> So let's allow memory_region_register_iommu_notifier() to fail as
>> well as notify_flag_changed() callback.
>>
>> All sites implementing the callback are updated. This patch does
>> not yet remove the exit(1) in the intel_iommu and amd_iommu code.
>
> The idea looks sane to me, though how about using "Error **" instead
> of returning int (or, both)? Just like the majority of rest of QEMU.
None of the memory_region_register_iommu_notifier callsites would really
use the Error object and pass it up. I am a bit reluctant to add it if
not really used. There are still plenty of functions in the memory API
that do not use any Error handle. Anyway I will follow recommendations
if there is a consensus.
Thanks
Eric
>
> Regards,
>
- [Qemu-arm] [PATCH v1 0/6] Allow memory_region_register_iommu_notifier() to fail, Eric Auger, 2019/09/13
- [Qemu-arm] [PATCH v1 1/6] memory: allow memory_region_register_iommu_notifier() to fail, Eric Auger, 2019/09/13
- [Qemu-arm] [PATCH v1 2/6] vfio/common: Handle memory_region_register_iommu_notifier() failure, Eric Auger, 2019/09/13
- [Qemu-arm] [PATCH v1 3/6] exec: assert on memory_region_register_iommu_notifier() failure, Eric Auger, 2019/09/13
- [Qemu-arm] [PATCH v1 4/6] vhost: assert on memory_region_register_iommu_notifier() failure, Eric Auger, 2019/09/13
- [Qemu-arm] [PATCH v1 5/6] intel_iommu: Let vtd_iommu_notify_flag_changed() fail, Eric Auger, 2019/09/13
- [Qemu-arm] [PATCH v1 6/6] amd_iommu: Let amdvi_iommu_notify_flag_changed() fail, Eric Auger, 2019/09/13