KVM guest: Enabling OSXSAVE/AVX
Posted: Sun Feb 21, 2021 10:51 am
Hey guys,
I'm having some trouble enabling AVX in my KVM guest. Once I set OSXSAVE in CR4 it refuses to run the guest. I'm assuming this is something that has to be enabled in other ways. I could enable SSE4.2 just fine. I have written a hardware accelerated CRC32-C function inside the guest and tested it, and it works just fine.
I tried setting XCR0 manually, but it doesn't seem to like that OSXSAVE isn't enabled, so not sure how to proceed.
So, anyone have any experience with the KVM API and how to enable AVX before entering guest? The guest is unprivileged so there will be no enabling there other than feature detection.
I'm having some trouble enabling AVX in my KVM guest. Once I set OSXSAVE in CR4 it refuses to run the guest. I'm assuming this is something that has to be enabled in other ways. I could enable SSE4.2 just fine. I have written a hardware accelerated CRC32-C function inside the guest and tested it, and it works just fine.
I tried setting XCR0 manually, but it doesn't seem to like that OSXSAVE isn't enabled, so not sure how to proceed.
So, anyone have any experience with the KVM API and how to enable AVX before entering guest? The guest is unprivileged so there will be no enabling there other than feature detection.