[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V2 3/7] cputlb: fix the way get_page_addr_code fills
From: |
fred . konrad |
Subject: |
[Qemu-devel] [PATCH V2 3/7] cputlb: fix the way get_page_addr_code fills the tlb |
Date: |
Fri, 17 Feb 2017 21:17:09 +0100 |
From: KONRAD Frederic <address@hidden>
get_page_addr_code(..) does a cpu_ldub_code to fill the tlb:
This can lead to some side effects if a device is mapped at this address.
So this patch replaces the cpu_memory_ld by a tlb_fill.
Signed-off-by: KONRAD Frederic <address@hidden>
---
cputlb.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/cputlb.c b/cputlb.c
index b3a5f47..846341e 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -534,8 +534,10 @@ tb_page_addr_t get_page_addr_code(CPUArchState *env,
target_ulong addr)
index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
mmu_idx = cpu_mmu_index(env, true);
if (unlikely(env->tlb_table[mmu_idx][index].addr_code !=
- (addr & TARGET_PAGE_MASK))) {
- cpu_ldub_code(env, addr);
+ (addr & (TARGET_PAGE_MASK | TLB_INVALID_MASK)))) {
+ if (!VICTIM_TLB_HIT(addr_read, addr)) {
+ tlb_fill(ENV_GET_CPU(env), addr, MMU_INST_FETCH, mmu_idx, 0);
+ }
}
iotlbentry = &env->iotlb[mmu_idx][index];
pd = iotlbentry->addr & ~TARGET_PAGE_MASK;
--
1.8.3.1
- [Qemu-devel] [PATCH V2 0/7] execute code from mmio area, fred . konrad, 2017/02/17
- [Qemu-devel] [PATCH V2 5/7] qdev: add MemoryRegion property, fred . konrad, 2017/02/17
- [Qemu-devel] [PATCH V2 2/7] cputlb: move get_page_addr_code, fred . konrad, 2017/02/17
- [Qemu-devel] [PATCH V2 4/7] exec: allow to get a pointer for some mmio memory region, fred . konrad, 2017/02/17
- [Qemu-devel] [PATCH V2 3/7] cputlb: fix the way get_page_addr_code fills the tlb,
fred . konrad <=
- [Qemu-devel] [PATCH V2 7/7] xilinx_spips: allow mmio execution, fred . konrad, 2017/02/17
- [Qemu-devel] [PATCH V2 6/7] introduce mmio_interface, fred . konrad, 2017/02/17
- [Qemu-devel] [PATCH V2 1/7] cputlb: cleanup get_page_addr_code to use VICTIM_TLB_HIT, fred . konrad, 2017/02/17
- Re: [Qemu-devel] [PATCH V2 0/7] execute code from mmio area, KONRAD Frederic, 2017/02/21