qemu/target/hppa
Helge Deller 644ce5df2e target/hppa: Implement space register hashing for 64-bit HP-UX
The Linux kernel turns space-register hashing off unconditionally at
bootup.  That code was provided by HP at the beginning of the PA-RISC
Linux porting effort, and I don't know why it was decided then why Linux
should not use space register hashing.
32-bit HP-UX versions seem to not use space register hashing either.

But for 64-bit HP-UX versions, Sven Schnelle noticed that space register
hashing needs to be enabled and is required, otherwise the HP-UX kernel
will crash badly.

On 64-bit CPUs space register hashing is controlled by a bit in diagnose
register %dr2.  Since we want to support Linux and 32- and 64-bit HP-UX,
we need to fully emulate the diagnose registers and handle specifically
the bit in %dr2.

This patch adds the code to calculate the gva memory mask based on the
space-register hashing bit in %dr2 and the PSW_W (64-bit) flag.
The value is cached in the gva_offset_mask variable in CPUArchState
and recalculated at every modification of the CPU PSW or %dr2.

Signed-off-by: Helge Deller <deller@gmx.de>
Suggested-by: Sven Schnelle <svens@stackframe.org>
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2025-01-31 10:05:24 +01:00
..
cpu-param.h license: Update deprecated SPDX tag LGPL-2.0+ to LGPL-2.0-or-later 2024-09-20 10:11:59 +03:00
cpu-qom.h target: Move ArchCPUClass definition to 'cpu.h' 2023-11-07 13:08:48 +01:00
cpu.c target/hppa: Implement space register hashing for 64-bit HP-UX 2025-01-31 10:05:24 +01:00
cpu.h target/hppa: Implement space register hashing for 64-bit HP-UX 2025-01-31 10:05:24 +01:00
fpu_helper.c target/hppa: Set default NaN pattern explicitly 2024-12-11 15:31:05 +00:00
gdbstub.c linux-user/hppa: Force all code addresses to PRIV_USER 2024-05-15 10:03:44 +02:00
helper.c target/hppa: Implement space register hashing for 64-bit HP-UX 2025-01-31 10:05:24 +01:00
helper.h target/hppa: Implement space register hashing for 64-bit HP-UX 2025-01-31 10:05:24 +01:00
insns.decode target/hppa: Add instruction decoding for mfdiag and mtdiag 2025-01-30 13:37:20 +01:00
int_helper.c target/hppa: Implement space register hashing for 64-bit HP-UX 2025-01-31 10:05:24 +01:00
Kconfig meson: Introduce target-specific Kconfig 2021-07-09 18:21:34 +02:00
machine.c target/hppa: Add CPU diagnose registers 2025-01-30 13:37:20 +01:00
mem_helper.c target/hppa: Implement space register hashing for 64-bit HP-UX 2025-01-31 10:05:24 +01:00
meson.build meson: Rename target_softmmu_arch -> target_system_arch 2023-10-07 19:03:07 +02:00
op_helper.c accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (3/4) 2024-12-20 17:44:57 +01:00
sys_helper.c target/hppa: Implement space register hashing for 64-bit HP-UX 2025-01-31 10:05:24 +01:00
trace-events target/hppa: Add pa2.0 cpu local tlb flushes 2023-11-06 18:49:34 -08:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
translate.c target/hppa: Implement space register hashing for 64-bit HP-UX 2025-01-31 10:05:24 +01:00