Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp928133pxb; Wed, 29 Sep 2021 12:44:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhy40tmzIJcpxjkPoo+2WuBQO59b3UboE+PE+X8dsB1pj/gdnQ9r6e9OU+Yo4JEf8r40Kg X-Received: by 2002:a17:907:937:: with SMTP id au23mr1949702ejc.292.1632944640153; Wed, 29 Sep 2021 12:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632944640; cv=none; d=google.com; s=arc-20160816; b=CuiEkauYnwUBZGEWdAwT9HqRL/UjfQ6xFVg+iHKGETyAXYOmYpO5DtRVDPshrjQl5d fRdJ+SUAKvFoxLwPtcf7wSLagtdtqid10HoqMNECKArYhN2dbVyrdy6sj5uNerneoUnM 0W5eI9UuFuWFqGm+cAK/AkbSCV51HxTHjsK8EHU3aTqdgX8/pHXaxYN+yI6m/GtNkq9L uv0yQ6gKQTOg2IJ+nVuAgxiWsuE+NpZ7wwRJkjZK9ra7r1Ons7L1l4oJtSnQ4P4kWTBI tK98KeDCxAL7R5qnmyE9aCeD4k5gh3QOcyxG/OaX59ttiPlfQSOtpImcvuLcImP4K2NK Gm2A== 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:mime-version:message-id:date :dkim-signature; bh=2eiaoE39I+Y5USofHF5+1Zs2VxE4hHgvlRkoEd7CIRQ=; b=dix1L/AgV9bnbuA+qNE989n9Ep5wqqJXL7+D4z3JgiF3XUFXJ39qZwv3266/pu2m/W qv4nrQDtzx1UJEqycs7XCSuFOCmQY3opHOTZj71fy9GOW4jlXtKF54PzJQVaODybykiw r8nNJVeQdVzs1ke4fFlMtgvTfYKku3HpyVlNJxaJ4poCziMlJITBASF4ztUxxUlMP1w1 gIWckjdgbh9lxsHKSsz0CvZmz+PWT9dP3m7rtMbRoNXTBX3l/atMTA92ZMUOsxHNyBQD AmSvOVJj7pgs0gVaQcdAo0nSTf0loWM0nnEi8UgDLoXpMNFoRLhLhP6NjSxsL4Xdo5gz jdBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=KSrPbkIQ; 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 5si1014550ejd.513.2021.09.29.12.43.35; Wed, 29 Sep 2021 12:44:00 -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=KSrPbkIQ; 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 S1346429AbhI2TKE (ORCPT + 99 others); Wed, 29 Sep 2021 15:10:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346437AbhI2TKD (ORCPT ); Wed, 29 Sep 2021 15:10:03 -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 DF081C06161C for ; Wed, 29 Sep 2021 12:08:18 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id d81-20020a251d54000000b005b55772ca97so4687338ybd.19 for ; Wed, 29 Sep 2021 12:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=2eiaoE39I+Y5USofHF5+1Zs2VxE4hHgvlRkoEd7CIRQ=; b=KSrPbkIQ6OQGiDM2rTJO7WdVzBUK3NiB43o6MbpAOmawS88BI7uRZbvF09yVFmUVEw sXrdN3mntfbhYB0B0+/K6vSiFcCAG344fHVF40bec51rOa8zjFMohnD/v9QX+0PJ7LHF pcr8/D4aCOrRFW82MBxn6JYULwgovVEP8p1t+vvdNZWfc3TFR4QcaQSUla6ZePTCg8jN cjWhE817yZzuI247eWhRvJ4VU6sPDapng4w1FpxenIXS8pRbAPMedOXmSCFmBjbVgpz+ str6GLmP5ERAFqtmzpWPPpmq6bkzbAdIxjoS3SfqzWWE0Wyi26CAVbkK7oCIaZJbc0A3 GDKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=2eiaoE39I+Y5USofHF5+1Zs2VxE4hHgvlRkoEd7CIRQ=; b=AQokyWnk2Bb+tYRREwzWVU4uGWACpQyRlMkA84lPZTEsIQU0MtgZ9lP33H+5thTn6U UWwotUa+k8QGQDTEWXIIl8xsMrhTwNGpF7FjMArgBdch5AA0AxNDv9MVP3t/III+d8EF dFSxDfFa5PAeKohxydk9cooJGRKOxYgu8MbMExakyMblZZ5X7bkesiZLULDAoiIfDDir UGT6VZ0bMav7B+e/ZViJ2S9MEnaL05kVL7jlm4UNC19ffY0YwH3VEvBbqsDN79ZsoJ2m XCSWgDnQp32t3GyAikUtIM3W9T0v9vxc7wEbG7YLEFhck+ZiaIu6InshXXjrBbKjn4Tu QUvA== X-Gm-Message-State: AOAM533G1odduZsGO6sOtJpZrK0VZPkIVJ41Bvlke9rtio7rc+umQlRC PH/7nvTzwTwshJDfEk3PvOEXD0MYey0hULTcZsg= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:da31:1dfd:2e69:dc82]) (user=ndesaulniers job=sendgmr) by 2002:a25:1285:: with SMTP id 127mr1846238ybs.299.1632942498030; Wed, 29 Sep 2021 12:08:18 -0700 (PDT) Date: Wed, 29 Sep 2021 12:08:05 -0700 Message-Id: <20210929190810.1597399-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.33.0.685.g46640cef36-goog Subject: [PATCH] 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 , Arnd Bergmann , Geert Uytterhoeven , Linus Walleij , Andrew Morton , Anshuman Khandual , Mike Rapoport , YiFei Zhu , "=?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?=" , 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 Signed-off-by: Nick Desaulniers --- arch/arm/Kconfig | 1 + arch/arm/mm/proc-macros.S | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index fc196421b2ce..b760dd45b734 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -92,6 +92,7 @@ config ARM select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL && !CC_IS_CLANG select HAVE_FUNCTION_TRACER if !XIP_KERNEL + select HAVE_FUTEX_CMPXCHG if FUTEX select HAVE_GCC_PLUGINS select HAVE_HW_BREAKPOINT if PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7) select HAVE_IRQ_TIME_ACCOUNTING 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 -- 2.33.0.685.g46640cef36-goog