From patchwork Wed Sep 29 19:20:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12526505 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 D8F4FC433EF for ; Wed, 29 Sep 2021 19:22:28 +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 9105B6140F for ; Wed, 29 Sep 2021 19:22:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9105B6140F 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:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=DaTyun0DRbt+lnl+XAbS/kNXDbC7jEtvicn1krdFnV8=; b=Q1C/UALogedOBAtW/x5+avmmFj upaJP027Q/GZplBzYMDBs08y3t50o4DuyBm65ZqgQzPN04VEWG8iviED1027abL7lULD1oM6etrzX oassna24+NQDnu8jb47zXCYgWwKy3HfcuIkQVPW2msxkpqoURzWuiYkzsC/OG/PMIrweGguEADA0p F7ldw5l2Jl5BDpJgL5dxqFouRbQV4pjdmuCP5Cu8LKYKMgfAZxPRz4kocKpYHPDDP0znVj6xS90iT kzuwZ4XYBYmdxntNwjEBqxXDVC0dY2+BnzCVvj5tw+Mu2Uck8yU/tAuwYndEJhJBK0pVfrHtuIM4l X0+CbpAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVf86-00CAmM-Tt; Wed, 29 Sep 2021 19:20:35 +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 1mVf83-00CAlp-LW for linux-arm-kernel@lists.infradead.org; Wed, 29 Sep 2021 19:20:33 +0000 Received: by mail-yb1-xb49.google.com with SMTP id q17-20020a25b591000000b005a07d27bbdaso4856102ybj.3 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=DTKKuW2jTcJW5NzQcV0H0W2g/vRWbPMV7DOkLnJU5Pd4v9uhixSComctAMcqN3rF0z F2F+eTH4aEhXMY+BCV5NY6cEhoZtzUNw8+gc2NHEio6aYJmLgi8bXzLXnhFEZoZ0UbQB IwDxdqgwQDHdalO53M/HK46xUnz0GlsSu1kyrlb57Fv5T5geoeqOQy+hu+NuN/DtRIX+ Zj8/HaWtq942X8DXQzfVtMnA/0R/6brd4DT/RI+wFDnIlUVf9fqkSMstGUevWYUyvXSD HK4dbzMcMWWH3qFQGGI3nthFHmJoiS+cnAaj2ii86+jqdzj2aiQcqCpWdBPCd5pQCSRN a1Jg== X-Gm-Message-State: AOAM531cxuak1B2LqujqNUe3z7l3NMkang1bPyaGmS13FUc98dmt2l/d asxAQpZx/yy2wh7gTFW96eVTfKIlX8zm5GwJVC1O/b7F7VITtUM7YhrQhySHqO7VEhI8qq/S8s5 XEr4fjluyFD5QLAaDk0TxFjFjeFp+uiz3IxR+uuau2ks2lNZFc86IAtExBWhnqCShepnzVuKQ0E Osh42+Rz747iHjK+mse1hv X-Google-Smtp-Source: ABdhPJwCgxungjpkRehOgF/M2ddpxBC327A5mIHGC9y7oK8GZI1Rw+c/3t7/cNjQIvN8YqA80g8deU0ImyL5J5rvrUU= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210929_122031_732323_CCEFA31A X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. 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 Acked-by: Ard Biesheuvel Signed-off-by: Nick Desaulniers Tested-by: Nathan Chancellor --- 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(+) base-commit: 02d5e016800d082058b3d3b7c3ede136cdc6ddcb prerequisite-patch-id: 3edbe4a8485c7a75a61dbbe299e8ce1985d87ee0 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