From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v2 2/3] x86/AMD: support further feature masking MSRs Date: Tue, 08 Apr 2014 09:50:51 -0400 Message-ID: <5343FEBB.7090202@oracle.com> References: <53428DCC020000780000607D@nat28.tlf.novell.com> <53428F4402000078000060BB@nat28.tlf.novell.com> <5342C28C.2090809@oracle.com> <5343BE3B020000780000668A@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WXWNU-0002Bv-QO for xen-devel@lists.xenproject.org; Tue, 08 Apr 2014 13:47:53 +0000 In-Reply-To: <5343BE3B020000780000668A@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel , Keir Fraser , Aravind Gopalakrishnan , suravee.suthikulpanit@amd.com List-Id: xen-devel@lists.xenproject.org On 04/08/2014 03:15 AM, Jan Beulich wrote: >>>> On 07.04.14 at 17:21, wrote: >> On 04/07/2014 05:43 AM, Jan Beulich wrote: >> >> @@ -179,11 +196,39 @@ static void __devinit set_cpuidmask(cons >> printk("Writing CPUID extended feature mask ECX:EDX -> %08Xh:%08Xh\n", >> extfeat_ecx, extfeat_edx); >> >> + if (c->cpuid_level >= 7) >> + cpuid_count(7, 0, &eax, &ebx, &ecx, &edx); >> + else >> + ebx = eax = 0; >> + if ((eax | ebx) && ~(l7s0_eax & l7s0_ebx)) { >> + if (l7s0_eax > eax) >> + l7s0_eax = eax; >> + l7s0_ebx &= ebx; >> >> >> Can you explain why eax is treated differently here (i.e. not ANDing it >> as is done with ebx)? > Generally I think code like this implies that you know the specification: > eax here represents the maximum supported subleaf, and hence > needs to be limited rather than masked. All specs that I have say that bits of CPUID Fn0000_0007_EAX_x0 are reserved. -boris