Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1000871pxb; Wed, 29 Sep 2021 14:34:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzljDQ76MuR/YODTUra4BfIKrmjKWWnKIAl++l2/qWQEma/fSUMCYmDDURC10j9GDMVDmnC X-Received: by 2002:a17:907:3f9a:: with SMTP id hr26mr2437209ejc.438.1632951287440; Wed, 29 Sep 2021 14:34:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632951287; cv=none; d=google.com; s=arc-20160816; b=i3DV25mcJfA/+1TdE6LkNF70CyD4AYeAmWq7yd+oskYTxn9ltcbgyEGi/MLd8NsvVN U0HSy301yQ/sUzAMOxAMCLe0PebspVuiUA4ImBsqR/kvvi0gIKZAKLIt/axHI6q4gdGs +/LSKDqq+3Prr923dGkEhi/Jz1zCd7Nu+h0nYT32u1k3UZpZ7yN16MEOZlSBe2KWxkHU mVFJlCzXwnVrrEeUv5SIZ8ZzHcZZWUjuvXOmi6np5Kg4JDRO4e/2I4H9oX3lJT5jcf0S msirsVxOLOFUFuP/xOh7JNbMqCIMrQI4Ue+BB7FDLxZW4u9Z0Kl+w89mtouVMhV7zTNO DSMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rA6N+zTTn4iQGEVjOjhm5UE8p1Mbp8K2faUuk1xXIMM=; b=pkXLFHrpZtIIPeRdKXPptH/Xz6IS0uudbJghKKfGDOpeFIm/E+HGIvtofP/s7QSPEN fbdS424h4v2WZtN94wSvj/V9j3g2sceurj/2L28Eo5UTqn7ksTXjBBME2DiOgO3SRSf3 VdcnbppcOZ3u8ZUIApfM7zhR1k2gUwd62Pv6Xjo3zA+7bjTHIYfmnOL6qMVcWNqgz+sp STDKGQA/1fmLRWd0W9zR0UIcEqeM30BCpG5isrbtu49w1Dhx5b7T99FN5uKMOIMaOBUR plQ7tV7p6qZGrQj7pQqY17GfylK+eHy2JeHRcatgU/XpmfjtFI6AhTMVDk2xtMzzmcET GIjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="BCt/fH2X"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s3si1141979ejs.386.2021.09.29.14.34.23; Wed, 29 Sep 2021 14:34:47 -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=@kernel.org header.s=k20201202 header.b="BCt/fH2X"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346808AbhI2U70 (ORCPT + 99 others); Wed, 29 Sep 2021 16:59:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:39976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346776AbhI2U7Y (ORCPT ); Wed, 29 Sep 2021 16:59:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0372F61528 for ; Wed, 29 Sep 2021 20:57:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632949063; bh=z4p1G85CcZY4Hw6JjpFyc6yNDWNhKYa5qIXjea56ROk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=BCt/fH2Xsp2dUVpc8yNaIPngq+lpqcBhHpVptGHG75DNkMm2dGvg72CoDfTfqjCfN DEHag33GHtgzBXjgbwPd/d59qoGA3UejbgpUaLUpQeZR5l3TAj7trO0GZ82FdCC+Mb 4Si2a2CsqvayNAd6J0I7LZ8akRfA9B8N31Pu029LMuAkJx3FYuCKDXoogkljLp2ign bMbQsP0SPLvZ5yAN3mCGkJ2aJ1ej2oeKzR4rfHG4PZlYOwF6tIs6Gj1fi3eq+68dCi V0PQld8jjcL90A9d4LpBEOlQZbfRKZhxre5Wj3Pnwi3XrQbp8cb/mB/mdHVDNN8VN3 hMVEPqoDCalig== Received: by mail-oi1-f180.google.com with SMTP id a3so4553487oid.6 for ; Wed, 29 Sep 2021 13:57:42 -0700 (PDT) X-Gm-Message-State: AOAM532uhtVoJ0QKJaiUPrR89X+uOXwdZLUs6XnX0K2rPx1M5e/Xjs7f RRRgZMFiOSBM6yuvpP/8aNBhbv3VQBHYLP9xko4= X-Received: by 2002:aca:32c2:: with SMTP id y185mr9488548oiy.47.1632949062268; Wed, 29 Sep 2021 13:57:42 -0700 (PDT) MIME-Version: 1.0 References: <20210929192026.1604095-1-ndesaulniers@google.com> In-Reply-To: <20210929192026.1604095-1-ndesaulniers@google.com> From: Ard Biesheuvel Date: Wed, 29 Sep 2021 22:57:30 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] ARM: mm: proc-macros: ensure *_tlb_fns are 4B aligned To: Nick Desaulniers Cc: Linux ARM , Fangrui Song , Peter Smith , Nathan Chancellor , Richard Henderson , Russell King , Dave Martin , Nicolas Pitre , Linux Kernel Mailing List , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Sept 2021 at 21:20, Nick Desaulniers wrote: > > QEMU 6.1.0 is more correct about trapping on misaligned accesses. Btw, this is not entirely relevant. QEMU now behaves like every single hardware implementation does, and reports an alignment fault when using a load-multiple instruction on an address that is not 32-bit aligned, as the architecture requires. > 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 >