Skip to content

Commit

Permalink
target/openrisc: Increase the TLB size
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rth7680 authored and stffrdhrn committed Jul 2, 2018
1 parent 5ce5dad commit 1cc9e5d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 4 additions & 2 deletions target/openrisc/cpu.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion target/openrisc/cpu.h
Expand Up @@ -222,7 +222,7 @@ enum {

/* TLB size */
enum {
TLB_SIZE = 64,
TLB_SIZE = 128,
TLB_MASK = TLB_SIZE - 1,
};

Expand Down
5 changes: 2 additions & 3 deletions target/openrisc/machine.c
Expand Up @@ -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),
Expand Down

0 comments on commit 1cc9e5d

Please sign in to comment.