]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
target/openrisc: Increase the TLB size
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 23 May 2018 05:04:46 +0000 (22:04 -0700)
committerStafford Horne <shorne@gmail.com>
Mon, 2 Jul 2018 15:05:28 +0000 (00:05 +0900)
The architecture supports 128 TLB entries.  There is no reason
not to provide all of them.  In the process we need to fix a
bug that failed to parameterize the configuration register that
tells the operating system the number of entries.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Stafford Horne <shorne@gmail.com>
---
v2:
  - Change VMState version.

target/openrisc/cpu.c
target/openrisc/cpu.h
target/openrisc/machine.c

index b92de51ecfbcc97a69b237e273b837fa9cd8c194..e01ce9ed1c0c0b2832cc2971d2f7159dc0864c5d 100644 (file)
@@ -57,8 +57,10 @@ static void openrisc_cpu_reset(CPUState *s)
 
     cpu->env.upr = UPR_UP | UPR_DMP | UPR_IMP | UPR_PICP | UPR_TTP |
                    UPR_PMP;
-    cpu->env.dmmucfgr = (DMMUCFGR_NTW & (0 << 2)) | (DMMUCFGR_NTS & (6 << 2));
-    cpu->env.immucfgr = (IMMUCFGR_NTW & (0 << 2)) | (IMMUCFGR_NTS & (6 << 2));
+    cpu->env.dmmucfgr = (DMMUCFGR_NTW & (0 << 2))
+                      | (DMMUCFGR_NTS & (ctz32(TLB_SIZE) << 2));
+    cpu->env.immucfgr = (IMMUCFGR_NTW & (0 << 2))
+                      | (IMMUCFGR_NTS & (ctz32(TLB_SIZE) << 2));
 
 #ifndef CONFIG_USER_ONLY
     cpu->env.picmr = 0x00000000;
index 47e94659e1ab0a954f8db21dfff70d02e4ce0bd0..b180e30e9e284c67f8c1dbd79daf748ab2dce920 100644 (file)
@@ -222,7 +222,7 @@ enum {
 
 /* TLB size */
 enum {
-    TLB_SIZE = 64,
+    TLB_SIZE = 128,
     TLB_MASK = TLB_SIZE - 1,
 };
 
index 3fc837b9257bc7d93216d64eb65488d08ad6b6fc..1eedbf3dbe466ab91d859a303c64ec33abaf3e6a 100644 (file)
@@ -38,9 +38,8 @@ static const VMStateDescription vmstate_tlb_entry = {
 
 static const VMStateDescription vmstate_cpu_tlb = {
     .name = "cpu_tlb",
-    .version_id = 1,
-    .minimum_version_id = 1,
-    .minimum_version_id_old = 1,
+    .version_id = 2,
+    .minimum_version_id = 2,
     .fields = (VMStateField[]) {
         VMSTATE_STRUCT_ARRAY(itlb, CPUOpenRISCTLBContext, TLB_SIZE, 0,
                              vmstate_tlb_entry, OpenRISCTLBEntry),