[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/53] target/i386: Direct call get_hphys from mmu_translate
From: |
Paolo Bonzini |
Subject: |
[PULL 10/53] target/i386: Direct call get_hphys from mmu_translate |
Date: |
Tue, 18 Oct 2022 15:29:59 +0200 |
From: Richard Henderson <richard.henderson@linaro.org>
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>
Message-Id: <20221002172956.265735-3-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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 eee59aa977..c9f6afba29 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.37.3
- [PULL 00/53] target/i386, scsi, build patches for 2022-10-18, Paolo Bonzini, 2022/10/18
- [PULL 01/53] virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events, Paolo Bonzini, 2022/10/18
- [PULL 02/53] configure: don't enable firmware for targets that are not built, Paolo Bonzini, 2022/10/18
- [PULL 03/53] scsi: Use device_cold_reset() and bus_cold_reset(), Paolo Bonzini, 2022/10/18
- [PULL 05/53] hyperv: fix SynIC SINT assertion failure on guest reset, Paolo Bonzini, 2022/10/18
- [PULL 08/53] target/i386: Save and restore pc_save before tcg_remove_ops_after, Paolo Bonzini, 2022/10/18
- [PULL 07/53] target/i386: Use device_cold_reset() to reset the APIC, Paolo Bonzini, 2022/10/18
- [PULL 10/53] target/i386: Direct call get_hphys from mmu_translate,
Paolo Bonzini <=
- [PULL 11/53] target/i386: Introduce structures for mmu_translate, Paolo Bonzini, 2022/10/18
- [PULL 06/53] configure: Avoid using strings binary, Paolo Bonzini, 2022/10/18
- [PULL 04/53] hw/scsi/vmw_pvscsi.c: Use device_cold_reset() to reset SCSI devices, Paolo Bonzini, 2022/10/18
- [PULL 09/53] target/i386: Use MMUAccessType across excp_helper.c, Paolo Bonzini, 2022/10/18
- [PULL 12/53] target/i386: Reorg GET_HPHYS, Paolo Bonzini, 2022/10/18
- [PULL 13/53] target/i386: Add MMU_PHYS_IDX and MMU_NESTED_IDX, Paolo Bonzini, 2022/10/18
- [PULL 14/53] target/i386: Use MMU_NESTED_IDX for vmload/vmsave, Paolo Bonzini, 2022/10/18
- [PULL 15/53] target/i386: Combine 5 sets of variables in mmu_translate, Paolo Bonzini, 2022/10/18
- [PULL 16/53] target/i386: Use atomic operations for pte updates, Paolo Bonzini, 2022/10/18
- [PULL 17/53] target/i386: Use probe_access_full for final stage2 translation, Paolo Bonzini, 2022/10/18