Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3495714imw; Mon, 11 Jul 2022 09:41:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u+0YnQR2K4YPCHvL/LZvldGERbgI00ly3s9SFOO28KOw/25BUxgTkdkepxVdqvUUIVz4l/ X-Received: by 2002:a17:907:608b:b0:725:f45:39be with SMTP id ht11-20020a170907608b00b007250f4539bemr19937019ejc.669.1657557682557; Mon, 11 Jul 2022 09:41:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657557682; cv=none; d=google.com; s=arc-20160816; b=bPq8Y//pd02dXXi1vuVhoCQiSJZ9Dv2k2KHHWO8ksjCw0O4rzFX0oTpCWdODmQ1X4e YlHklK7WWMMWbqWqnpBl/pa3moQatt2V4jC4IcQUFTC92AFB5/QcLzYtAwYtCicfFOjF 2wuiYbE1YyOt+ABfbT28ujJ3DHjYObuUH5ycYINfOfogWDVbTmNcBSAJPDek0hnnK2i3 qgVqsjJO/Kfzx8IfxUQSon8W0auKnUksiorPSEl0M2XtpZ4X8/FYxzPUC9eyp/QOOlhm x1DYg2+AZNGpdZZVXWXWY4t/r9DJnpgpotklCytte5bnPDXc8G5qn/ICCdO3KQRjeG6x LVPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=L9MaBX0ADCbYKPOd5iafLk3ONE1qneBOG6QIpxWT8/I=; b=tq2AE38JITtMzb5bqy/vJkR1OKUsv718wN2X0phd+WZsmI3YuY0K7Um7VgIDg9KAqh OBmZY8rGUEvpe4YMK3o8KmlSeD9WFvm3Uc5rJFadNB1Q3uovW2cqlXIS/JQw9HtwkNWX +KdYWUgJ40a6glKUkhTo7BVryP9GHdTazrJwaBniJVATLNUx3B7B4PqwV41NdR3BPsaR WMFzWeqpaGViSewUJWk+w4E5dIPFRinY7w0wLfCWJu5fN2Qigv4M9FGQRIRyTWB4WYRR pO3OcLZKVDr+zRRUtYtWZAjuGv283xoYb6xCIqkFULjze/oXHtbdnxumi2BInyRjL4w+ JHCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=eIweT0CW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f16-20020a170906825000b00726c8adb7efsi9000000ejx.224.2022.07.11.09.40.56; Mon, 11 Jul 2022 09:41:22 -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=@infradead.org header.s=bombadil.20210309 header.b=eIweT0CW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230458AbiGKQIQ (ORCPT + 99 others); Mon, 11 Jul 2022 12:08:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231894AbiGKQIB (ORCPT ); Mon, 11 Jul 2022 12:08:01 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAE236E89E; Mon, 11 Jul 2022 09:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=L9MaBX0ADCbYKPOd5iafLk3ONE1qneBOG6QIpxWT8/I=; b=eIweT0CWd1DwElj/q4N/Bs2EYQ fWkvmzkz3WP3CU2XidwPn9jHWSd0NKKlqsvFmJz7C11+LQHxWqgqf7eT/BANntkshoUrsdGe+0uvM B+gebA0UIGukk0caBUMIv4lh4Av7judVNRrosKCTpsKfDmtiN1GZH2oQxDV/JfeuhnwskYy+lRzBM daWZDfPgIfN1P40tTtJIWAJu44XpwfG/SM6i83vhK88/lvNBRKsTOjwpDdwerLQFfjM/pzGdnQ64Y e8ekbETuvWz5LgjIyfFeOI87+DZzjOBYiLKYUFT8nxGjYq7on30FucfTwt8DUgplc2SxnSbQA1BzU ZlGaZhpA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAvwn-0037cE-AB; Mon, 11 Jul 2022 16:07:45 +0000 Date: Mon, 11 Jul 2022 09:07:45 -0700 From: Luis Chamberlain To: Helge Deller Cc: jeyu@kernel.org, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org Subject: Re: [PATCH v3] modules: Ensure natural alignment for .altinstructions and __bug_table sections Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On Fri, Jul 08, 2022 at 11:44:54AM +0200, Helge Deller wrote: > In the kernel image vmlinux.lds.S linker scripts the .altinstructions > and __bug_table sections are 4- or 8-byte aligned because they hold 32- > and/or 64-bit values. > > Most architectures use altinstructions and BUG() or WARN() in modules as > well, but in the module linker script (module.lds.S) those sections are > currently missing. As consequence the linker will store their content > byte-aligned by default, which then can lead to unnecessary unaligned > memory accesses by the CPU when those tables are processed at runtime. > > Usually unaligned memory accesses are unnoticed, because either the > hardware (as on x86 CPUs) or in-kernel exception handlers (e.g. on > parisc or sparc) emulate and fix them up at runtime. Nevertheless, such > unaligned accesses introduce a performance penalty and can even crash > the kernel if there is a bug in the unalignment exception handlers > (which happened once to me on the parisc architecture and which is why I > noticed that issue at all). > > This patch fixes a non-critical issue and might be backported at any time. > It's trivial and shouldn't introduce any regression because it simply > tells the linker to use a different (8-byte alignment) for those > sections by default. > > Signed-off-by: Helge Deller > Link: https://lore.kernel.org/all/Yr8%2Fgr8e8I7tVX4d@p100/ Thanks! Queued onto modules-next. Luis