From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmm9H-00043T-Hb for qemu-devel@nongnu.org; Wed, 21 Sep 2016 14:21:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmm9G-0003nc-J9 for qemu-devel@nongnu.org; Wed, 21 Sep 2016 14:21:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmm9G-0003nV-C7 for qemu-devel@nongnu.org; Wed, 21 Sep 2016 14:21:34 -0400 Date: Wed, 21 Sep 2016 15:21:31 -0300 From: Eduardo Habkost Message-ID: <20160921182131.GO3233@thinpad.lan.raisama.net> References: <147377800565.11859.4411044563640180545.stgit@brijesh-build-machine> <147377817920.11859.9423132506504837623.stgit@brijesh-build-machine> <859d1705-0a8c-21d4-6abb-d33b62a77a14@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [RFC PATCH v1 17/22] target-i386: add cpuid Fn8000_001f List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Brijesh Singh Cc: Paolo Bonzini , crosthwaite.peter@gmail.com, armbru@redhat.com, mst@redhat.com, p.fedin@samsung.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, rth@twiddle.net On Wed, Sep 21, 2016 at 11:20:59AM -0500, Brijesh Singh wrote: > On 09/13/2016 06:07 PM, Paolo Bonzini wrote: > > On 13/09/2016 16:49, Brijesh Singh wrote: [...] > > > + case 0x8000001F: > > > + host_cpuid(index, 0, eax, ebx, ecx, edx); > > > + break; Do we really need to expose the raw host CPUID values directly to the guest? It will make it harder to support migration later. > > > case 0xC0000000: > > > *eax = env->cpuid_xlevel2; > > > *ebx = 0; > > > > > > > > > > > > > This should only be visible to a SEV-enabled guest. Also, the xlevel > > should be bumped to 0x8000001F for SEV-enabled guests. > > > > Okay I will add sev_enabled() check before getting the cpuid. > > Regarding xlevel, I am not able to locate qemu code which bumped the xelevel > for KVM enabled guests. Because QEMU doesn't do that automatically (yet), except for CPUID[7].EBX features. > Maybe I am missing something, looking at code gave > me impression that xlevel is obtained using CPUID_80000000. One of the KVM > RFC patch [1] updates the min level. Do I need to do something more into > qemu to bumped the xlevel? I will send a series today that will increase level/xlevel automatically depending on the features that are enabled. I will add you to CC. -- Eduardo