On Wed, Sep 02, 2020 at 10:17:01AM +0200, Christian Schoenebeck wrote: > On Dienstag, 1. September 2020 14:45:55 CEST David Cohen wrote: > > Hi, > > > > I'm trying to use qemu on OSX Catalina using HVF hypervisor, but it's > > currently panic'ing upon booting Linux guest. > > > > These are the args I'm using: > > build % ./qemu-system-x86_64 -cdrom > > ~/Downloads/archlinux-2020.08.01-x86_64.iso -smp 4 -m 4G -vga virtio > > -accel hvf -cpu host > > > > I could trace the failure to test_pt_entry(), in this exact position: > > > > build % git diff > > diff --git a/target/i386/hvf/x86_mmu.c b/target/i386/hvf/x86_mmu.c > > index 65d4603dbf..8f04a94cc6 100644 > > --- a/target/i386/hvf/x86_mmu.c > > +++ b/target/i386/hvf/x86_mmu.c > > @@ -113,6 +113,7 @@ static bool test_pt_entry(struct CPUState *cpu, > > struct gpt_translation *pt, > > } > > > > if (!pte_present(pte)) { > > + printf("Code is failing here"); > > return false; > > } > > > > > > Is anyone aware of this issue? > > > > Br, David Cohen > > CCing Cameron and Roman, just in case. >
Hi Christian, David, Are we talking about the issue? $ $QEMU -cdrom ~/Downloads/archlinux-2020.08.01-x86_64.iso -smp 4 -m 4G -vga virtio -accel hvf -cpu host vmx_write_mem: mmu_gva_to_gpa ffff8ecf3b150000 failed [1] 24888 abort $QEMU -cdrom ~/Downloads/archlinux-2020.08.01-x86_64.iso -smp 4 -m 4G -vga It might be a dup of: https://bugs.launchpad.net/qemu/+bug/1838390 The likely cause of the issue is HVF doesn't generate #PF to the guest when it emulates an instruction and finds a page that's not in memory, instead it just aborts. setjmp()/longjmp() in hvf_vcpu_exec() might be used to raise the CPU exception similar to TCG, that would fix the ticket. But I'm also seeing a kernel panic in the guest on TSC read in the guest. It doesn't happen if -cpu host is not used. Thanks, Roman