Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp160604pxb; Wed, 25 Aug 2021 23:26:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBq6tjLU/OkeCIEjSPemDZ5pODxXYBcDZQY/9t2ggnRRJq3brci+DViYRz3/a07DUftquI X-Received: by 2002:a02:2348:: with SMTP id u69mr2095100jau.141.1629959195369; Wed, 25 Aug 2021 23:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629959195; cv=none; d=google.com; s=arc-20160816; b=X+yJd/2irEjPkPqjJ0RGT/1A/HnRtjV92yy2EFhrBKXp49nPf+G1bpA2djSF/M3ylm /KnG9cSEuwv8n1I5QlpFr9+HkvF4l63RtfJ3dlQM+Fp1lmaVi735mLE7StDlX0zY0oT3 XjUD0iktLlOKlm27d6IVy0T0nXZevjg+uNyonY7otS+Yu3vSEqVN0aEWaEc6ip6L9g9j fA0OuIRi+haGvromGulx+w7gSzZsk/e4kGml7YkttRDT10F+lwjfYRRYqFImbxf0haYM jYxI+Rx57P5Vu3tRdkT806VGRlgO4SVyiqbY3Da10OPiqJsVV1ZGJoRDHnpxvs3xKj8b WAGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=9LoIH4Xs34wQoBH+BhCs0S9HVeOjOzlKyNM/vMObKOc=; b=yCYBTNgtpEUk3BppIU8X+e2vXzRUNL5skhpbXW6ayO4/e7b7CE1KV3TjDZU+oJ81oz UBgfSUY51SNvVGTRGFb/ACkSTd9+zZ9b4a0mP3T6v2jRBpyMbS8N9TcatnXx0aKpy4ze 9TJyMhGNEsoHBbtNqJ/o0Z37iU7NMm1yWDo/wOX76AK/DwFOn+akdI+KQ5q80EwKEMo+ v0gyhyMfuLOen+4iEHQ0cdAgoIxaShifkkgX+VHBqL8DbLxfjCI6EWNkK/9KzsG/+U4q 6+sIMIBH02Gr/5aHGHlNLw6RXxwM5X+KjzWhV/S1jA6Hr5gB15VVM4I5po2KeoY5KtKw hQXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si2050781jak.6.2021.08.25.23.25.51; Wed, 25 Aug 2021 23:26:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238990AbhHZG0f (ORCPT + 99 others); Thu, 26 Aug 2021 02:26:35 -0400 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:19295 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238082AbhHZG0f (ORCPT ); Thu, 26 Aug 2021 02:26:35 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0Um2LScI_1629959145; Received: from B-455UMD6M-2027.local(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0Um2LScI_1629959145) by smtp.aliyun-inc.com(127.0.0.1); Thu, 26 Aug 2021 14:25:46 +0800 Subject: Re: [PATCH] crypto: sm4 - Do not change section of ck and sbox To: Nathan Chancellor , Herbert Xu Cc: "David S. Miller" , Nick Desaulniers , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, llvm@lists.linux.dev References: <20210825203859.416449-1-nathan@kernel.org> From: Tianjia Zhang Message-ID: Date: Thu, 26 Aug 2021 14:25:45 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210825203859.416449-1-nathan@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Nathan, Thanks for pointing it out. On 8/26/21 4:38 AM, Nathan Chancellor wrote: > When building with clang and GNU as, there is a warning about ignored > changed section attributes: > > /tmp/sm4-c916c8.s: Assembler messages: > /tmp/sm4-c916c8.s:677: Warning: ignoring changed section attributes for > .data..cacheline_aligned > > "static const" places the data in .rodata but __cacheline_aligned has > the section attribute to place it in .data..cacheline_aligned, in > addition to the aligned attribute. > > To keep the alignment but avoid attempting to change sections, use the > ____cacheline_aligned attribute, which is just the aligned attribute. > > Fixes: 2b31277af577 ("crypto: sm4 - create SM4 library based on sm4 generic code") > Link: https://github.com/ClangBuiltLinux/linux/issues/1441 > Signed-off-by: Nathan Chancellor Reviewed-by: Tianjia Zhang Best regards, Tianjia > --- > lib/crypto/sm4.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/crypto/sm4.c b/lib/crypto/sm4.c > index 633b59fed9db..284e62576d0c 100644 > --- a/lib/crypto/sm4.c > +++ b/lib/crypto/sm4.c > @@ -15,7 +15,7 @@ static const u32 fk[4] = { > 0xa3b1bac6, 0x56aa3350, 0x677d9197, 0xb27022dc > }; > > -static const u32 __cacheline_aligned ck[32] = { > +static const u32 ____cacheline_aligned ck[32] = { > 0x00070e15, 0x1c232a31, 0x383f464d, 0x545b6269, > 0x70777e85, 0x8c939aa1, 0xa8afb6bd, 0xc4cbd2d9, > 0xe0e7eef5, 0xfc030a11, 0x181f262d, 0x343b4249, > @@ -26,7 +26,7 @@ static const u32 __cacheline_aligned ck[32] = { > 0x10171e25, 0x2c333a41, 0x484f565d, 0x646b7279 > }; > > -static const u8 __cacheline_aligned sbox[256] = { > +static const u8 ____cacheline_aligned sbox[256] = { > 0xd6, 0x90, 0xe9, 0xfe, 0xcc, 0xe1, 0x3d, 0xb7, > 0x16, 0xb6, 0x14, 0xc2, 0x28, 0xfb, 0x2c, 0x05, > 0x2b, 0x67, 0x9a, 0x76, 0x2a, 0xbe, 0x04, 0xc3, > > base-commit: abfc7fad63940b8dfdfd25da6f0fa813d9561645 >