mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
target/s390x/mmu_helper: Do not ignore address_space_rw() errors
If a address_space_rw() call ever fails, break the loop and return the PGM_ADDRESSING error (after triggering an access exception). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20251008141410.99865-3-philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
committed by
Thomas Huth
parent
02cf15e9bb
commit
d6f7f9254e
@@ -546,9 +546,15 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, uint8_t ar, void *hostbuf,
|
||||
|
||||
/* Copy data by stepping through the area page by page */
|
||||
for (i = 0; i < nr_pages; i++) {
|
||||
MemTxResult res;
|
||||
|
||||
currlen = MIN(len, TARGET_PAGE_SIZE - (laddr % TARGET_PAGE_SIZE));
|
||||
address_space_rw(as, pages[i] | (laddr & ~TARGET_PAGE_MASK),
|
||||
attrs, hostbuf, currlen, is_write);
|
||||
res = address_space_rw(as, pages[i] | (laddr & ~TARGET_PAGE_MASK),
|
||||
attrs, hostbuf, currlen, is_write);
|
||||
if (res != MEMTX_OK) {
|
||||
ret = PGM_ADDRESSING;
|
||||
break;
|
||||
}
|
||||
laddr += currlen;
|
||||
hostbuf += currlen;
|
||||
len -= currlen;
|
||||
|
||||
Reference in New Issue
Block a user