@samitouri / QOSamiQemu / commits / eca25ddb32

target/ppc: Replace TARGET_PAGE_BITS -> qemu_target_page_bits()

Get the target page bits at runtime. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-Id: <20260313062055.2188-3-philmd@linaro.org>

Philippe Mathieu-Daudé committed Mar 13, 2026 at 05:09 UTC eca25ddb32c9cd568a027dd37d5705a4f00d9349
3 files changed +6 -3
target/ppc/mmu-booke.c
+2 -1
@@ -19,6 +19,7 @@
19
20 #include "qemu/osdep.h"
21 #include "exec/page-protection.h"
22 +#include "exec/target_page.h"
23 #include "exec/log.h"
24 #include "cpu.h"
25 #include "internal.h"
@@ -492,7 +493,7 @@ bool ppc_booke_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType access_type,
493 if (ret == 0) {
494 *raddrp = raddr;
495 *protp = prot;
495 - *psizep = TARGET_PAGE_BITS;
496 + *psizep = qemu_target_page_bits();
497 return true;
498 } else if (!guest_visible) {
499 return false;
target/ppc/mmu-hash64.c
+2 -1
@@ -21,6 +21,7 @@
21 #include "qemu/units.h"
22 #include "cpu.h"
23 #include "exec/page-protection.h"
24 +#include "exec/target_page.h"
25 #include "qemu/error-report.h"
26 #include "qemu/qemu-print.h"
27 #include "system/hw_accel.h"
@@ -1065,7 +1066,7 @@ bool ppc_hash64_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType access_type,
1066
1067 *raddrp = raddr;
1068 *protp = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
1068 - *psizep = TARGET_PAGE_BITS;
1069 + *psizep = qemu_target_page_bits();
1070 return true;
1071 }
1072
target/ppc/mmu-radix64.c
+2 -1
@@ -20,6 +20,7 @@
20 #include "qemu/osdep.h"
21 #include "cpu.h"
22 #include "exec/page-protection.h"
23 +#include "exec/target_page.h"
24 #include "qemu/error-report.h"
25 #include "system/kvm.h"
26 #include "system/memory.h"
@@ -717,7 +718,7 @@ static bool ppc_radix64_xlate_impl(PowerPCCPU *cpu, vaddr eaddr,
718 }
719 }
720 *protp = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
720 - *psizep = TARGET_PAGE_BITS;
721 + *psizep = qemu_target_page_bits();
722 return true;
723 }
724