Skip to content

Commit aa4bb58

Browse files
ozbenhdgibson
authored andcommitted
ppc: Add mmu_model defines for arch 2.03 and 2.07
This removes unused POWERPC_MMU_2_06a/POWERPC_MMU_2_06d. This replaces POWERPC_MMU_64B with POWERPC_MMU_2_03 for POWER5+ to be more explicit about the version of the PowerISA supported. This defines POWERPC_MMU_2_07 and uses it for the POWER8 CPU family. This will not have an immediate effect now but it will in the following patch. This should cause no behavioural change. Signed-off-by: Benjamin Herrenschmidt <[email protected]> [aik: rebased, changed commit log] Signed-off-by: Alexey Kardashevskiy <[email protected]> Signed-off-by: David Gibson <[email protected]>
1 parent a23dec1 commit aa4bb58

File tree

5 files changed

+22
-20
lines changed

5 files changed

+22
-20
lines changed

target-ppc/cpu.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ enum powerpc_mmu_t {
117117
#define POWERPC_MMU_AMR 0x00040000
118118
/* 64 bits PowerPC MMU */
119119
POWERPC_MMU_64B = POWERPC_MMU_64 | 0x00000001,
120+
/* Architecture 2.03 and later (has LPCR) */
121+
POWERPC_MMU_2_03 = POWERPC_MMU_64 | 0x00000002,
120122
/* Architecture 2.06 variant */
121123
POWERPC_MMU_2_06 = POWERPC_MMU_64 | POWERPC_MMU_1TSEG
122124
| POWERPC_MMU_AMR | 0x00000003,
123-
/* Architecture 2.06 "degraded" (no 1T segments) */
124-
POWERPC_MMU_2_06a = POWERPC_MMU_64 | POWERPC_MMU_AMR
125-
| 0x00000003,
126-
/* Architecture 2.06 "degraded" (no 1T segments or AMR) */
127-
POWERPC_MMU_2_06d = POWERPC_MMU_64 | 0x00000003,
125+
/* Architecture 2.07 variant */
126+
POWERPC_MMU_2_07 = POWERPC_MMU_64 | POWERPC_MMU_1TSEG
127+
| POWERPC_MMU_AMR | 0x00000004,
128128
#endif /* defined(TARGET_PPC64) */
129129
};
130130

target-ppc/kvm.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ static void kvm_get_fallback_smmu_info(PowerPCCPU *cpu,
259259
info->flags |= KVM_PPC_1T_SEGMENTS;
260260
}
261261

262-
if (env->mmu_model == POWERPC_MMU_2_06) {
262+
if (env->mmu_model == POWERPC_MMU_2_06 ||
263+
env->mmu_model == POWERPC_MMU_2_07) {
263264
info->slb_size = 32;
264265
} else {
265266
info->slb_size = 64;
@@ -272,8 +273,9 @@ static void kvm_get_fallback_smmu_info(PowerPCCPU *cpu,
272273
info->sps[i].enc[0].pte_enc = 0;
273274
i++;
274275

275-
/* 64K on MMU 2.06 */
276-
if (env->mmu_model == POWERPC_MMU_2_06) {
276+
/* 64K on MMU 2.06 and later */
277+
if (env->mmu_model == POWERPC_MMU_2_06 ||
278+
env->mmu_model == POWERPC_MMU_2_07) {
277279
info->sps[i].page_shift = 16;
278280
info->sps[i].slb_enc = 0x110;
279281
info->sps[i].enc[0].page_shift = 16;

target-ppc/mmu_helper.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -1293,9 +1293,9 @@ void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUPPCState *env)
12931293
break;
12941294
#if defined(TARGET_PPC64)
12951295
case POWERPC_MMU_64B:
1296+
case POWERPC_MMU_2_03:
12961297
case POWERPC_MMU_2_06:
1297-
case POWERPC_MMU_2_06a:
1298-
case POWERPC_MMU_2_06d:
1298+
case POWERPC_MMU_2_07:
12991299
dump_slb(f, cpu_fprintf, env);
13001300
break;
13011301
#endif
@@ -1433,9 +1433,9 @@ hwaddr ppc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
14331433
switch (env->mmu_model) {
14341434
#if defined(TARGET_PPC64)
14351435
case POWERPC_MMU_64B:
1436+
case POWERPC_MMU_2_03:
14361437
case POWERPC_MMU_2_06:
1437-
case POWERPC_MMU_2_06a:
1438-
case POWERPC_MMU_2_06d:
1438+
case POWERPC_MMU_2_07:
14391439
return ppc_hash64_get_phys_page_debug(env, addr);
14401440
#endif
14411441

@@ -1937,9 +1937,9 @@ void ppc_tlb_invalidate_all(CPUPPCState *env)
19371937
case POWERPC_MMU_601:
19381938
#if defined(TARGET_PPC64)
19391939
case POWERPC_MMU_64B:
1940+
case POWERPC_MMU_2_03:
19401941
case POWERPC_MMU_2_06:
1941-
case POWERPC_MMU_2_06a:
1942-
case POWERPC_MMU_2_06d:
1942+
case POWERPC_MMU_2_07:
19431943
#endif /* defined(TARGET_PPC64) */
19441944
tlb_flush(CPU(cpu), 1);
19451945
break;
@@ -2011,9 +2011,9 @@ void ppc_tlb_invalidate_one(CPUPPCState *env, target_ulong addr)
20112011
break;
20122012
#if defined(TARGET_PPC64)
20132013
case POWERPC_MMU_64B:
2014+
case POWERPC_MMU_2_03:
20142015
case POWERPC_MMU_2_06:
2015-
case POWERPC_MMU_2_06a:
2016-
case POWERPC_MMU_2_06d:
2016+
case POWERPC_MMU_2_07:
20172017
/* tlbie invalidate TLBs for all segments */
20182018
/* XXX: given the fact that there are too many segments to invalidate,
20192019
* and we still don't have a tlb_flush_mask(env, n, mask) in QEMU,

target-ppc/translate.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -11327,9 +11327,9 @@ void ppc_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
1132711327
case POWERPC_MMU_SOFT_74xx:
1132811328
#if defined(TARGET_PPC64)
1132911329
case POWERPC_MMU_64B:
11330+
case POWERPC_MMU_2_03:
1133011331
case POWERPC_MMU_2_06:
11331-
case POWERPC_MMU_2_06a:
11332-
case POWERPC_MMU_2_06d:
11332+
case POWERPC_MMU_2_07:
1133311333
#endif
1133411334
cpu_fprintf(f, " SDR1 " TARGET_FMT_lx " DAR " TARGET_FMT_lx
1133511335
" DSISR " TARGET_FMT_lx "\n", env->spr[SPR_SDR1],

target-ppc/translate_init.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -8019,7 +8019,7 @@ POWERPC_FAMILY(POWER5P)(ObjectClass *oc, void *data)
80198019
(1ull << MSR_DR) |
80208020
(1ull << MSR_PMM) |
80218021
(1ull << MSR_RI);
8022-
pcc->mmu_model = POWERPC_MMU_64B;
8022+
pcc->mmu_model = POWERPC_MMU_2_03;
80238023
#if defined(CONFIG_SOFTMMU)
80248024
pcc->handle_mmu_fault = ppc_hash64_handle_mmu_fault;
80258025
#endif
@@ -8243,7 +8243,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data)
82438243
(1ull << MSR_PMM) |
82448244
(1ull << MSR_RI) |
82458245
(1ull << MSR_LE);
8246-
pcc->mmu_model = POWERPC_MMU_2_06;
8246+
pcc->mmu_model = POWERPC_MMU_2_07;
82478247
#if defined(CONFIG_SOFTMMU)
82488248
pcc->handle_mmu_fault = ppc_hash64_handle_mmu_fault;
82498249
#endif

0 commit comments

Comments
 (0)