[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/24] target/ppc: Remove type argument from get_bat_6xx_tlb
From: |
Richard Henderson |
Subject: |
[PATCH 10/24] target/ppc: Remove type argument from get_bat_6xx_tlb |
Date: |
Tue, 18 May 2021 15:11:32 -0500 |
We can now use MMU_INST_FETCH from access_type for this.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/ppc/mmu_helper.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c
index 506b0e4d90..0809210d3b 100644
--- a/target/ppc/mmu_helper.c
+++ b/target/ppc/mmu_helper.c
@@ -379,25 +379,22 @@ static inline void bat_size_prot(CPUPPCState *env,
target_ulong *blp,
}
static int get_bat_6xx_tlb(CPUPPCState *env, mmu_ctx_t *ctx,
- target_ulong virtual, MMUAccessType access_type,
- int type)
+ target_ulong virtual, MMUAccessType access_type)
{
target_ulong *BATlt, *BATut, *BATu, *BATl;
target_ulong BEPIl, BEPIu, bl;
int i, valid, prot;
int ret = -1;
+ bool ifetch = access_type == MMU_INST_FETCH;
LOG_BATS("%s: %cBAT v " TARGET_FMT_lx "\n", __func__,
- type == ACCESS_CODE ? 'I' : 'D', virtual);
- switch (type) {
- case ACCESS_CODE:
+ ifetch ? 'I' : 'D', virtual);
+ if (ifetch) {
BATlt = env->IBAT[1];
BATut = env->IBAT[0];
- break;
- default:
+ } else {
BATlt = env->DBAT[1];
BATut = env->DBAT[0];
- break;
}
for (i = 0; i < env->nb_BATs; i++) {
BATu = &BATut[i];
@@ -407,7 +404,7 @@ static int get_bat_6xx_tlb(CPUPPCState *env, mmu_ctx_t *ctx,
bat_size_prot(env, &bl, &valid, &prot, BATu, BATl);
LOG_BATS("%s: %cBAT%d v " TARGET_FMT_lx " BATu " TARGET_FMT_lx
" BATl " TARGET_FMT_lx "\n", __func__,
- type == ACCESS_CODE ? 'I' : 'D', i, virtual, *BATu, *BATl);
+ ifetch ? 'I' : 'D', i, virtual, *BATu, *BATl);
if ((virtual & 0xF0000000) == BEPIu &&
((virtual & 0x0FFE0000) & ~bl) == BEPIl) {
/* BAT matches */
@@ -441,7 +438,7 @@ static int get_bat_6xx_tlb(CPUPPCState *env, mmu_ctx_t *ctx,
LOG_BATS("%s: %cBAT%d v " TARGET_FMT_lx " BATu " TARGET_FMT_lx
" BATl " TARGET_FMT_lx "\n\t" TARGET_FMT_lx " "
TARGET_FMT_lx " " TARGET_FMT_lx "\n",
- __func__, type == ACCESS_CODE ? 'I' : 'D', i, virtual,
+ __func__, ifetch ? 'I' : 'D', i, virtual,
*BATu, *BATl, BEPIu, BEPIl, bl);
}
}
@@ -1415,7 +1412,7 @@ static int get_physical_address_wtlb(CPUPPCState *env,
mmu_ctx_t *ctx,
} else {
/* Try to find a BAT */
if (env->nb_BATs != 0) {
- ret = get_bat_6xx_tlb(env, ctx, eaddr, access_type, type);
+ ret = get_bat_6xx_tlb(env, ctx, eaddr, access_type);
}
if (ret < 0) {
/* We didn't match any BAT entry or don't have BATs */
--
2.25.1
- [PATCH 00/24] target/ppc: Clean up mmu translation, Richard Henderson, 2021/05/18
- [PATCH 01/24] target/ppc: Introduce prot_for_access_type, Richard Henderson, 2021/05/18
- [PATCH 02/24] target/ppc: Use MMUAccessType in mmu-radix64.c, Richard Henderson, 2021/05/18
- [PATCH 03/24] target/ppc: Use MMUAccessType in mmu-hash64.c, Richard Henderson, 2021/05/18
- [PATCH 04/24] target/ppc: Use MMUAccessType in mmu-hash32.c, Richard Henderson, 2021/05/18
- [PATCH 05/24] target/ppc: Rename access_type to type in mmu_helper.c, Richard Henderson, 2021/05/18
- [PATCH 07/24] target/ppc: Remove type argument from check_prot, Richard Henderson, 2021/05/18
- [PATCH 06/24] target/ppc: Use MMUAccessType in mmu_helper.c, Richard Henderson, 2021/05/18
- [PATCH 08/24] target/ppc: Remove type argument from ppc6xx_tlb_pte_check, Richard Henderson, 2021/05/18
- [PATCH 10/24] target/ppc: Remove type argument from get_bat_6xx_tlb,
Richard Henderson <=
- [PATCH 09/24] target/ppc: Remove type argument from ppc6xx_tlb_check, Richard Henderson, 2021/05/18
- [PATCH 11/24] target/ppc: Remove type argument from mmu40x_get_physical_address, Richard Henderson, 2021/05/18
- [PATCH 14/24] target/ppc: Remove type argument from mmubooke206_check_tlb, Richard Henderson, 2021/05/18
- [PATCH 12/24] target/ppc: Remove type argument from mmubooke_check_tlb, Richard Henderson, 2021/05/18
- [PATCH 13/24] target/ppc: Remove type argument from mmubooke_get_physical_address, Richard Henderson, 2021/05/18
- [PATCH 15/24] target/ppc: Remove type argument for mmubooke206_get_physical_address, Richard Henderson, 2021/05/18
- [PATCH 19/24] target/ppc: Use bool success for ppc_radix64_xlate, Richard Henderson, 2021/05/18
- [PATCH 16/24] target/ppc: Remove PowerPCCPUClass.handle_mmu_fault, Richard Henderson, 2021/05/18