From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: -cpu host (was Re: KVM call minutes for 2013-08-06) Date: Sun, 25 Aug 2013 16:55:23 +0300 Message-ID: <20130825135523.GS8218@redhat.com> References: <5203BF5D.4030007@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: qemu-devel , kvmarm@lists.cs.columbia.edu, Andreas =?utf-8?Q?F=C3=A4rber?= , KVM devel mailing list , quintela@redhat.com To: Peter Maydell Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org On Thu, Aug 08, 2013 at 07:20:41PM +0100, Peter Maydell wrote: > >> For ARM you can't get at feature info of the host from userspace > >> (unless you want to get into parsing /proc/cpuinfo), so my current > >> idea is to have KVM_ARM_VCPU_INIT support a target-cpu-type > >> which means "whatever host CPU is". Then when we've created the > >> vcpu we can populate QEMU's idea of what the CPU features are > >> by using the existing ioctls for reading the cp15 registers of > >> the vcpu. > > > > Sounds sane to me iff those cp15 registers all work with KVM and don't > > need any additional KVM/QEMU/device code. > > Yes; KVM won't tell us about CP15 registers unless they > are exposed to the guest VM (that is, we're querying the So why not implement something similar to x86 cpuid thing. Have separate ioctls to query what CP15 registers KVM can support and what is exposed to a guest? > VCPU, not the host CPU). More generally, the cp15 "tuple > list" code I landed a couple of months back makes the kernel > the authoritative source for which cp15 registers exist and > what their values are -- in -enable-kvm mode QEMU no longer > cares about them (its own list of which registers exist for > which CPU is used only for TCG). > -- Gleb. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDan9-0000HV-PC for qemu-devel@nongnu.org; Sun, 25 Aug 2013 09:55:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDan3-0003Kd-PD for qemu-devel@nongnu.org; Sun, 25 Aug 2013 09:55:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDan3-0003KO-7F for qemu-devel@nongnu.org; Sun, 25 Aug 2013 09:55:37 -0400 Date: Sun, 25 Aug 2013 16:55:23 +0300 From: Gleb Natapov Message-ID: <20130825135523.GS8218@redhat.com> References: <5203BF5D.4030007@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] -cpu host (was Re: KVM call minutes for 2013-08-06) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel , kvmarm@lists.cs.columbia.edu, Andreas =?utf-8?Q?F=C3=A4rber?= , KVM devel mailing list , quintela@redhat.com On Thu, Aug 08, 2013 at 07:20:41PM +0100, Peter Maydell wrote: > >> For ARM you can't get at feature info of the host from userspace > >> (unless you want to get into parsing /proc/cpuinfo), so my current > >> idea is to have KVM_ARM_VCPU_INIT support a target-cpu-type > >> which means "whatever host CPU is". Then when we've created the > >> vcpu we can populate QEMU's idea of what the CPU features are > >> by using the existing ioctls for reading the cp15 registers of > >> the vcpu. > > > > Sounds sane to me iff those cp15 registers all work with KVM and don't > > need any additional KVM/QEMU/device code. > > Yes; KVM won't tell us about CP15 registers unless they > are exposed to the guest VM (that is, we're querying the So why not implement something similar to x86 cpuid thing. Have separate ioctls to query what CP15 registers KVM can support and what is exposed to a guest? > VCPU, not the host CPU). More generally, the cp15 "tuple > list" code I landed a couple of months back makes the kernel > the authoritative source for which cp15 registers exist and > what their values are -- in -enable-kvm mode QEMU no longer > cares about them (its own list of which registers exist for > which CPU is used only for TCG). > -- Gleb.