From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCjvY-0008L9-AB for qemu-devel@nongnu.org; Tue, 14 Jun 2016 04:42:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCjvU-0006gp-6d for qemu-devel@nongnu.org; Tue, 14 Jun 2016 04:42:27 -0400 Received: from mga14.intel.com ([192.55.52.115]:18023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCjvU-0006gU-0z for qemu-devel@nongnu.org; Tue, 14 Jun 2016 04:42:24 -0400 Date: Tue, 14 Jun 2016 16:31:37 +0800 From: Chao Peng Message-ID: <20160614083136.GD21465@pengc-linux.bj.intel.com> Reply-To: Chao Peng References: <1465784487-23482-1-git-send-email-chao.p.peng@linux.intel.com> <0ad19d18-4ee1-0450-c3fa-b64b34e2cc66@redhat.com> <20160614050128.GA21465@pengc-linux.bj.intel.com> <7ce88285-2d4c-7b4a-767a-7e6c9eb25f2b@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7ce88285-2d4c-7b4a-767a-7e6c9eb25f2b@redhat.com> Subject: Re: [Qemu-devel] [PATCH] target-i386: kvm: cache KVM_GET_SUPPORTED_CPUID data List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Eduardo Habkost , Marcelo Tosatti , Richard Henderson On Tue, Jun 14, 2016 at 10:21:41AM +0200, Paolo Bonzini wrote: > > > On 14/06/2016 07:01, Chao Peng wrote: > >> > > >> > Which are the CPUID leaves for which KVM_GET_SUPPORTED_CPUID is not > >> > stateless? I cannot find any. > > I have though leaf 0xd, sub leaf 1 is not stateless, as the size of > > xsave buffer(EBX) is based on XCR0 | IA32_XSS. But after looking KVM > > code more carefully, seems I was wrong. The code calculates EBX with the > > host xcr0 but not guest xcr0, nor guest IA32_XSS (not sure if this is > > the correct behavior), so it can always returns constant data on a > > certain machine. > > Indeed, KVM computes the correct value at runtime, but > KVM_GET_SUPPORTED_CPUID runs before there is a value for guest XCR0 or > guest IA32_XSS. Yes, this is the point. > > Thanks, I've queued the patch for QEMU 2.7. Thanks :) Chao