[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 29/48] target/ppc/mmu_common.c: Remove pte_update_flags()
From: |
BALATON Zoltan |
Subject: |
[PATCH v6 29/48] target/ppc/mmu_common.c: Remove pte_update_flags() |
Date: |
Sat, 11 May 2024 03:46:09 +0200 (CEST) |
This function is used only once, its return value is ignored and one
of its parameter is a return value from a previous call. It is better
to inline it in the caller and remove it.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
target/ppc/mmu_common.c | 41 +++++++++++++----------------------------
1 file changed, 13 insertions(+), 28 deletions(-)
diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c
index 23005fdea4..438d4c83b0 100644
--- a/target/ppc/mmu_common.c
+++ b/target/ppc/mmu_common.c
@@ -139,39 +139,14 @@ static int ppc6xx_tlb_pte_check(mmu_ctx_t *ctx,
target_ulong pte0,
return ret;
}
-static int pte_update_flags(mmu_ctx_t *ctx, target_ulong *pte1p,
- int ret, MMUAccessType access_type)
-{
- int store = 0;
-
- /* Update page flags */
- if (!(*pte1p & 0x00000100)) {
- /* Update accessed flag */
- *pte1p |= 0x00000100;
- store = 1;
- }
- if (!(*pte1p & 0x00000080)) {
- if (access_type == MMU_DATA_STORE && ret == 0) {
- /* Update changed flag */
- *pte1p |= 0x00000080;
- store = 1;
- } else {
- /* Force page fault for first write access */
- ctx->prot &= ~PAGE_WRITE;
- }
- }
-
- return store;
-}
-
/* Software driven TLB helpers */
static int ppc6xx_tlb_check(CPUPPCState *env, mmu_ctx_t *ctx,
target_ulong eaddr, MMUAccessType access_type)
{
ppc6xx_tlb_t *tlb;
- int nr, best, way;
- int ret;
+ target_ulong *pte1p;
+ int nr, best, way, ret;
best = -1;
ret = -1; /* No TLB found */
@@ -224,7 +199,17 @@ done:
" prot=%01x ret=%d\n",
ctx->raddr & TARGET_PAGE_MASK, ctx->prot, ret);
/* Update page flags */
- pte_update_flags(ctx, &env->tlb.tlb6[best].pte1, ret, access_type);
+ pte1p = &env->tlb.tlb6[best].pte1;
+ *pte1p |= 0x00000100; /* Update accessed flag */
+ if (!(*pte1p & 0x00000080)) {
+ if (access_type == MMU_DATA_STORE && ret == 0) {
+ /* Update changed flag */
+ *pte1p |= 0x00000080;
+ } else {
+ /* Force page fault for first write access */
+ ctx->prot &= ~PAGE_WRITE;
+ }
+ }
}
#if defined(DUMP_PAGE_TABLES)
if (qemu_loglevel_mask(CPU_LOG_MMU)) {
--
2.30.9
- [PATCH v6 00/48] Misc PPC exception and BookE MMU clean ups, BALATON Zoltan, 2024/05/10
- [PATCH v6 03/48] target/ppc/mmu_common.c: Move calculation of a value closer to its usage, BALATON Zoltan, 2024/05/10
- [PATCH v6 04/48] target/ppc/mmu_common.c: Remove unneeded local variable, BALATON Zoltan, 2024/05/10
- [PATCH v6 02/48] target/ppc: Remove unused helper, BALATON Zoltan, 2024/05/10
- [PATCH v6 01/48] target/ppc: Remove unused struct 'mmu_ctx_hash32', BALATON Zoltan, 2024/05/10
- [PATCH v6 05/48] target/ppc/mmu_common.c: Simplify checking for real mode, BALATON Zoltan, 2024/05/10
- [PATCH v6 06/48] target/ppc/mmu_common.c: Drop cases for unimplemented MPC8xx MMU, BALATON Zoltan, 2024/05/10
- [PATCH v6 12/48] target/ppc/mmu_common.c: Split off real mode cases in get_physical_address_wtlb(), BALATON Zoltan, 2024/05/10
- [PATCH v6 11/48] target/ppc/mmu_common.c: Split out BookE cases before checking real mode, BALATON Zoltan, 2024/05/10
- [PATCH v6 10/48] target/ppc/mmu_common.c: Eliminate ret from mmu6xx_get_physical_address(), BALATON Zoltan, 2024/05/10
- [PATCH v6 29/48] target/ppc/mmu_common.c: Remove pte_update_flags(),
BALATON Zoltan <=
- [PATCH v6 14/48] target/ppc/mmu_common.c: Fix misindented qemu_log_mask() calls, BALATON Zoltan, 2024/05/10
- [PATCH v6 13/48] target/ppc/mmu_common.c: Inline and remove check_physical(), BALATON Zoltan, 2024/05/10
- [PATCH v6 32/48] target/ppc/mmu-hash32.c: Drop a local variable, BALATON Zoltan, 2024/05/10
- [PATCH v6 18/48] target/ppc/mmu_common.c: Don't use mmu_ctx_t in mmubooke_get_physical_address(), BALATON Zoltan, 2024/05/10
- [PATCH v6 22/48] target/ppc/mmu_common.c: Split off BookE handling from ppc_jumbo_xlate(), BALATON Zoltan, 2024/05/10
- [PATCH v6 15/48] target/ppc/mmu_common.c: Deindent ppc_jumbo_xlate(), BALATON Zoltan, 2024/05/10
- [PATCH v6 27/48] target/ppc/mmu_common.c: Transform ppc_jumbo_xlate() into ppc_6xx_xlate(), BALATON Zoltan, 2024/05/10
- [PATCH v6 21/48] target/ppc/mmu_common.c: Remove BookE from direct store handling, BALATON Zoltan, 2024/05/10
- [PATCH v6 16/48] target/ppc/mmu_common.c: Replace hard coded constants in ppc_jumbo_xlate(), BALATON Zoltan, 2024/05/10
- [PATCH v6 07/48] target/ppc/mmu_common.c: Introduce mmu6xx_get_physical_address(), BALATON Zoltan, 2024/05/10