hw/hyperv: Replace legacy ld_phys() -> address_space_ld()
PATCH 1/1 hw/hyperv: Replace legacy ld_phys() -> address_space_ld()
Prefer the address_space_ld/st API over the legacy ld/st_phys() because it allow checking for bus access fault, which shouldn't happen here.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
--- hw/hyperv/hyperv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
hw/hyperv/hyperv.c +4 -1
@@ -704,13 +704,16 @@ uint16_t hyperv_hcall_signal_event(uint64_t param, bool fast)EventFlagHandler *handler;if (unlikely (!fast)) { +MemTxResult result;hwaddr addr = param;if (addr & (__alignof__(addr ) -1 )) {return HV_STATUS_INVALID_ALIGNMENT ; } - param =ldq_phys (&address_space_memory, addr); + param =address_space_ldq_le (&address_space_memory, addr, +MEMTXATTRS_UNSPECIFIED , &result); +assert (result ==MEMTX_OK ); }/*
Signature · 1 line
2.53.0
Quoted 21 lines · Philippe Mathieu-Daudé
Prefer the address_space_ld/st API over the legacy ld/st_phys() because it allow checking for bus access fault, which shouldn't happen here.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/hyperv/hyperv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)hw/hyperv/hyperv.c +1
-0@@ -704,13 +704,16 @@ uint16_t hyperv_hcall_signal_event(uint64_t param, bool fast)EventFlagHandler *handler;if (unlikely (!fast)) { +MemTxResult result;hwaddr addr = param;if (addr & (__alignof__(addr ) -1 )) {
hw/hyperv/hyperv.c uint16_t hyperv_hcall_signal_event(uint64_t param, bool fast) · line 719
Quoted 10 lines
hw/hyperv/hyperv.c +3
-1return HV_STATUS_INVALID_ALIGNMENT ; } - param =ldq_phys (&address_space_memory, addr); + param =address_space_ldq_le (&address_space_memory, addr, +MEMTXATTRS_UNSPECIFIED , &result); +assert (result ==MEMTX_OK ); }/*
Thanks,
Maciej
Quoted 8 lines · Philippe Mathieu-Daudé
Prefer the address_space_ld/st API over the legacy ld/st_phys() because it allow checking for bus access fault, which shouldn't happen here.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/hyperv/hyperv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Patch queued via hw-misc, thanks!