From patchwork Wed Sep 29 19:08:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12526481 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3841C433EF for ; Wed, 29 Sep 2021 19:10:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6964F61526 for ; Wed, 29 Sep 2021 19:10:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6964F61526 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Mime-Version: Message-Id:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=2vOVIDZ4JaC8dRNgkj9t8ts9Nun1ZGdUnSWhc5zV/1U=; b=172 qh1bzkn99AH7J595XGL71fF0B7WLggVPnDYPL66QnWrx1JNCL+220EQ8/2q+FTF7EE+uPD/WePcQs OML8AehL4uFXAtRxzoyyFdpwhJnU509n5n7Htxq1jOx7qmJqsfmj6FGBnZ8g+B8YFZKP5QWAlz8z1 ttyVojAnLNl9oPwrH3Y3EsqGsXwdanJlE5N56vzUHaBmAgnYS/3E/+v9YslmuAOdJe6Hfus8uHrjt AMXYwOnzH11HfS5QHz4vE4IXPBWhbzwhPQqRwFemuNN/P245lVbMwdNy321DIcM1s1FGu0fjnceSx oWm2V6QOh+qBCl8lCNYO/UPwsoQmNxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVewJ-00C8JF-AV; Wed, 29 Sep 2021 19:08:23 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVewG-00C8Ib-HW for linux-arm-kernel@lists.infradead.org; Wed, 29 Sep 2021 19:08:22 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 81-20020a251254000000b005b6220d81efso4737950ybs.12 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=EY2Iw7cYIT1D7KusHTcTnCmeVlPqA92kDLsb8xzQfAcotK61J9PPgWXrzedTzD8I3T fG2m5zKjkK1oPzbjUhXxqyIYevNKzky7RZeGJGLp81DHwXssGSmDBwu+VbsrwJEp7/xd PKu+ugpLS/743iwvpq6ybP+cJJixI2lKmRIZjjEiyIOs4HprROJIb8TgPAuxhyMHpdLw kXa6455k5PuamFGOGdwyqRzPqCy2J1NG5rlLLVvKrNXohUoQGZH5E1t3V+KOV7KuIFMa 9MTcHL8JD3QWe5Owh4idcBurzuzzNJvZ12taasYuYXc8fNuPvZFLS4BYvTuJBBqkEO3B 0h2g== X-Gm-Message-State: AOAM5337OHAMRM4SRMPeDBz40QHL4aHgLjzn17Di4SYwoOF+bv8s8q4N U9x4TP8xGO5A9wfq3Q5v8AqZ0enMqgbAsYOytzLN4AYD4rWIu1k7IJVIqJNBGB+tY+8ebszf2NK zHO9ZjwwRl0NwN/oGvHrna+DApR44Ewgs8NkSttAaI9LeckP9BTEy5/N1UgPkstMV/RS+1OfSgK GBOAX2+J+m9LIs1OUBevPk X-Google-Smtp-Source: ABdhPJzcZTbQ1Oy3tQ3gFxSCJf3+SQLANXJ4xpBT1sdUk08dMyKduiPDL8QbtxfJsMs80UeqyJZwcukRQ+r1mgO51Zs= 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_Kleine-K=C3=B6nig?= " , Dave Martin , Nicolas Pitre , linux-kernel@vger.kernel.org, llvm@lists.linux.dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210929_120820_611303_D1A01CD5 X-CRM114-Status: GOOD ( 12.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Acked-by: Ard Biesheuvel --- 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