On 12/05/2021 15:39, Richard Henderson wrote:
On 5/12/21 9:08 AM, Bruno Larsen (billionai) wrote:
+++ b/target/ppc/tcg-stub.c
@@ -0,0 +1,33 @@
+
+#include "qemu/osdep.h"
All files get copyright boilerplate.
+#include "exec/hwaddr.h"
+#include "cpu.h"
+#include "hw/ppc/spapr.h"
+
+hwaddr ppc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
+{
+ return 0;
+}
This is used by gdbstub.
If there's a way for kvm to convert a virtual address to a physical
address using the hardware, then use that. I suspect there is not.
Otherwise, you have to keep all of the mmu page table walking stuff
for kvm as well as tcg. Which probably means that all of the other
stuff that you're stubbing out is used or usable as well.
From what I can tell, KVM can't do it, so we'll have to extract the
function. Looking at it, the main problem is that it might call
get_physical_address and use struct mmu_ctx_t, if the mmu_model isn't
one of: POWERPC_MMU_64B, POWERPC_MMU_2_03, POWERPC_MMU_2_06,
POWERPC_MMU_2_07, POWERPC_MMU_3_00, POWERPC_MMU_32B, POWERPC_MMU_601.
Is it possible that a machine with an mmu not listed in here could build
a !TCG version of qemu? if it's not possible, we can separate that part
into a separate function left in mmu_helper.c and move the rest to
somewhere else.
Looking at dump_mmu and ppc_tlb_invalidate_all, looks like we need to
move enough code that it make sense to create an mmu_common.c for common
code. Otherwise, it's probably easier to compile all of mmu_helper.c
instead of picking those functions out.
--
Bruno Piazera Larsen
Instituto de Pesquisas ELDORADO
<https://www.eldorado.org.br/?utm_campaign=assinatura_de_e-mail&utm_medium=email&utm_source=RD+Station>
Departamento Computação Embarcada
Analista de Software Trainee
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>