Bug 175780

Summary: Crash on KVM boot due to xsave instruction issue
Product: Base System Reporter: Kaloyan Ganchev <kaloqn.ganchev>
Component: amd64Assignee: freebsd-amd64 (Nobody) <amd64>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Kaloyan Ganchev 2013-02-02 13:10:00 UTC
When trying to boot FreeBSD 9.1 on kvm host  with the following command:

kvm -cpu core2duo,+xsave -enable-kvm -drive file=freebsd-9.1-qcow2.img -boot d -net nic -net user -nographic -vnc :0  -cdrom ./isos/FreeBSD-9.1-RELEASE-amd64-disc1.iso 

The kernel return the following error immediately after taking over from the loader:

panic: CPU0 does not support X87 or SSE : 0

If I do not expose the xsave cpu flag to the FreeBSD guest the virtual machine boot as expected.
This problem do not appear in 9.1 i386 and 9.0 amd64 releases.
Also I tried several other cpu models instead of the core2duo and it doesn't make a difference, if xsave is exposed to the guest, FreeBSD 9.1 amd64 fails to boot with the error above.

How-To-Repeat: kvm -cpu core2duo,+xsave -enable-kvm -drive file=freebsd-9.1-qcow2.img -boot d -net nic -net user -nographic -vnc :0  -cdrom ./isos/FreeBSD-9.1-RELEASE-amd64-disc1.iso
Comment 1 Kostik Belousov 2013-02-02 15:02:42 UTC
On Sat, Feb 02, 2013 at 01:04:14PM +0000, Kaloyan Ganchev wrote:
> When trying to boot FreeBSD 9.1 on kvm host  with the following command:
> 
> kvm -cpu core2duo,+xsave -enable-kvm -drive file=freebsd-9.1-qcow2.img -boot d -net nic -net user -nographic -vnc :0  -cdrom ./isos/FreeBSD-9.1-RELEASE-amd64-disc1.iso 
> 
> The kernel return the following error immediately after taking over from the loader:
> 
> panic: CPU0 does not support X87 or SSE : 0
> 
> If I do not expose the xsave cpu flag to the FreeBSD guest the virtual machine boot as expected.
> This problem do not appear in 9.1 i386 and 9.0 amd64 releases.

This is a misconfigured hypervisor, or a bug in the hypervisor.

FreeBSD amd64 assumes that both X87 FPU and SSE2 are present for any
CPU capable of long mode. It is enforced by the Unix amd64 ABI.

Intel documentation states that CPUID leaf 0xd must report the presence of
FPU extensions, and since for the long mode capable CPU, SSE2 and X87 must
be present, we re-check the report. Aparently, the returned CPUID data
is wrong.

> Also I tried several other cpu models instead of the core2duo and it doesn't make a difference, if xsave is exposed to the guest, FreeBSD 9.1 amd64 fails to boot with the error above.
> >How-To-Repeat:
> kvm -cpu core2duo,+xsave -enable-kvm -drive file=freebsd-9.1-qcow2.img -boot d -net nic -net user -nographic -vnc :0  -cdrom ./isos/FreeBSD-9.1-RELEASE-amd64-disc1.iso 
> >Fix:

Talk to KVM developers.

i386 kernel does not support this feature, 9.0 did not have it yet.
Comment 2 Konstantin Belousov freebsd_committer freebsd_triage 2013-02-04 11:42:26 UTC
State Changed
From-To: open->closed

It is not FreeBSD bug, most likely.
Comment 3 Sean M. Collins 2014-02-26 21:37:38 UTC
I also recently hit this issue when trying to launch a FreeBSD
10-RELEASE guest in an OpenStack environment, with
Ubuntu 12.04 LTS hypervisors that use KVM.

Did a quick google, and saw this message from the LKML:

https://lkml.org/lkml/2014/2/22/58

-- 
Sean M. Collins