On 24/12/25 19:34, Manos Pitsidianakis wrote:
On Wed, Dec 24, 2025 at 5:14 PM Philippe Mathieu-Daudé
<[email protected]> wrote:

Commit 500131154d6 ("exec.c: Add new address_space_ld*/st*
functions") added a new API to fix a shortcoming of the
ld/st*_phys() API, which does blind bus access, not reporting
failure (and it also allow to provide transaction attributes).

Later commit 42874d3a8c6 ("Switch non-CPU callers from ld/st*_phys
to address_space_ld/st*") automatically converted the legacy uses
to the new API, not precising transaction attributes
(MEMTXATTRS_UNSPECIFIED) and ignoring the transation result (passing
NULL pointer as MemTxResult).

While this is a faithful replacement, without any logical change,
we later realized better is to not use MEMTXATTRS_UNSPECIFIED or
NULL MemTxResult, and adapt each call site on a pair basis, looking
at the device model datasheet to do the correct behavior (which is
unlikely to ignore transaction failures).

Since this is quite some work, we defer that to device model
maintainers. Meanwhile we introduce a definition, to allow a
target which removed all legacy API call to prohibit further
legacy API uses, named "TARGET_NOT_USING_LEGACY_LDST_PHYS_API".


Personally the negation (i.e. TARGET_USING_LEGACY_LDST_PHYS_API) would
make more sense since you're opting-in an API but that must be more
complex to introduce I guess?

Not much more complex, this was the previous approach (allow
all then opt out):
https://lore.kernel.org/qemu-devel/[email protected]/

But Pierrick suggested the less aggressive approach, opting
in, disturbing maintainers a bit less. In term of code churn
I expect the same lines of code amount to change.


In any case:

Reviewed-by: Manos Pitsidianakis <[email protected]>

Thanks!


Reply via email to