intel / haxm

Intel® Hardware Accelerated Execution Manager (Intel® HAXM)
BSD 3-Clause "New" or "Revised" License
3.22k stars 871 forks source link

QEMU HAXM support causing immediate VCPU shutdown request #354

Open ethindp opened 3 years ago

ethindp commented 3 years ago

Describe the Bug

Summary:

When running a custom OS in QEMU, an immediate VCPU shutdown request occurs when using -cpu max and setting the accelerator to hax.

Host Environment

Guest Environment

To Reproduce

Steps to reproduce the behavior:

  1. Invoke qemu like so: qemu-system-x86_64 -drive format=raw,file=bootimage-kernel.bin -no-reboot -drive file=disk.img,if=none,id=NVME01 -device nvme,drive=NVME01,serial=0001 -m 4G -usb -rtc base=utc,clock=host -cpu max -smp cpus=8 -M q35 -name kernel -s -d trace:pci_*,trace:apic_* -D qemu.log -nographic -accel hax

Expected Behavior

Expectation: Qemu should note that it is using HAX, then I should see SeaBIOS and then my kernel booting up properly.

Reproducibility

I believe that this issue has a high degree of reproducibility.

Diagnostic Information

Host crash dump: No host crash dump generated

HAXM log: Log is attached

Android Emulator or QEMU log:

HAX is working and emulator runs in fast virt mode.
VCPU shutdown request
VCPU shutdown request

Screenshots: None

Additional context

I am developing my own operating system. The files to boot it, along with the HAXM logs, are available in this file: haxm-crash-20210324.tar.gz

The files in the archive are as follows:

nevilad commented 3 years ago

When running a custom OS in QEMU, an immediate VCPU shutdown request occurs when using -cpu max and setting the accelerator to hax.

So when you remove -cpu max it works?

ethindp commented 3 years ago

It does. However, -cpu max is (supposed) to emulate all features supported by the accelerator, so I suspect its one of the CPU features that QEMU is trying to emulate that's causing the problem. And the HAXM accelerator doesn't have the host CPU choice, so I can't exactly emulate my host processor.

On 3/25/21, nevilad @.***> wrote:

When running a custom OS in QEMU, an immediate VCPU shutdown request occurs when using -cpu max and setting the accelerator to hax.

So when you remove -cpu max it works?

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/intel/haxm/issues/354#issuecomment-806440353

-- Signed, Ethin D. Probst

necros2k7 commented 2 years ago

Same here, and trying "-cpu qemu64 -accel hax" - just freezes / super slows win7x64 during boot qemu 6.2, host win11, E5-2690 cpu

diegocrzt commented 2 years ago

I have the same issue here, with an extra warning in output, I will avoid adding a new issue as this seems to be the same.

Host Environment

Guest Environment

To Reproduce

Steps to reproduce the behavior:

qemu-system-x86_64 -machine type=pc,accel=hax -cpu max -smp 6,cores=3,threads=2,sockets=1 -m 6144 -k en -rtc base=localtime -net nic,model=virtio-net-pci -net user,hostname=virtual,hostfwd=tcp::1433-:1433,hostfwd=tcp::3389-:3389 -name virtual -usb -device usb-mouse -device virtio-serial -drive file=hdd50g.qcow2,if=virtio,index=0,media=disk -drive file=Win10_21H2_EnglishInternational_x64.iso,index=0,media=cdrom -drive file=virtio-win-0.1.196.iso,index=1,media=cdrom

Output

HAX is working and emulator runs in fast virt mode.
qemu-system-x86_64: warning: This family of AMD CPU doesn't support hyperthreading(2)
Please configure -smp options properly or try enabling topoext feature.
VCPU shutdown request
VCPU shutdown request

When I remove -smp or use -smp {any integer} it reproduces the exact same output @ethindp reported