[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/14] target/i386: Direct call get_hphys from mmu_translate
From: |
Richard Henderson |
Subject: |
[PATCH 08/14] target/i386: Direct call get_hphys from mmu_translate |
Date: |
Mon, 22 Aug 2022 16:57:57 -0700 |
Use a boolean to control the call to get_hphys instead
of passing a null function pointer.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/i386/tcg/sysemu/excp_helper.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/target/i386/tcg/sysemu/excp_helper.c
b/target/i386/tcg/sysemu/excp_helper.c
index 414d8032de..ea195f7a28 100644
--- a/target/i386/tcg/sysemu/excp_helper.c
+++ b/target/i386/tcg/sysemu/excp_helper.c
@@ -24,14 +24,10 @@
#define PG_ERROR_OK (-1)
-typedef hwaddr (*MMUTranslateFunc)(CPUState *cs, hwaddr gphys, MMUAccessType
access_type,
- int *prot);
-
#define GET_HPHYS(cs, gpa, access_type, prot) \
- (get_hphys_func ? get_hphys_func(cs, gpa, access_type, prot) : gpa)
+ (use_stage2 ? get_hphys(cs, gpa, access_type, prot) : gpa)
-static int mmu_translate(CPUState *cs, hwaddr addr,
- MMUTranslateFunc get_hphys_func,
+static int mmu_translate(CPUState *cs, hwaddr addr, bool use_stage2,
uint64_t cr3, MMUAccessType access_type,
int mmu_idx, int pg_mode,
hwaddr *xlat, int *page_size, int *prot)
@@ -329,7 +325,7 @@ hwaddr get_hphys(CPUState *cs, hwaddr gphys, MMUAccessType
access_type,
return gphys;
}
- exit_info_1 = mmu_translate(cs, gphys, NULL, env->nested_cr3,
+ exit_info_1 = mmu_translate(cs, gphys, false, env->nested_cr3,
access_type, MMU_USER_IDX, env->nested_pg_mode,
&hphys, &page_size, &next_prot);
if (exit_info_1 == PG_ERROR_OK) {
@@ -395,7 +391,7 @@ static int handle_mmu_fault(CPUState *cs, vaddr addr, int
size,
}
}
- error_code = mmu_translate(cs, addr, get_hphys, env->cr[3],
access_type,
+ error_code = mmu_translate(cs, addr, true, env->cr[3], access_type,
mmu_idx, pg_mode,
&paddr, &page_size, &prot);
}
--
2.34.1
- [PATCH 00/14] target/i386: Use atomic operations for pte updates, Richard Henderson, 2022/08/22
- [PATCH 01/14] accel/tcg: Rename CPUIOTLBEntry to CPUTLBEntryFull, Richard Henderson, 2022/08/22
- [PATCH 02/14] accel/tcg: Drop addr member from SavedIOTLB, Richard Henderson, 2022/08/22
- [PATCH 04/14] accel/tcg: Introduce probe_access_full, Richard Henderson, 2022/08/22
- [PATCH 06/14] include/exec: Introduce TARGET_PAGE_ENTRY_EXTRA, Richard Henderson, 2022/08/22
- [PATCH 03/14] accel/tcg: Suppress auto-invalidate in probe_access_internal, Richard Henderson, 2022/08/22
- [PATCH 05/14] accel/tcg: Introduce tlb_set_page_full, Richard Henderson, 2022/08/22
- [PATCH 08/14] target/i386: Direct call get_hphys from mmu_translate,
Richard Henderson <=
- [PATCH 07/14] target/i386: Use MMUAccessType across excp_helper.c, Richard Henderson, 2022/08/22
- [PATCH 14/14] target/i386: Use atomic operations for pte updates, Richard Henderson, 2022/08/22
- [PATCH 11/14] target/i386: Add MMU_PHYS_IDX and MMU_NESTED_IDX, Richard Henderson, 2022/08/22
- [PATCH 10/14] target/i386: Reorg GET_HPHYS, Richard Henderson, 2022/08/22
- [PATCH 09/14] target/i386: Introduce structures for mmu_translate, Richard Henderson, 2022/08/22
- [PATCH 13/14] target/i386: Combine 5 sets of variables in mmu_translate, Richard Henderson, 2022/08/22
- [PATCH 12/14] target/i386: Use MMU_NESTED_IDX for vmload/vmsave, Richard Henderson, 2022/08/22
- Re: [PATCH 00/14] target/i386: Use atomic operations for pte updates, Richard Henderson, 2022/08/22