]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/sparc: Replace legacy st_phys() -> address_space_st()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 4 Feb 2026 21:44:39 +0000 (22:44 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 9 Feb 2026 19:51:52 +0000 (20:51 +0100)
Prefer the address_space_ld/st API over the legacy ld_phys()
because it allow checking for bus access fault.

get_physical_address() already accessed the PTE stored at
%pde_ptr and is going to update it. Assume the address space
is also writeable there. The SPARC v8 manual only mentions
faults (with error condition bits updated) in the READ path
but not on the WRITE (update) one.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260204215304.52757-2-philmd@linaro.org>

target/sparc/mmu_helper.c

index 5a58239d65e1edc880e8eb8d114a276445d6bf26..a6f76a1ab76d1ba26200785696121b8310936b29 100644 (file)
@@ -190,7 +190,9 @@ static int get_physical_address(CPUSPARCState *env, CPUTLBEntryFull *full,
         if (is_dirty) {
             pde |= PG_MODIFIED_MASK;
         }
-        stl_be_phys(cs->as, pde_ptr, pde);
+        address_space_stl_be(cs->as, pde_ptr, pde,
+                             MEMTXATTRS_UNSPECIFIED, &result);
+        assert(result == MEMTX_OK);
     }
 
     /* the page can be put in the TLB */