id = 644 title = "generic loader does not do virtual to physical address translation when loading MIPS ELF" state = "opened" created_at = "2021-09-28T03:31:27.172Z" closed_at = "n/a" labels = ["target: mips"] url = "https://gitlab.com/qemu-project/qemu/-/issues/644" host-os = "(Red Hat Enterprise Linux Server release 7.5 (Maipo))" host-arch = "(x86)" qemu-version = "(QEMU emulator version 6.0.0, bug git head (de8ed105) has the same problem)" guest-os = "(baremetal)" guest-arch = "(mips)" description = """""" reproduce = """1.build two ELFs, whose virtual address is at kseg0
2.load one ELF with generic loader "-device loader,file=test1.elf", the other ELF with "-kernel test2.elf"
3.generic loader loads test1.elf without doing address translation, while mipssim load_kernel will do that with cpu_mips_kseg0_to_phys
""" additional = """generic_loader_realize calls load_elf_as with the argument translate_fn=NULL. Maybe, we can set translate_fn when elf_machine is EM_MIPS."""