[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 03/18] cputlb: used cached CPUClass in our hot-paths
From: |
Richard Henderson |
Subject: |
[PATCH v6 03/18] cputlb: used cached CPUClass in our hot-paths |
Date: |
Fri, 30 Sep 2022 14:26:07 -0700 |
From: Alex Bennée <alex.bennee@linaro.org>
Before: 35.912 s ± 0.168 s
After: 35.565 s ± 0.087 s
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220811151413.3350684-5-alex.bennee@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220923084803.498337-5-clg@kaod.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/cputlb.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 8fad2d9b83..193bfc1cfc 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1291,15 +1291,14 @@ void tlb_set_page(CPUState *cpu, target_ulong vaddr,
static void tlb_fill(CPUState *cpu, target_ulong addr, int size,
MMUAccessType access_type, int mmu_idx, uintptr_t retaddr)
{
- CPUClass *cc = CPU_GET_CLASS(cpu);
bool ok;
/*
* This is not a probe, so only valid return is success; failure
* should result in exception + longjmp to the cpu loop.
*/
- ok = cc->tcg_ops->tlb_fill(cpu, addr, size,
- access_type, mmu_idx, false, retaddr);
+ ok = cpu->cc->tcg_ops->tlb_fill(cpu, addr, size,
+ access_type, mmu_idx, false, retaddr);
assert(ok);
}
@@ -1307,9 +1306,8 @@ static inline void cpu_unaligned_access(CPUState *cpu,
vaddr addr,
MMUAccessType access_type,
int mmu_idx, uintptr_t retaddr)
{
- CPUClass *cc = CPU_GET_CLASS(cpu);
-
- cc->tcg_ops->do_unaligned_access(cpu, addr, access_type, mmu_idx, retaddr);
+ cpu->cc->tcg_ops->do_unaligned_access(cpu, addr, access_type,
+ mmu_idx, retaddr);
}
static inline void cpu_transaction_failed(CPUState *cpu, hwaddr physaddr,
@@ -1539,10 +1537,9 @@ static int probe_access_internal(CPUArchState *env,
target_ulong addr,
if (!tlb_hit_page(tlb_addr, page_addr)) {
if (!victim_tlb_hit(env, mmu_idx, index, elt_ofs, page_addr)) {
CPUState *cs = env_cpu(env);
- CPUClass *cc = CPU_GET_CLASS(cs);
- if (!cc->tcg_ops->tlb_fill(cs, addr, fault_size, access_type,
- mmu_idx, nonfault, retaddr)) {
+ if (!cs->cc->tcg_ops->tlb_fill(cs, addr, fault_size, access_type,
+ mmu_idx, nonfault, retaddr)) {
/* Non-faulting page table read failed. */
*phost = NULL;
return TLB_INVALID_MASK;
--
2.34.1
- [PATCH v6 00/18] tcg: CPUTLBEntryFull and TARGET_TB_PCREL, Richard Henderson, 2022/09/30
- [PATCH v6 01/18] cpu: cache CPUClass in CPUState for hot code paths, Richard Henderson, 2022/09/30
- [PATCH v6 02/18] hw/core/cpu-sysemu: used cached class in cpu_asidx_from_attrs, Richard Henderson, 2022/09/30
- [PATCH v6 03/18] cputlb: used cached CPUClass in our hot-paths,
Richard Henderson <=
- [PATCH v6 04/18] accel/tcg: Rename CPUIOTLBEntry to CPUTLBEntryFull, Richard Henderson, 2022/09/30
- [PATCH v6 05/18] accel/tcg: Drop addr member from SavedIOTLB, Richard Henderson, 2022/09/30
- [PATCH v6 06/18] accel/tcg: Suppress auto-invalidate in probe_access_internal, Richard Henderson, 2022/09/30
- [PATCH v6 07/18] accel/tcg: Introduce probe_access_full, Richard Henderson, 2022/09/30
- [PATCH v6 08/18] accel/tcg: Introduce tlb_set_page_full, Richard Henderson, 2022/09/30
- [PATCH v6 09/18] include/exec: Introduce TARGET_PAGE_ENTRY_EXTRA, Richard Henderson, 2022/09/30
- [PATCH v6 10/18] accel/tcg: Remove PageDesc code_bitmap, Richard Henderson, 2022/09/30
- [PATCH v6 11/18] accel/tcg: Use bool for page_find_alloc, Richard Henderson, 2022/09/30
- [PATCH v6 13/18] accel/tcg: Do not align tb->page_addr[0], Richard Henderson, 2022/09/30
- [PATCH v6 12/18] accel/tcg: Use DisasContextBase in plugin_gen_tb_start, Richard Henderson, 2022/09/30