From nobody@FreeBSD.org  Sat Feb  2 13:04:16 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 872CA2CC
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  2 Feb 2013 13:04:16 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 62E0A7F
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  2 Feb 2013 13:04:16 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r12D4Epi031841
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 2 Feb 2013 13:04:14 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r12D4EOp031840;
	Sat, 2 Feb 2013 13:04:14 GMT
	(envelope-from nobody)
Message-Id: <201302021304.r12D4EOp031840@red.freebsd.org>
Date: Sat, 2 Feb 2013 13:04:14 GMT
From: Kaloyan Ganchev <kaloqn.ganchev@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Crash on KVM boot due to xsave instruction issue
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         175780
>Category:       amd64
>Synopsis:       Crash on KVM boot due to xsave instruction issue
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-amd64
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 02 13:10:00 UTC 2013
>Closed-Date:    Mon Feb 04 11:43:02 UTC 2013
>Last-Modified:  Wed Feb 26 22:10:00 UTC 2014
>Originator:     Kaloyan Ganchev
>Release:        9.1
>Organization:
>Environment:
>Description:
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 
>Fix:


>Release-Note:
>Audit-Trail:

From: Konstantin Belousov <kostikbel@gmail.com>
To: Kaloyan Ganchev <kaloqn.ganchev@gmail.com>
Cc: freebsd-gnats-submit@FreeBSD.org, amd64@freebsd.org
Subject: Re: amd64/175780: Crash on KVM boot due to xsave instruction issue
Date: Sat, 2 Feb 2013 17:02:42 +0200

 --QOtWmwZ6xSENhj9o
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 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:
 >=20
 > kvm -cpu core2duo,+xsave -enable-kvm -drive file=3Dfreebsd-9.1-qcow2.img =
 -boot d -net nic -net user -nographic -vnc :0  -cdrom ./isos/FreeBSD-9.1-RE=
 LEASE-amd64-disc1.iso=20
 >=20
 > The kernel return the following error immediately after taking over from =
 the loader:
 >=20
 > panic: CPU0 does not support X87 or SSE : 0
 >=20
 > If I do not expose the xsave cpu flag to the FreeBSD guest the virtual ma=
 chine 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 does=
 n'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=3Dfreebsd-9.1-qcow2.img =
 -boot d -net nic -net user -nographic -vnc :0  -cdrom ./isos/FreeBSD-9.1-RE=
 LEASE-amd64-disc1.iso=20
 > >Fix:
 Talk to KVM developers.
 
 i386 kernel does not support this feature, 9.0 did not have it yet.
 
 --QOtWmwZ6xSENhj9o
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (FreeBSD)
 
 iQIcBAEBAgAGBQJRDSqRAAoJEJDCuSvBvK1BKkkP/2LwthEm1J//zuFlQq+o7BNe
 XFv9pkm7bAiKqFT46n4cs0sfoO9lC26+bPU7/jSSDDLGNCpfp9UYQJFMuTowhD8n
 Ee5TiyMDAeYq5kpiV7jpHf+Wphwaq1pEVNGeV4AMyQAV9l20YlHzzMESHn96pxOG
 1NLj6yzPqIzD1gDui6kpNLjmY2SUqCkI0HL/Ji/QFpYu6ciY1FFpHe7e/VTZPnJj
 1OJ2j3diVLbDT+ElWg0Gog5In3vcnsD36+mxJm0li5nK7CdoTFyhFi7e/2md1nj+
 /Is/vhXLnLM7o+EWkNSxM33sOxTjiwCK69sGShLkSdjVJR36brScJchaiZ7XQBfA
 69k7cGrBuwMaWcWNpYb/SyV7etz8OwYre//m4QCJXxEcpGV772TORGqC6xpiZXct
 LFuAuRLG6Vn/e0QtLRfKTmu3tQkaNWTfBYBcmGCv4tMBa/G39cnSwsxpUhMEfFjU
 Gh2UXTj9+MheOJBuwmeYjsKQofCy7Y6Q0dDPyokyzWyEVIF59NF7zQjgXt/1qDmz
 yaPzrHU2y0PizzQGdcd0wmJi+ZyR79NI5mN1nU7tFQQAZ0euv6ZEZTKKMiZQhxTo
 8UQ+UWF6H5TdO484HY/siJm8EplNKRQ534ftpORwnHKOd223ONq4I+M3XENvd6Fi
 ZNi2NG8PpQEBsmGJt3g4
 =x2yi
 -----END PGP SIGNATURE-----
 
 --QOtWmwZ6xSENhj9o--
State-Changed-From-To: open->closed 
State-Changed-By: kib 
State-Changed-When: Mon Feb 4 11:42:26 UTC 2013 
State-Changed-Why:  
It is not FreeBSD bug, most likely. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175780 

From: "Sean M. Collins" <sean@coreitpro.com>
To: bug-followup@FreeBSD.org;, kaloqn.ganchev@gmail.com
Cc:  
Subject: Re: amd64/175780: Crash on KVM boot due to xsave instruction issue
Date: Wed, 26 Feb 2014 16:37:38 -0500

 --P9KQiUGMzYCFwWCN
 Content-Type: text/plain; charset=utf-8
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 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
 
 --=20
 Sean M. Collins
 
 --P9KQiUGMzYCFwWCN
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.21 (FreeBSD)
 
 iQIcBAEBAgAGBQJTDl6hAAoJEOjbamyh1+WQzmMP/RfxsKQItt7FCY04/ytVow1Q
 Lh3pUpv5ozmGe2X+N91xxyJra96vA9M/7S96y76w/iY2sl4SPoSZHEAP2oU60BrM
 TFHQ46/72ctBxeDFZCI8reA2tvj0Mp5np0gkOO88U8wxfXjWtSPyOxoHEj7dwLhh
 gkC1PUe8XO5Rjmnzn8XQp7ywAEX0tAMJkY6nJzbHbhmFOLRkse7QQ65UmyDRWBGu
 s7xwC9eAHN7qzNHTWdOFTJ1+RIPPO4o3L7Gk5BLGMfdnCf4LNX3PPkTjo4jDomSQ
 TnLOUvZ9MkaXYcPi01MFAFBOn3hqPXOEqriTj+OrtNOKfpKZn+ErEU5HA3zJ8Ex3
 6xmVzCO0Ezdmx4O4drhwbHqFkkhecd6N9+dOf1n4DnG/4qhRZN4MyKfkAd/nfvsn
 +Mt6DDsB8Hi8xZjfTEy9haj/dFqRYpyvOZ5YzoedDbi9+98gjcK6oPy5kTcaLkvo
 IuKbu+/SWUd9kZXySbjQGp2PooiBHUxtErliYjySi6Db3EncBcqWVdZeruISfb9h
 URoM6VDi4bQ4xfnwzMgQREcArTqKFjMfPebC/HjnOJwfQn4/1XfamPz4Fikd/YuG
 ZOs81FoK7yE79kqZXkhs40gzIZcbLSKyXm2Dlvp7WgBqRp63gjRxzsrFmp47fJhD
 cU9luzgqsyfXv+RAYBY3
 =izZP
 -----END PGP SIGNATURE-----
 
 --P9KQiUGMzYCFwWCN--
>Unformatted:
