From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: [PATCH 2/2] Allow the SVM CPUID bit in a VM Date: Wed, 03 Sep 2008 09:55:36 +0200 Message-ID: <48BE42F8.3040902@redhat.com> References: <1220270342-15769-1-git-send-email-agraf@suse.de> <1220270342-15769-2-git-send-email-agraf@suse.de> <1220270342-15769-3-git-send-email-agraf@suse.de> <48BBF570.9070301@qumranet.com> <4EE967D1-3CB5-45C4-B480-0D230242D476@suse.de> <484561CE-F0E6-45E9-BBF0-7DBDB8571873@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, joro@8bytes.org, anthony@codemonkey.ws To: Alexander Graf Return-path: Received: from mx2.redhat.com ([66.187.237.31]:42296 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751686AbYICH6Z (ORCPT ); Wed, 3 Sep 2008 03:58:25 -0400 In-Reply-To: <484561CE-F0E6-45E9-BBF0-7DBDB8571873@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: Hi, > On a sidenote I'm really not fond of the userspace CPUID capability > restrictions in the first place. Shouldn't this all be determined in the > kernel module? It doesn't make since IMHO to restrict NX usage from > userspace. The kernel module knows best what it's capable of. I think cpuid handling will be a quite interesting when it comes to merging qemu and kvm. Doing it completely in the kernel isn't going to work. There are several reasons why you might want to change the cpuid presented to the guest. First, you might want to mask out cpuid bits not supported by all machines in your pool, for migration compatibility. Second, you might want to present a specific CPU to the guest (like qemu -cpu pentium). At least as close as possible, of course there are some restrictions. I think even if you mask out the sse cpuid bit sse instructions will actually work. Also having a virtual intel cpu on amd and visa versa probably isn't going to work unless we'll fall back to the emulator for the missing instructions. Third, there is the hypervisor cpuid range (0x40000000+). That one needs to be configurable by userspace as well. cheers, Gerd