@samitouri / QOSamiQemu / commits / 7ca74dc98d

target/i386: Replace ldtul_p() -> ldn_p()

Prefer ldn_p(target_long_bits) over target-specific ldtul_p(). Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-ID: <20260219191955.83815-30-philmd@linaro.org>

Philippe Mathieu-Daudé committed Mar 25, 2025 at 16:43 UTC 7ca74dc98db4374bf26bb2824533f0c3daf329ba
1 file changed +3 -2
target/i386/gdbstub.c
+3 -2
@@ -459,6 +459,7 @@ static int i386_cpu_gdb_get_egprs(CPUState *cs, GByteArray *mem_buf, int n)
459
460 static int i386_cpu_gdb_set_egprs(CPUState *cs, uint8_t *mem_buf, int n)
461 {
462 + const unsigned regsz = target_long_bits() / 8;
463 CPUX86State *env = &X86_CPU(cs)->env;
464
465 if (n >= 0 && n < EGPR_NUM) {
@@ -467,7 +468,7 @@ static int i386_cpu_gdb_set_egprs(CPUState *cs, uint8_t *mem_buf, int n)
468 * XCR0[APX_F] (at least for modification in gdbstub) to be enabled.
469 */
470 if (env->hflags & HF_CS64_MASK && env->xcr0 & XSTATE_APX_MASK) {
470 - env->regs[gpr_map[n + CPU_NB_REGS]] = ldtul_p(mem_buf);
471 + env->regs[gpr_map[n + CPU_NB_REGS]] = ldn_p(mem_buf, regsz);
472
473 /*
474 * Per SDM Vol 1, "Processor Tracking of XSAVE-Managed State",
@@ -486,7 +487,7 @@ static int i386_cpu_gdb_set_egprs(CPUState *cs, uint8_t *mem_buf, int n)
487 env->xstate_bv |= XSTATE_APX_MASK;
488 }
489 }
489 - return sizeof(target_ulong);
490 + return regsz;
491 }
492 return 0;
493 }