Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

HAXM does not enable XSAVE yet AVX is supported and cannot be enabled #465

Open
NXTdevosc1 opened this issue Sep 16, 2022 · 5 comments
Open

Comments

@NXTdevosc1
Copy link

After a long trip fixing my LEGACY BIOS bootloader to run on QEMU with HAXM enabled, the bootloader successfully do its job and jumps to the kernel, the first thing the kernel does is to enable CPU features. However, when HAXM is enabled, the kernel detects AVX support but xsetbv triggers a vCPU Shutdown. I figured out that XSAVE and OSXSAVE are disabled in CPUID,EAX=1. I tried to check for them by creating a windows program and they seem to be both enabled on the host CPU.

The goal of enabling HAXM was mainly to test and use AVX, PCID, AES, TSC_DEADLINE support and lot of other features present on my CPU, rather than just rebooting my PC each time which takes minutes !

How to enable OSXSAVE, XSAVE on an HAXM host ? How to use AVX and other CPU features ?

Please, I need to fix this soon.

However enabling these extensions on real hardware (the host CPU) seems to work normally.

I'll appreciate it too much if you provide these features, I don't want to reboot my PC each time to try them. AVX is only 86 Instructions though

@NXTdevosc1
Copy link
Author

Another thing : Enabling virtualization only activates XSAVE on other VMs (Without HAXM). Which provides activation possibility and usage for the AVX instruction set.
Therefore, HAXM Must add support for the XSAVE Feature in order to enable AVX.

@NXTdevosc1 NXTdevosc1 changed the title HAXM does not enable OSXSAVE yet AVX is supported and cannot be enabled HAXM does not enable XSAVE yet AVX is supported and cannot be enabled Sep 17, 2022
@nevilad
Copy link
Contributor

nevilad commented Sep 17, 2022

Haxm does not support XSAVE and OSXSAVE emulation, thus returns these as disabled from cpuid emulation handlers. The feature set supported by haxm corresponds to very old CPU models - very similar to Nehalem.
To use these you have to add they support to haxm.

Please, I need to fix this soon.

Nearly impossible, haxm didnt add features for a long time, see closed pull request list. There is no active development of the project.

@NXTdevosc1
Copy link
Author

Is there a way to do it ? or I just emulate with VBox or VMWare to test these extensions ?

@nevilad
Copy link
Contributor

nevilad commented Sep 19, 2022

To do it with haxm, one has to implement these features in haxm code.
If you just need some hypervisor to do your tests, then you can use VBox and VmWare. They implement features corresponfing to more recent CPUs.

@NXTdevosc1
Copy link
Author

where are HAXM developers ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants