On 5/9/2025 4:22 PM, Baolu Lu wrote:
> On 4/27/2025 10:26 AM, Chenyi Qiang wrote:
>> Hi David,
>>
>> Any thought on patch 10-12, which is to move the change attribute into a
>> priority listener. A problem is how to handle the error handling of
>> private_to_shared failure. Previously, we thought it would never be able
>> to fail, but right now, it is possible in corner cases (e.g. -ENOMEM) in
>> set_attribute_private(). At present, I simply raise an assert instead of
>> adding any rollback work (see patch 11).
>
> Do the pages need to be pinned when converting them to a shared state
> and unpinned when converting to a private state? Or is this handled
> within the vfio_state_change_notify callbacks?
I think it is handled in vfio_state_change_notify(). Just like the
device passthrough in legacy VM, the shared memory will be pinned during
vfio dma-map and unpin during unmap.
>
> Thanks,
> baolu