From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752820AbcAUVwl (ORCPT ); Thu, 21 Jan 2016 16:52:41 -0500 Received: from terminus.zytor.com ([198.137.202.10]:60367 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750826AbcAUVwj (ORCPT ); Thu, 21 Jan 2016 16:52:39 -0500 User-Agent: K-9 Mail for Android In-Reply-To: <20160121214732.GM21930@pd.tnic> References: <1453374160-4648-1-git-send-email-huaitong.han@intel.com> <20160121114250.GD21930@pd.tnic> <56A147F9.1000306@zytor.com> <20160121212109.GK21930@pd.tnic> <56A14CC2.7090607@zytor.com> <20160121213309.GL21930@pd.tnic> <56A14FA0.6090700@zytor.com> <20160121214732.GM21930@pd.tnic> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH V2] x86: use enum cpuid_leafs instead of magic numbers From: "H. Peter Anvin" Date: Thu, 21 Jan 2016 13:52:05 -0800 To: Borislav Petkov CC: Huaitong Han , tglx@linutronix.de, mingo@redhat.com, david.vrabel@citrix.com, rusty@rustcorp.com.au, x86@kernel.org, linux-kernel@vger.kernel.org Message-ID: <6B656D5F-6895-4EDC-8ED1-C210B76A2FF4@zytor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On January 21, 2016 1:47:32 PM PST, Borislav Petkov wrote: >On Thu, Jan 21, 2016 at 01:37:36PM -0800, H. Peter Anvin wrote: >> No, you still need to be able to find the beginning of the capability >> array, but the point is that right now it is implicit in that code >that >> CPUID_1_EDX == 0. > >Ah, you wanna be able to do: > >--- >diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S >index af1112980dd4..143646f0add1 100644 >--- a/arch/x86/kernel/head_32.S >+++ b/arch/x86/kernel/head_32.S >@@ -441,7 +443,7 @@ enable_paging: > movb %al,X86_MODEL > andb $0x0f,%cl # mask mask revision > movb %cl,X86_MASK >- movl %edx,X86_CAPABILITY >+ movl %edx,X86_CAPABILITY + CPUID_1_EDX*4 > > is486: > movl $0x50022,%ecx # set AM, WP, NE and MP Basically, yes. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting.