]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/hppa: Make number of TLB and BTLB entries configurable
authorHelge Deller <deller@gmx.de>
Thu, 27 Aug 2020 11:10:32 +0000 (13:10 +0200)
committerHelge Deller <deller@gmx.de>
Wed, 2 Sep 2020 21:16:48 +0000 (23:16 +0200)
Until now the TLB size was fixed at 256 entries. To allow operating
systems to utilize more TLB entries in the future, we need to tell
firmware how many TLB entries we actually support in the emulation.
Firmware then reports this to the operating system via the
PDC_CACHE_INFO call.

This patch simply does the preparation to allow more TLB entries.

Signed-off-by: Helge Deller <deller@gmx.de>
hw/hppa/machine.c
target/hppa/cpu.h

index 90aeefe2a44a9d7acf4a5ee416a8217d06198a32..e9d84d0f032d20f418810e38556414ae86fcf59b 100644 (file)
@@ -72,6 +72,14 @@ static FWCfgState *create_fw_cfg(MachineState *ms)
     fw_cfg_add_file(fw_cfg, "/etc/firmware-min-version",
                     g_memdup(&val, sizeof(val)), sizeof(val));
 
+    val = cpu_to_le64(HPPA_TLB_ENTRIES);
+    fw_cfg_add_file(fw_cfg, "/etc/cpu/tlb_entries",
+                    g_memdup(&val, sizeof(val)), sizeof(val));
+
+    val = cpu_to_le64(HPPA_BTLB_ENTRIES);
+    fw_cfg_add_file(fw_cfg, "/etc/cpu/btlb_entries",
+                    g_memdup(&val, sizeof(val)), sizeof(val));
+
     return fw_cfg;
 }
 
index 801a4fb1baebf22032b74a48149bc531d0fb70f6..fb6c59d07559fe437ef52914b41dd6af9e50ffa7 100644 (file)
@@ -196,9 +196,12 @@ struct CPUHPPAState {
     target_ureg shadow[7];   /* shadow registers */
 
     /* ??? The number of entries isn't specified by the architecture.  */
+#define HPPA_TLB_ENTRIES        256
+#define HPPA_BTLB_ENTRIES       0
+
     /* ??? Implement a unified itlb/dtlb for the moment.  */
     /* ??? We should use a more intelligent data structure.  */
-    hppa_tlb_entry tlb[256];
+    hppa_tlb_entry tlb[HPPA_TLB_ENTRIES];
     uint32_t tlb_last;
 };