|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 02/18] system/memory: Better describe @plen argument of flatview_translate()
Hi Thomas, On 30/9/25 10:24, Thomas Huth wrote: On 30/09/2025 10.21, Philippe Mathieu-Daudé wrote:flatview_translate()'s @plen argument is output-only and can be NULL. When Xen is enabled, only update @plen_out when non-NULL. Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx> --- include/system/memory.h | 5 +++-- system/physmem.c | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/system/memory.h b/include/system/memory.h index aa85fc27a10..3e5bf3ef05e 100644 --- a/include/system/memory.h +++ b/include/system/memory.h@@ -2992,13 +2992,14 @@ IOMMUTLBEntry address_space_get_iotlb_entry(AddressSpace *as, hwaddr addr,* @addr: address within that address space* @xlat: pointer to address within the returned memory region section's* #MemoryRegion. - * @len: pointer to length+ * @plen_out: pointer to valid read/write length of the translated address.+ * It can be @NULL when we don't care about it. * @is_write: indicates the transfer direction * @attrs: memory attributes */ MemoryRegion *flatview_translate(FlatView *fv, hwaddr addr, hwaddr *xlat, - hwaddr *len, bool is_write, + hwaddr *plen_out, bool is_write, MemTxAttrs attrs); static inline MemoryRegion *address_space_translate(AddressSpace *as, diff --git a/system/physmem.c b/system/physmem.c index 8a8be3a80e2..86422f294e2 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -566,7 +566,7 @@ iotlb_fail: /* Called from RCU critical section */MemoryRegion *flatview_translate(FlatView *fv, hwaddr addr, hwaddr *xlat,
This patches
- checks for plen not being NULL
- describes it as
"When Xen is enabled, only update @plen_out when non-NULL."
- mention that in the updated flatview_translate() documentation
"It can be @NULL when we don't care about it." as documented for
the flatview_do_translate() callee in commit d5e5fafd11b ("exec:
add page_mask for flatview_do_translate")
before:
it was not clear whether we can pass plen=NULL without having
to look at the code.
after:
no change when plen is not NULL, we can pass plen=NULL safely
(it is documented).
I shouldn't be understanding your original question, do you mind
rewording it?
Thanks,
Phil.
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |