Received: by 2002:ac0:cd04:0:0:0:0:0 with SMTP id w4csp132109imn; Fri, 1 Jul 2022 11:28:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uQlaWcauuE+peLakg79N4PxCCqniiXPSNpFNEAeaytTvGPb8+pz7g3I6CaOojKApovveeo X-Received: by 2002:a63:7448:0:b0:40c:7d4b:e7c6 with SMTP id e8-20020a637448000000b0040c7d4be7c6mr13367977pgn.140.1656700090682; Fri, 01 Jul 2022 11:28:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656700090; cv=none; d=google.com; s=arc-20160816; b=dAn9uXFh36WTvoFLkBCPN4u9uSJMXRon527HxEwrq1Vs1qAeJnExn2VgXYAJ5K7BLn 58nYljUi//GKd92qtCQp5svlNrMhcLKGlsB0hoe7+i29K4xayhmsEbWZq5HyRFeVM549 YUqnNZYBTXIEjP7ZxZWu+wlg0o9VHHAntq03vFFb3mRkPOT8mNcqNKmUVDxUiXnnHYi8 zijyYeX4p5U0ygVOmcCUEuYgVxWxSqMWJBx8tDTFaIAm8fR6oWndGeuA73m65+1eOaGX 30jXNLO0AQlZDw6F1Y9jagmVPCVa0zQ19eCZD2V6CaOohZAWRdZZrnvWfzCDQBnHQgBA ptqA== 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=ZPeAoAQGd/dAHDv+0muzdJmtfTPd5PlsJuI6fl18td4=; b=Xj2EeAtNEAT0VDJ5tgHlhKA9eEKupXs9nzhipB4oWK/QmLy8e7pRWmeXh8CM4qhhIh yI79fX7qzRowtZH3JsPVjr3+ggBQgLKzwCk+jVIseJONquM71ck8lN2UxX2EAeiM2rAr BVcPWHUdSQNTtJ6QL4Kgybt41f/b3z9qGrBkG6OiPVI/vG5T6+EW6vLU7vS8SdLRKsxv sxP4yZVWhcxBecIpsEponR4B2/Kj3D78WuL9YLUWV2FiEHYSBtPx3BJjYFVmwYVqa6uv O6qZVXiWDRYDSJAa5AU/1zGYOkSnkrUsuCb7hHgzK5RxqrZfoQWI2a0bxaAB5Amn6kLL jvag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=g88+VmrE; 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 a22-20020a656056000000b00406fb6d95b5si2127922pgp.786.2022.07.01.11.27.57; Fri, 01 Jul 2022 11:28:10 -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=g88+VmrE; 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 S231382AbiGASCg (ORCPT + 99 others); Fri, 1 Jul 2022 14:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229616AbiGASCe (ORCPT ); Fri, 1 Jul 2022 14:02:34 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6074F3FBDB; Fri, 1 Jul 2022 11:02:34 -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=ZPeAoAQGd/dAHDv+0muzdJmtfTPd5PlsJuI6fl18td4=; b=g88+VmrETYRxPZAQwilIOXhYrO tNJR6pqKwjPdMW0jx2gfcYlAjA2hl9OKLoENxyPHhtNys//9urQsANz3YjmXFP3ISPntSfJMRGMBy cGd8mLUJJFJCEgN5K0E++ig1zW/9uSgQfX3WsVghPJXb4e6owpQdsj4yZVAagjZS42+FX01HIaODk WuTZ5E4CCS0MNDUXqhBO0DuJFizELQFpt6UG6bqW7FM2z987RytPn7Vk0kXpgtWJbQSgUw+Zhq4Mj 25wKqI2B86oNFzhRS8M6in/XzV5Oib31HWyV2g4SOVbxHcCg1AjUCMrKh8Tp6LdWDlnsHCgnjzNhk QrOhsIUQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7KyN-006JRZ-CH; Fri, 01 Jul 2022 18:02:31 +0000 Date: Fri, 1 Jul 2022 11:02:31 -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, live-patching@vger.kernel.org Subject: Re: [PATCH 1/2] modules: Ensure natural alignment for .altinstructions and __bug_table sections Message-ID: References: <20220627190551.517561-1-deller@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220627190551.517561-1-deller@gmx.de> Sender: Luis Chamberlain X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, Jun 27, 2022 at 09:05:50PM +0200, Helge Deller wrote: > In the kernel image vmlinux.lds.S linker scripts the .altinstructions > and __bug_table sections are 32- or 64-bit aligned because they hold 32- > and/or 64-bit values. > > But for modules the module.lds.S linker script doesn't define a default > alignment yet, so the linker chooses the default byte-alignment, which > then leads to unnecessary unaligned memory accesses at runtime. > > This patch adds the missing alignments. > > Signed-off-by: Helge Deller Good catch but does this fix a real world issue? When are altinstructions used for modules? When are alternatives used for modules? How did you notice this issue? This information should go into the commit log. Luis > --- > scripts/module.lds.S | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/scripts/module.lds.S b/scripts/module.lds.S > index 1d0e1e4dc3d2..3a3aa2354ed8 100644 > --- a/scripts/module.lds.S > +++ b/scripts/module.lds.S > @@ -27,6 +27,8 @@ SECTIONS { > .ctors 0 : ALIGN(8) { *(SORT(.ctors.*)) *(.ctors) } > .init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) } > > + .altinstructions 0 : ALIGN(8) { KEEP(*(.altinstructions)) } > + __bug_table 0 : ALIGN(8) { KEEP(*(__bug_table)) } > __jump_table 0 : ALIGN(8) { KEEP(*(__jump_table)) } > > __patchable_function_entries : { *(__patchable_function_entries) } > -- > 2.35.3 >