Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp931295pxb; Wed, 29 Sep 2021 12:49:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym39POPwLCNuZHNv4EvJtk9WKEWiRbpx0OkGqyh7E0EXViRn4TWedQRQuwo7UJZWrojaqr X-Received: by 2002:aa7:c690:: with SMTP id n16mr2143195edq.304.1632944948534; Wed, 29 Sep 2021 12:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632944948; cv=none; d=google.com; s=arc-20160816; b=SDNVXiEWXFZha9l/psOdQj4ROCqXLZzGxUs26aMBpGxCdNrD50Iq697IPviuAKzsFG /ONTkg/+Ia94uAh3tqaHYbDYPD5Z/ZML9hCpCzYKeY3LugYTq7dTRxhnMgoasJ4fHX30 br8QXAqUETzXCgwpRkO8pN2D1D/l4sW57OqnIQqKkXPr5bh0KK/GDBZU+dH8lJG8A+9l TVxHdccMpCvF/bBZidTFTHJ0Yq8aTofSKvq2d/la+pF8nK75mNwNQp7MtUeLa/IIeoDI 1uaguqsKHKBM3hFgjAwhFukW+K+vAt4PsmUkP/Bu1zUgYOEXLm0pIPU/GAxXw0mMKPxc 68mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=63GoLmMa0FISTNSj54qXjbso1R5Gm74Cq4uLpOpYGuc=; b=mcPRm44ZuFh63CFK6y0DQ8qEE++5DeCBcCcBJPdVDReBQYHCXLzqBbC2LQTSOiMZi0 Q8LkGP0bNl/klgiwhqvLErWrZAvojQS/Gtttywq1LXZhoGqZod2NnyhvVi6ni1yR78Le eVHeL+FjdgoM1gsfOrr5h1GWTvFLVkEgz1JqQgvLzQNLiTuDk/9dU3ReGktoVsImsIVH BFlKN8I5ftAZrMYM+cDkUQWkAWEL0noUOm0H0IbWxkQHADe6FLgnHbeeVkzOk+ObDIcy RBsrJg0Mi60Si3Q7c/KJrL470DJLotgtmD5QLwd83rp/t5R+vizhdOxiwhJdtsGHyAHb BYIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ATWvAqdp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi27si1003383edb.590.2021.09.29.12.48.32; Wed, 29 Sep 2021 12:49:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ATWvAqdp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346549AbhI2TWN (ORCPT + 99 others); Wed, 29 Sep 2021 15:22:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245131AbhI2TWM (ORCPT ); Wed, 29 Sep 2021 15:22:12 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5105C06161C for ; Wed, 29 Sep 2021 12:20:30 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id w4-20020a056902100400b005b6b29d9a27so4769247ybt.20 for ; Wed, 29 Sep 2021 12:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=63GoLmMa0FISTNSj54qXjbso1R5Gm74Cq4uLpOpYGuc=; b=ATWvAqdpQVpqVi4K3NqKAqDFl3zEfb62R+RuzCeC1G0ZhU6f2/anEr9Q3QSCT6t4UM 6EGIK8wuaWhvpSxTKnZNdh3nK5MR6/r8tGgVpeSYO6nAwCLUADKEYLRAqpowbWylhLLh b/atyNM8TbsxrqxmEkQ6eN5ffBfdaGbMFfXec99LhIYkD+kW+d6w7ItvVHe8R8RAQqfa sejzsbhuOq/WMOYgdWvmoJekAqRzoNjHjI4BB4jkbS/cWQ2A58E8O6DwmP8kCmkOK93G fziZ84ik03TP8/PLBTZ16lBLhnJWO3V35UeueoaWixFRXV0EQVIQV3qHxoJRp+T38n8I rJbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=63GoLmMa0FISTNSj54qXjbso1R5Gm74Cq4uLpOpYGuc=; b=3tITd3IrQAn9VNwmyySN3o34h0T+AL71MoT3oFiByhJj9P57itnvyXUhuKjYJvqvFZ nJC32fpwTj4kQezWPzx0qYAX1OTEJtNrfBHLcR/Hw1a/5pQWj4XC5TpT3f0vKxKd0UNu YC7+BDoG+uZ+T/pTlY4LHni+9D4iDAMWHTRJscw8CRU6WkXwhJ0mrUWXinzBYg7EeqVL m21GxdGDbeWO9MHNB5Piqr68dQsZIS2noDvaul9VJkJDnSkh8bXpVXAhVs7TKJfSbh00 E/seC5+K0BLnuXxi5qXgY4yluiJmAcYtLGFLmcHaS7fdSjuyh77NyB7Z2xTVBmCWo73H nRZg== X-Gm-Message-State: AOAM530lplsrbrpnGOZjAHkMgElc4NykMU33y85rdRSY2z/m0afmh46m 2tgYR6igJ7jPrvWrlDP3VfKfMOBVAn+yz9Fmgg0= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:da31:1dfd:2e69:dc82]) (user=ndesaulniers job=sendgmr) by 2002:a25:690a:: with SMTP id e10mr1739500ybc.393.1632943230203; Wed, 29 Sep 2021 12:20:30 -0700 (PDT) Date: Wed, 29 Sep 2021 12:20:24 -0700 In-Reply-To: Message-Id: <20210929192026.1604095-1-ndesaulniers@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.33.0.685.g46640cef36-goog Subject: [PATCH v2] ARM: mm: proc-macros: ensure *_tlb_fns are 4B aligned From: Nick Desaulniers To: linux-arm-kernel@lists.infradead.org Cc: Fangrui Song , Peter Smith , Nick Desaulniers , Ard Biesheuvel , Nathan Chancellor , Richard Henderson , Russell King , Dave Martin , Nicolas Pitre , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org QEMU 6.1.0 is more correct about trapping on misaligned accesses. A kernel built with CONFIG_THUMB2_KERNEL=y and using clang as the assembler could generate non-naturally-aligned v7wbi_tlb_fns which results in a boot failure. The original commit adding the macro missed the .align directive on this data. Fixes: 66a625a88174 ("ARM: mm: proc-macros: Add generic proc/cache/tlb struct definition macros") Link: https://github.com/ClangBuiltLinux/linux/issues/1447 Link: https://lore.kernel.org/all/0699da7b-354f-aecc-a62f-e25693209af4@linaro.org/ Debugged-by: Ard Biesheuvel Debugged-by: Nathan Chancellor Debugged-by: Richard Henderson Suggested-by: Ard Biesheuvel Acked-by: Ard Biesheuvel Signed-off-by: Nick Desaulniers --- Changes V1 -> V2: * Drop accidentally committed Kconfig change. * Pick up Ard's AB tag. arch/arm/mm/proc-macros.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S index e2c743aa2eb2..d9f7dfe2a7ed 100644 --- a/arch/arm/mm/proc-macros.S +++ b/arch/arm/mm/proc-macros.S @@ -340,6 +340,7 @@ ENTRY(\name\()_cache_fns) .macro define_tlb_functions name:req, flags_up:req, flags_smp .type \name\()_tlb_fns, #object + .align 2 ENTRY(\name\()_tlb_fns) .long \name\()_flush_user_tlb_range .long \name\()_flush_kern_tlb_range base-commit: 02d5e016800d082058b3d3b7c3ede136cdc6ddcb prerequisite-patch-id: 3edbe4a8485c7a75a61dbbe299e8ce1985d87ee0 -- 2.33.0.685.g46640cef36-goog