From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDBfl-0000Ok-0C for qemu-devel@nongnu.org; Thu, 09 Jul 2015 09:15:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDBfd-0006dn-KW for qemu-devel@nongnu.org; Thu, 09 Jul 2015 09:15:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDBfd-0006dJ-Ex for qemu-devel@nongnu.org; Thu, 09 Jul 2015 09:15:21 -0400 References: <1436429849-18052-1-git-send-email-rth@twiddle.net> <1436429849-18052-15-git-send-email-rth@twiddle.net> From: Paolo Bonzini Message-ID: <559E73E6.6000100@redhat.com> Date: Thu, 9 Jul 2015 15:15:18 +0200 MIME-Version: 1.0 In-Reply-To: <1436429849-18052-15-git-send-email-rth@twiddle.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 14/14] target-i386: Enable XCR0 features for user-mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org Cc: ehabkost@redhat.com On 09/07/2015 10:17, Richard Henderson wrote: > + > + /* ??? This variable is somewhat silly. Methinks KVM should be > + using XCR0 to store into the XSTATE_BV field. Either that or > + there's more missing information, e.g. the AVX bits. */ > + env->xstate_bv = XSTATE_FP; > + if (env->features[FEAT_1_EDX] & CPUID_SSE) { > + env->xstate_bv |= XSTATE_SSE; > + } > + if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_MPX) { > + env->xstate_bv |= XSTATE_BNDREGS | XSTATE_BNDCSR; > + } xstate_bv != xcr0 if the kernel is using XSAVEOPT and some of the values were in the initial state. Legacy state is never optimized, hence the value of env->xstate_bv after reset. So I think this hunk is wrong, while the other is correct. Paolo