On 21/12/25 13:25, Yao Zi wrote:
Reading/writing unimplemented IOCSR on real LoongArch hardware doesn't
trigger any exceptions, instead, reading always results in zero and
writing is simply ignored.

Real-world applications, like memtest86plus, depend on the behavior to
run. However, since commit f2e61edb2946 ("hw/loongarch/virt: Use
MemTxAttrs interface for misc ops") which adds a call to
g_assert_not_reached() in the path of handling unimplemented IOCSRs,
QEMU would abort in the case.

Replace the assertion with qemu_log_mask(LOG_UNIMP, ...), so these
applications could run. It's still possible to examine unimplemented
IOCSR access through "-d unimp" command line arguments.

Fixes: f2e61edb2946 ("hw/loongarch/virt: Use MemTxAttrs interface for misc ops")
Signed-off-by: Yao Zi <[email protected]>
---
  hw/loongarch/virt.c | 9 +++++++--
  1 file changed, 7 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>


Reply via email to