From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Law Subject: Re: xsave=0 workaround needed on 3.2 kernels with Xen 4.1 or Xen-unstable. Date: Thu, 10 May 2012 20:27:14 -0600 Message-ID: <4FAC7902.6050701@redhat.com> References: <4FA268CD02000078000814E4@nat28.tlf.novell.com> <4FA792C00200007800081F06@nat28.tlf.novell.com> <20120508000813.GA29587@phenom.dumpdata.com> <20120509003510.GA19643@phenom.dumpdata.com> <20120509131153.GA13956@andromeda.dapyr.net> <4FAA8E96020000780008288F@nat28.tlf.novell.com> <20120509173836.GB9094@phenom.dumpdata.com> <4FAC1989.4060201@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: konrad@darnok.org Cc: Jeremy Fitzhardinge , Tim.Deegan@citrix.com, Konrad Rzeszutek Wilk , haitao.shan@intel.com, weidong.han@intel.com, stefan.bader@canonical.com, xen-devel , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 05/10/2012 06:58 PM, Konrad Rzeszutek Wilk wrote: >>> Ironically, the code in init-arch used to look like: >>> >>> >>> if (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx& bit_AVX) >>> { >>> >>> /* Reset the AVX bit in case OSXSAVE is disabled. */ >>> if ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx& bit_OSXSAVE) == >>> 0 >>> || ({ unsigned int xcrlow; >>> unsigned int xcrhigh; >>> asm ("xgetbv" >>> >>> : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0)); >>> (xcrlow& 6) != 6; })) >>> >>> __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx&= ~bit_AVX; >>> } >>> >>> >>> Which I think would have done the right thing. Uli changed it to the >>> form you quoted just 2 hours after installing the version I quoted. >> >> Sadly no as it would have executed the xgetv instruction. Since the first >> part of the boolean logic returns false. > > And that is what I get from typing this while stopping at > lights and being in a hurry and doing this on a cellphone. > Please ignore what I said above - the earlier version would have worked correct. No worries :-) Had you not gotten involved, I never would have seen the xen-devel thread which then referred me to the appropriate Intel doc to confirm that your patch should fix the problem. Your input on this issue has been greatly appreciated. jeff