[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180308151754.d7wozkcuapi4bpvn@treble>
Date: Thu, 8 Mar 2018 09:17:54 -0600
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Mikulas Patocka <mpatocka@...hat.com>,
David Woodhouse <dwmw2@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Andy Lutomirski <luto@...nel.org>,
Arjan van de Ven <arjan@...ux.intel.com>,
Borislav Petkov <bp@...en8.de>,
Dan Williams <dan.j.williams@...el.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fix compilation of 64-bit kernel with 32-bit compiler
On Thu, Mar 08, 2018 at 10:39:44AM +0100, Peter Zijlstra wrote:
> On Thu, Mar 08, 2018 at 04:09:30AM -0500, Mikulas Patocka wrote:
> >
> >
> > On Thu, 8 Mar 2018, Peter Zijlstra wrote:
> >
> > > On Thu, Mar 08, 2018 at 01:11:26AM -0500, Mikulas Patocka wrote:
> > > > The patch b5bc2231b8ad4387c9641f235ca0ad8cd300b6df ("objtool: Add
> > > > retpoline validation") broke compiling 64-bit kernel with 32-bit compiler.
> > > >
> > > > This patch fixes the following error and a large number of "can't find
> > > > rela for retpoline_safe" errors that occur when using x32 or i386 gcc.
> > > >
> > > > You shouldn't use the type 'unsigned long' in objtool at all - because its
> > > > size depends on the compiler and not on the kernel you are compiling.
> > >
> > > Your patch is wrong because the data field is actually a long. A correct
> > > patch is already in merged in tip.
> >
> > I'm wondering, why is objtool using 'unsigned long' at all? Why not
> > uint32_t and uint64_t? The size of 'unsigned long' is dependent on the
> > compiler, so it will lead to different behavior.
>
> Because pointers... As Josh said, I should've used the right ELF methods
> which use the object's ABI.
But there are still a few other places where objtool uses longs
unnecessarily. Those should probably be converted. Patches welcome...
--
Josh
Powered by blists - more mailing lists