From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKGkZ-0004rL-EY for qemu-devel@nongnu.org; Mon, 14 Dec 2009 14:38:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKGkU-0004qG-2p for qemu-devel@nongnu.org; Mon, 14 Dec 2009 14:38:30 -0500 Received: from [199.232.76.173] (port=48376 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKGkT-0004qD-Rm for qemu-devel@nongnu.org; Mon, 14 Dec 2009 14:38:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27570) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NKGkT-0003Jf-Cx for qemu-devel@nongnu.org; Mon, 14 Dec 2009 14:38:25 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBEJcOcn028883 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 14 Dec 2009 14:38:24 -0500 Date: Mon, 14 Dec 2009 21:35:41 +0200 From: "Michael S. Tsirkin" Message-ID: <20091214193541.GA6150@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] cpuid problem in upstream qemu with kvm List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, avi@redhat.com, gleb@redhat.com Hi! I have a linux guest where init crashes during boot with invalid opcode error with kernel 2.6.31, but works fine with kernel 2.6.32. It also works fine even with 2.6.31 with qemu-kvm. With Gleb's help, we figured out that the opcode in question is syscall, which is unsupported by hardware on kvm with intel hosts, and is emulated in software with intel hosts in 2.6.32 and up. AMD hosts support this natively. The root cause: by default qemu with kvm enabled reports the following CPU ID: mst@robin:~$ less /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 2 model name : QEMU Virtual CPU version 0.11.50 stepping : 3 cpu MHz : 2493.679 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 4 wp : yes flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall lm up pni bogomips : 4987.35 clflush size : 64 power management: Problem is, guest sees syscall+AMD vendor and concludes that it is ok to use syscall opcode, which results in a crash (or at least, extra VMExits). I understand from Avi that qemu-kvm solves this problem by reporting the actual CPU vendor from host, to guest. -- MST