aboutsummaryrefslogtreecommitdiff
path: root/src/parisc/parisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parisc/parisc.c')
-rw-r--r--src/parisc/parisc.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index 8aec3bc..c5afbf4 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -1656,9 +1656,19 @@ static int pdc_cache(unsigned long *arg)
memcpy(result, machine_cache_info, sizeof(*machine_cache_info));
return PDC_OK;
- case PDC_CACHE_RET_SPID: /* returns space-ID bits when sr-hasing is enabled */
- memset(result, 0, 32 * sizeof(unsigned long));
- result[0] = 0;
+ case PDC_CACHE_RET_SPID:
+ /*
+ * Return space-ID bits when space register hashing is enabled.
+ * The Linux kernel disables sr-hashing, while HP-UX 11 (64-bit) uses hashing.
+ * For details check the assembly in arch/parisc/kernel/pacache.S in the Linux kernel
+ * and read some analysis here:
+ * https://patchwork.ozlabs.org/project/qemu-devel/patch/20240324080945.991100-3-svens@stackframe.org/#3289160
+ */
+ extern long sr_hashing_enabled(void);
+ if (sr_hashing_enabled() == 0)
+ result[0] = 0;
+ else
+ result[0] = 0xfe0;
return PDC_OK;
}
dprintf(0, "\n\nSeaBIOS: Unimplemented PDC_CACHE function %ld %lx %lx %lx %lx\n", ARG1, ARG2, ARG3, ARG4, ARG5);