Re: [PATCH v16 2/3] vfio/pci: implement range_intesect_range to determine range overlap

From: Ankit Agrawal
Date: Thu Jan 18 2024 - 22:34:32 EST



>> Add a helper function to determine an overlap between two ranges.
>> If an overlap, the function returns the overlapping offset and size.
>>
>> The VFIO PCI variant driver emulates the PCI config space BAR offset
>> registers. These offset may be accessed for read/write with a variety
>> of lengths including sub-word sizes from sub-word offsets. The driver
>> makes use of this helper function to read/write the targeted part of
>> the emulated register.
>>
>> This is replicated from Yishai's work in
>> https://lore.kernel.org/all/20231207102820.74820-10-yishaih@xxxxxxxxxx
>
> The virtio-vfio-net changes have been accepted, so this will need to be
> rebased on the vfio next branch or v6.8-rc1 when Linus comes back
> online to process the pull request.  The revised patch should
> consolidate so that virtio-vfio-pci also uses the new shared function.

Thanks for pointing that out. I'll rebase it with v6.8-rc1.

> As noted by Rahul, the name should be updated to align with the
> vfio-pci-core namespace.  Kerneldoc would also be a nice addition since
> this is a somewhat complicated helper.  Thanks,

Ack.