qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

target/tricore: Implement tricore_cpu_get_phys_page_debug

this also removes tricore_cpu_get_phys_page_attrs_debug() as it was a
temporary fix from b190f477e29c7cd03a8fee49c96d27f160e3f5b0.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Message-Id: <20200529072148.284037-5-kbastian@mail.uni-paderborn.de>

+14 -9
+1 -9
target/tricore/cpu.c
··· 23 23 #include "exec/exec-all.h" 24 24 #include "qemu/error-report.h" 25 25 26 - static hwaddr tricore_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, 27 - MemTxAttrs *attrs) 28 - { 29 - error_report("function cpu_get_phys_page_attrs_debug not " 30 - "implemented, aborting"); 31 - return -1; 32 - } 33 - 34 26 static inline void set_feature(CPUTriCoreState *env, int feature) 35 27 { 36 28 env->features |= 1ULL << feature; ··· 161 153 cc->dump_state = tricore_cpu_dump_state; 162 154 cc->set_pc = tricore_cpu_set_pc; 163 155 cc->synchronize_from_tb = tricore_cpu_synchronize_from_tb; 164 - cc->get_phys_page_attrs_debug = tricore_cpu_get_phys_page_attrs_debug; 156 + cc->get_phys_page_debug = tricore_cpu_get_phys_page_debug; 165 157 cc->tcg_initialize = tricore_tcg_init; 166 158 cc->tlb_fill = tricore_cpu_tlb_fill; 167 159 }
+13
target/tricore/helper.c
··· 42 42 43 43 return ret; 44 44 } 45 + 46 + hwaddr tricore_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) 47 + { 48 + TriCoreCPU *cpu = TRICORE_CPU(cs); 49 + hwaddr phys_addr; 50 + int prot; 51 + int mmu_idx = cpu_mmu_index(&cpu->env, false); 52 + 53 + if (get_physical_address(&cpu->env, &phys_addr, &prot, addr, 0, mmu_idx)) { 54 + return -1; 55 + } 56 + return phys_addr; 57 + } 45 58 #endif 46 59 47 60 /* TODO: Add exeption support*/