Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752372AbcLMXID (ORCPT ); Tue, 13 Dec 2016 18:08:03 -0500 Received: from mail.skyhub.de ([78.46.96.112]:48643 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750771AbcLMXIB (ORCPT ); Tue, 13 Dec 2016 18:08:01 -0500 User-Agent: K-9 Mail for Android In-Reply-To: References: <20161208162150.148763-1-kirill.shutemov@linux.intel.com> <20161208162150.148763-17-kirill.shutemov@linux.intel.com> <20161208200505.c6xiy56oufg6d24m@pd.tnic> <20161208202013.uutsny6avn5gimwq@pd.tnic> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [RFC, PATCHv1 15/28] x86: detect 5-level paging support From: Boris Petkov Date: Wed, 14 Dec 2016 00:07:54 +0100 To: "H. Peter Anvin" , Linus Torvalds CC: "Kirill A. Shutemov" , Andrew Morton , the arch/x86 maintainers , Thomas Gleixner , Ingo Molnar , Arnd Bergmann , Andi Kleen , Dave Hansen , Andy Lutomirski , "linux-arch@vger.kernel.org" , linux-mm , Linux Kernel Mailing List Message-ID: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 854 Lines: 19 On December 13, 2016 11:44:06 PM GMT+01:00, "H. Peter Anvin" wrote: >When compiling with -fPIC gcc treats ebx as a "fixed register". A >fixed >register can't be spilled, and so a clobber of a fixed register is a >fatal error. > >Like it or not, it's how it works. > > -hpa In the meantime I talked to my gcc guy and here's the deal: There are gcc versions (4.x and earlier) which do not save/restore the PIC register around an inline asm even if it is one of the registers that the inline asm clobbers. Therefore the saving/restoring needs to be done by the inline asm itself. 5.x and later handle that fine. Thus I was thinking of adding a build-time check for the gcc version but that might turn out to be more code in the end than those ugly ifnc clauses. -- Sent from a small device: formatting sux and brevity is inevitable.