Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp362331rwe; Thu, 25 Aug 2022 01:26:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ujhtcL3I+I9RSTt6tTLRD/3DZifjGK2hS4YbdoObO1voaBI5pYh5UhPUM7tp2yQfQZiNm X-Received: by 2002:a17:90b:4a84:b0:1fb:60a5:96b4 with SMTP id lp4-20020a17090b4a8400b001fb60a596b4mr12586352pjb.149.1661416006865; Thu, 25 Aug 2022 01:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661416006; cv=none; d=google.com; s=arc-20160816; b=qh734lPayqYqbf3HkRCQDz7OzYkM1HxVt4BsWWKwrOPshoVKqxcjE3iYw9ZFByvWT/ fETyk9ilN+xtyA6lUuyFXF9aSQ7pABpTl6kcbKv9og8UpXIRm/gaZ2MAYN1DAIBbKFht tkX1VzOUUgt0OZnxtI3zjoJ0orYB2SxG94N2XnpXukvPPPeKJ7ZeHvLMdRhC4LT3Bw36 UIo2YsNrpnfcHUQg2kB1y71hI1PpSQ4i2ceDF27HRavbCvyn8Z25xX89BhpA721b82KM fbgQWf9AANMzq249IepzgXgiNiQsjLiOuKnU5wmHV3uYLHPUuBIB/Bg8iskaEVPg9JDn BrwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=UtVip1icK7gJdBlHq+HFWJBnOoW3QoCQ+h8pU+n3KkA=; b=Dd1S3iFjhlPB25BQNHBdHyYItbEGLi+tfkLOfPwPuvitbWz8Zrw4P9YczmoYsKt/Ld XIO+kzo8gSxV9WNjO1ag1FXQzfaLkxBupqACcGabbhdzruZPrijPlXnDCNd/prJceH7Y 3I+oN99Pw4BLQ/2CUKJ9ndl7vi6UCBxv7ozYBH5LJAYlkjcp4k8vwWjjh3DswKwVrYEQ wrBt12TQMPsUnvxi2K5iFe5kv7zLCsaJGz7SD8bnbF8aJgsRcXY8cWPHz1LDemJkYuhD GNKxhP3xWC1HjrBHEdvx/BowiODIB4rrhWaR5taK05RfMuTACDuNIjzOe4tDEGo9U9r8 o30A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=ZLFEHd4S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s17-20020a17090302d100b0016da4dcae60si19613423plk.64.2022.08.25.01.26.36; Thu, 25 Aug 2022 01:26:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=ZLFEHd4S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237635AbiHYHxS (ORCPT + 99 others); Thu, 25 Aug 2022 03:53:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234910AbiHYHxK (ORCPT ); Thu, 25 Aug 2022 03:53:10 -0400 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACA69A00E6; Thu, 25 Aug 2022 00:53:08 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4MCwDt5BS1z4xV9; Thu, 25 Aug 2022 17:53:02 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1661413983; bh=UtVip1icK7gJdBlHq+HFWJBnOoW3QoCQ+h8pU+n3KkA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ZLFEHd4Sc+LArWxSHPMZaxUV5Xt5HbCBwxEJoAOkDftQUBd3UvDzQ3SPoUGfIq8+Y XOXVABGmUJRXNewPOhBZ4PnZBgAclyRWiDmLWWWIEoOxbTyf0lT9HmzLfn6qDXHVP8 4cFLNr2mtb3VMBT0+X8XSw8kOQcDbMBET6kwqKOBcIoT5DWSkK5aoD9YgXXoTklXi4 4vn7aZmWvMmRDrzEWJ1c3IdlA0o+UvHCBus9SLXerZ9zIaIxILLCzH95mjf0d5/kTH Nh5wLMJbIfMZsTuGrUc2j6C3xLq/AaC3ujgNFv8DeGoG8jRuDO1B7lmoCz2us+rszT QVS80HXLzHXbw== From: Michael Ellerman To: Masahiro Yamada , Nicholas Piggin , Christophe Leroy , linuxppc-dev@lists.ozlabs.org Cc: linux-kbuild@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc: align syscall table for ppc32 In-Reply-To: <20220820165129.1147589-1-masahiroy@kernel.org> References: <20220820165129.1147589-1-masahiroy@kernel.org> Date: Thu, 25 Aug 2022 17:53:02 +1000 Message-ID: <874jy0lpy9.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Masahiro Yamada writes: > Christophe Leroy reported that commit 7b4537199a4a ("kbuild: link > symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS") broke > mpc85xx_defconfig + CONFIG_RELOCATABLE=y. > > LD vmlinux > SYSMAP System.map > SORTTAB vmlinux > CHKREL vmlinux > WARNING: 451 bad relocations > c0b312a9 R_PPC_UADDR32 .head.text-0x3ff9ed54 > c0b312ad R_PPC_UADDR32 .head.text-0x3ffac224 > c0b312b1 R_PPC_UADDR32 .head.text-0x3ffb09f4 > c0b312b5 R_PPC_UADDR32 .head.text-0x3fe184dc > c0b312b9 R_PPC_UADDR32 .head.text-0x3fe183a8 > ... > > The compiler emits a bunch of R_PPC_UADDR32, which is not supported by > arch/powerpc/kernel/reloc_32.S. > > The reason is there exists an unaligned symbol. > > $ powerpc-linux-gnu-nm -n vmlinux > ... > c0b31258 d spe_aligninfo > c0b31298 d __func__.0 > c0b312a9 D sys_call_table > c0b319b8 d __func__.0 > > Commit 7b4537199a4a is not the root cause. Even before that, I can > reproduce the same issue for mpc85xx_defconfig + CONFIG_RELOCATABLE=y > + CONFIG_MODVERSIONS=n. > > It is just that nobody did not notice it because when CONFIG_MODVERSIONS > is enabled, a __crc_* symbol inserted before sys_call_table was hiding > the unalignment issue. > > I checked the commit history, but I could not understand commit > 46b45b10f142 ("[POWERPC] Align the sys_call_table"). > > It said 'Our _GLOBAL macro does a ".align 2" so the alignment is fine > for 32 bit'. I checked the _GLOBAL in include/asm-powerpc/ppc_asm.h > at that time. _GLOBAL specifies ".align 2" for ppc64, but no .align > for ppc32. > > Commit c857c43b34ec ("powerpc: Don't use a function descriptor for > system call table") removed _GLOBAL from the syscall table. > > Anyway, adding alignment to the syscall table for ppc32 fixes the issue. > > I am not giving Fixes tag because I do not know since when it has been > broken, but presumably it has been for a long while. Thanks. I trimmed the change log a bit just to say ~= it's been broken for ever, and added a Cc to stable. cheers