QEMU .qcow2 mmu_gva_to_gpa crash in Mac OS X
Asked Answered
H

2

6

I am trying to run my .qcow2 image in Mac OS X with qemu-system-x86_64, it works perfectly fine on my Debian machine but for memory problems I need to move it to a Mac OS X Catalina machine. I installed qemu-system-x86_64 through brew and then when I launch my machine with

qemu-system-x86_64 \
>   -m 8G \
>   -vga virtio \
>   -show-cursor \
>   -usb \
>   -device usb-tablet \
>   -enable-kvm \
>   -drive file=/Volumes/enricoWD/transfer_home_laptop/dxcator_home_backup_feb2020/diag-stage.qcow2,if=virtio \
>   -accel hvf \
>   -cpu host

it starts but after 4 seconds crashes with:

vmx_write_mem: mmu_gva_to_gpa ffff9ac27b23fcdc failed

Abort trap: 6

I saw other users encountered this problem here, but no answer provided.

If anybody has a clue, or suggestion for other ways to run my .qcow2 machine on Mac OS X it would be great! Thanks a lot in advance!

Hopping answered 14/2, 2020 at 17:45 Comment(1)
You could try MacPorts version perhaps.Mutism
R
5

I was able to fix a similar problem using two different methods related to QEMU / KVM CPU model configuration. Both used Homebrew's port of QEMU, version 5.1.

Option #1: Specify the CPU Model

Try specifying the CPU model which most closely matches the host machine.

  1. Determine the CPU type of the host machine.
$ sysctl -a | grep machdep.cpu.brand_string
machdep.cpu.brand_string: Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz
  1. Find the matching CPU model supported by QEMU.
$ qemu-system-x86_64 -cpu help

A search at ark.intel.com, for i5-4690 yields only one 3.5 GHz option, so this is my CPU. Using the Product Collection and Code Name, this CPU must correspond to the x86 Haswell-v4 model.

  1. Substitute the CPU model in the QEMU command.
$ qemu-system-x86_64 -cpu Haswell-v4 ...

Option #2: Emulate the CPU

If you still have issues, you can try emulating the CPU instead of using host passthrough. This just requires using the default qemu64 CPU type. You can do this like so:

$ qemu-system-x86_64 -cpu qemu64 ...
Raster answered 4/9, 2020 at 18:25 Comment(0)
L
5

Disable huge pages

-cpu host,-pdpe1gb

Lieselotteliestal answered 5/7, 2022 at 3:38 Comment(5)
This worked for me, but would be nice to know why is this happening and why is this the solution xDTabatha
First read it superuser.com/questions/710870/which-cpus-support-1gb-pagesLieselotteliestal
Macos doesn't support huge pages. Or it need something settings, I don't know.Lieselotteliestal
This worked for me too, but my host hardware is a MacBook, and my host OS is macOS, so I'm surprised -cpu host doesn't just work. How come?Loidaloin
@Loidaloin 1gb pages is a cpu hardware feature. I think Macos use it in the kernel, but does not allow use in user mode. When the guest kernel tries to use it, then the host kernel raises an exception.Lieselotteliestal

© 2022 - 2024 — McMap. All rights reserved.