From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [RFC, PATCHv1 15/28] x86: detect 5-level paging support Date: Thu, 8 Dec 2016 12:08:53 -0800 Message-ID: References: <20161208162150.148763-1-kirill.shutemov@linux.intel.com> <20161208162150.148763-17-kirill.shutemov@linux.intel.com> <20161208200505.c6xiy56oufg6d24m@pd.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <20161208200505.c6xiy56oufg6d24m@pd.tnic> Sender: owner-linux-mm@kvack.org To: Borislav Petkov Cc: "Kirill A. Shutemov" , Andrew Morton , the arch/x86 maintainers , Thomas Gleixner , Ingo Molnar , Arnd Bergmann , "H. Peter Anvin" , Andi Kleen , Dave Hansen , Andy Lutomirski , "linux-arch@vger.kernel.org" , linux-mm , Linux Kernel Mailing List List-Id: linux-arch.vger.kernel.org On Thu, Dec 8, 2016 at 12:05 PM, Borislav Petkov wrote: > > The cpuid() in cpuflags.c doesn't zero ecx which, if we have to be > pedantic, it should do. It calls CPUID now with the ptr value of its 4th > on 64-bit and 3rd arg on 32-bit, respectively, IINM. In fact, just do a single cpuid_count(), and then implement the traditional cpuid() as just #define cpuid(x, a,b,c,d) cpuid_count(x, 0, a, b, c, d) or something. Especially since that's some of the ugliest inline asm ever due to the nasty BX handling. Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f194.google.com ([209.85.223.194]:36596 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752312AbcLHUIz (ORCPT ); Thu, 8 Dec 2016 15:08:55 -0500 MIME-Version: 1.0 In-Reply-To: <20161208200505.c6xiy56oufg6d24m@pd.tnic> References: <20161208162150.148763-1-kirill.shutemov@linux.intel.com> <20161208162150.148763-17-kirill.shutemov@linux.intel.com> <20161208200505.c6xiy56oufg6d24m@pd.tnic> From: Linus Torvalds Date: Thu, 8 Dec 2016 12:08:53 -0800 Message-ID: Subject: Re: [RFC, PATCHv1 15/28] x86: detect 5-level paging support Content-Type: text/plain; charset=UTF-8 Sender: linux-arch-owner@vger.kernel.org List-ID: To: Borislav Petkov Cc: "Kirill A. Shutemov" , Andrew Morton , the arch/x86 maintainers , Thomas Gleixner , Ingo Molnar , Arnd Bergmann , "H. Peter Anvin" , Andi Kleen , Dave Hansen , Andy Lutomirski , "linux-arch@vger.kernel.org" , linux-mm , Linux Kernel Mailing List Message-ID: <20161208200853.vwc-MeZihPWBN82V3_sbUNzIuNTvGt-fy-4UVWYA08w@z> On Thu, Dec 8, 2016 at 12:05 PM, Borislav Petkov wrote: > > The cpuid() in cpuflags.c doesn't zero ecx which, if we have to be > pedantic, it should do. It calls CPUID now with the ptr value of its 4th > on 64-bit and 3rd arg on 32-bit, respectively, IINM. In fact, just do a single cpuid_count(), and then implement the traditional cpuid() as just #define cpuid(x, a,b,c,d) cpuid_count(x, 0, a, b, c, d) or something. Especially since that's some of the ugliest inline asm ever due to the nasty BX handling. Linus