On 5/15/2025 4:22 AM, David Hildenbrand wrote:
On 14.05.25 19:03, Cédric Le Goater wrote:
+ Paolo
+ David
+ Peter
+ Phil

On 5/12/25 22:51, John Levon wrote:
On Mon, May 12, 2025 at 08:32:37AM -0700, Steve Sistare wrote:

Modify memory_get_xlat_addr and vfio_get_xlat_addr to return the memory
region that the translated address is found in.  This will be needed by
CPR in a subsequent patch to map blocks using IOMMU_IOAS_MAP_FILE.

Also return the xlat offset, so we can simplify the interface by removing
the out parameters that can be trivially derived from mr and xlat.

Signed-off-by: Steve Sistare <steven.sist...@oracle.com>

Steve, would you consider splitting this out from the full CPR series and
submitting as a standalone, as we both have a dependency on doing this, and your
patch seems much nicer than the current one in vfio-user series?

May be we can merge this version if maintainers ack the change ?

The change itself looks good to me. Now that we want to return the mr from 
memory_get_xlat_addr(), why not make that the return type (NULL vs. ! NULL), to 
get rid of the boolean?

MemoryRegion *memory_get_xlat_addr(IOMMUTLBEntry *iotlb, hwaddr *xlat_p,
         Error **errp);

Same with "vfio_get_xlat_addr".

Of course, we could consider renaming both functions to something like

memory_translate_iotlb()
vfio_translate_iotlb()

Sure. I'll post those changes tomorrow unless someone tells me not to.

- Steve


Reply via email to