From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7hzH-0001bT-4s for qemu-devel@nongnu.org; Wed, 24 Jun 2015 06:33:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7hzD-0006vq-V2 for qemu-devel@nongnu.org; Wed, 24 Jun 2015 06:32:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7hzD-0006vj-OV for qemu-devel@nongnu.org; Wed, 24 Jun 2015 06:32:55 -0400 Message-ID: <558A8751.6000909@redhat.com> Date: Wed, 24 Jun 2015 12:32:49 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1433790460-30679-1-git-send-email-ehabkost@redhat.com> <20150608201835.GM3525@orkuz.home> <558951C0.3050806@suse.de> <20150624092050.GA118757@orkuz.home> <20150624121700-mutt-send-email-mst@redhat.com> In-Reply-To: <20150624121700-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 0/2] target-i386: "custom" CPU model + script to dump existing CPU models List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , Jiri Denemark Cc: mimu@linux.vnet.ibm.com, qemu-devel@nongnu.org, Alexander Graf , borntraeger@de.ibm.com, Igor Mammedov , rth@twiddle.net, =?windows-1252?Q?Andreas_F=E4rber?= , Eduardo Habkost On 24/06/2015 12:21, Michael S. Tsirkin wrote: > > QEMU provides stable ABI for x86 CPUs only if you use -cpu ...,enforc= e. > > Without enforce the CPU may change everytime a domain is started or > > migrated. A small example: let's say a CPU model called "Model" inclu= des > > feature "xyz"; when QEMU is started with -cpu Model (no enforce) on a > > host which supports xyz, the guest OS will see a CPU with xyz, but wh= en > > you migrate it to a host which does not support xyz, QEMU will just > > silently drop xyz. In other words, we need to use enforce to make sur= e > > CPU ABI does not change. >=20 > Are there really many examples like this? Could someone supply some > examples? Eduardo gave examples of CPU changes across machine types > but I haven't seen examples where we would break runnability. Same here, and I would be quite surprised of seeing any. Except perhaps when we introduced x2apic: that would have broken kernels <2.6.32, but I hope we can ignore those. At least as far as I've maintained KVM, we've not added new models to QEMU after KVM's kernel support was added. The only case I can imagine is that the kernel is ancient so it doesn't have anything newer than say IvyBridge, while QEMU is new. If the user starts a Haswell VM on a SandyBridge host without "enforce", you will have a problem when you reboot and get a newer kernel, but this is independent of machine types. We have added new features in exactly three cases: 1) F16 and RDRAND to {Haswell,Broadwell} in 2.3; 2) MOVBE to n270 in 1.5; 3) PCLMULQDQ to Westmere also in 1.5. In all three cases, libvirt is still buggy and doesn't let you use the features if you have the appropriate host. We were close to breaking libvirt's expectations when we wanted to remove TSX from Haswell/Broadwell, but in the end we did it right by adding separate CPU models and no final release broke libvirt. So, what is the broken case? And BTW, what is _exactly_ preventing libvirt from using enforce for models other than qemu32/qemu64? Paolo