From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754887AbbCFIgr (ORCPT ); Fri, 6 Mar 2015 03:36:47 -0500 Received: from mail-we0-f179.google.com ([74.125.82.179]:39635 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752198AbbCFIgo (ORCPT ); Fri, 6 Mar 2015 03:36:44 -0500 Date: Fri, 6 Mar 2015 09:36:38 +0100 From: Ingo Molnar To: Andy Lutomirski Cc: Jiri Slaby , Jan Beulich , "linux-kernel@vger.kernel.org" , rguenther@suse.de, stable , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , X86 ML , Linus Torvalds , Andrew Morton , Borislav Petkov Subject: Re: [PATCH 1/1] x86/vdso: fix a reference to a non-existing instruction Message-ID: <20150306083637.GA1320@gmail.com> References: <1425543211-12542-1-git-send-email-jslaby@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Andy Lutomirski wrote: > On Thu, Mar 5, 2015 at 12:13 AM, Jiri Slaby wrote: > > .LSTARTFDEDLSI1 says: > > /* HACK: The dwarf2 unwind routines will subtract 1 from the > > return address to get an address in the middle of the > > presumed call instruction. Since we didn't get here via > > a call, we need to include the nop before the real start > > to make up for it. */ > > .long .LSTART_sigreturn-1-. /* PC-relative start address */ > > > > But commit 69d0627a7f6e891189124d784d2fa90cae7c449a (x86 vDSO: reorder > > vdso32 code) from 2.6.25 replaced > > .org __kernel_vsyscall+32,0x90 > > by ALIGN right before __kernel_sigreturn. Of course, ALIGN need not > > generate any nop in there. Esp. gcc5 collapses vclock_gettime.o and > > int80.o together with no generated nops as "ALIGN". In that case > > kernel does not even link: > > ld: .eh_frame_hdr table[4] FDE at 0000000000000648 overlaps table[5] FDE at 0000000000000670. > > > > So fix this by adding there at least a single nop and make the > > function ALIGN possibly with more nops then. > > > > Kudos for reporting and diagnosing should go to Richard. > > > > Signed-off-by: Jiri Slaby > > Reported-by: Richard Biener > > Cc: stable@vger.kernel.org > > Cc: Andy Lutomirski > > Cc: Thomas Gleixner > > Cc: Ingo Molnar > > Cc: "H. Peter Anvin" > > Cc: x86@kernel.org > > --- > > arch/x86/vdso/vdso32/sigreturn.S | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/x86/vdso/vdso32/sigreturn.S b/arch/x86/vdso/vdso32/sigreturn.S > > index 31776d0efc8c..d7ec4e251c0a 100644 > > --- a/arch/x86/vdso/vdso32/sigreturn.S > > +++ b/arch/x86/vdso/vdso32/sigreturn.S > > @@ -17,6 +17,7 @@ > > .text > > .globl __kernel_sigreturn > > .type __kernel_sigreturn,@function > > + nop /* this guy is needed for .LSTARTFDEDLSI1 below (watch for HACK) */ > > ALIGN > > __kernel_sigreturn: > > .LSTART_sigreturn: > > Acked-by: Andy Lutomirski > > Ingo or Thomas, can you apply this to tip:x86/urgent for this weekend? Sure, I've applied it. > Are we willing to depend on cfi-capable assemblers for 32-bit? If > so, could we rewrite this garbage with .cfi directives? The current > code is incomprehensible. We could try, that code is certainly a mess. How much does that restrict our build compatibility? Thanks, Ingo