Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp99626pxb; Fri, 15 Oct 2021 01:18:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZS+wrU7mGHJwfbmTy72omxPcWsNAtwHc3fKOwPNcEiUVWmYq2WWoXG68R1aQKJ4xaYKl0 X-Received: by 2002:aa7:811a:0:b0:44c:b9ef:f618 with SMTP id b26-20020aa7811a000000b0044cb9eff618mr10345580pfi.9.1634285923873; Fri, 15 Oct 2021 01:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634285923; cv=none; d=google.com; s=arc-20160816; b=gwjGRh+2cg+0sRqIiCc1UvwinMp7wXZ7oWd4UmCu9L5Zuin1UWKKHRIhIK9bnEx6Ks TVNC+LBrLPgE5Ge3NLGZbLWWhKOy2Z8UTM0atz5mY0evk7dHEscKuF2maoFoA9tZmWhg sGF9XZUwfr29nqR+ZazLtPmzIwPtKHiExYZxNdjRYQENH6Z5joGqmh4vG9A0Zi/1RWzZ pWymEIJdr9M87Jh2kgKLfS1oD7laj4hyz0EMBbMTuIjYIui0eZI8V6YpCfQt/PsdCSLa WeoM5nrRzTovihYc4ESg7dnJwHaAumUF/emEi0/rCUXcd+3y99Hg/n91xvJjpnpNntrS d2Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=g8SZxZTWwMNu5KQexCOeNPqufzf3P39V2cS5fKNw3Yk=; b=CsM3EzELeGT03whhBZSbFx/N43L2SGsp1ZLXZqtF9vaQn6rEzV2qa1bv8mIYulKigy W2+ZVlpLcPQb6M8UYlvim201KsEnJatFJgcXeP5ktljOrur16Ss1AbIU4zInC0FboAu3 5Ro1jlLOKR+hp7OwdGSrZBHoxrZXeTIZUea+MumpznThwrHOJFcRuGAAR94W21BM22mW 177tgOhaXO+7kM9yGbrpCm6U10StahPDxQ2ieWReTM+lKFVwaxgHIX/jP6M3lU4RM0+2 NovxTdG7Ivdc+7+BiMw0rY7DPf7zgiNkab4wOhFIoOx5niGZco7T883HO6O9KluV+NJd Jwgg== 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 qe3si538926pjb.13.2021.10.15.01.18.13; Fri, 15 Oct 2021 01:18:43 -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 S234130AbhJODtn (ORCPT + 99 others); Thu, 14 Oct 2021 23:49:43 -0400 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:41164 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229907AbhJODtn (ORCPT ); Thu, 14 Oct 2021 23:49:43 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0Us1MPhB_1634269654; Received: from localhost(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0Us1MPhB_1634269654) by smtp.aliyun-inc.com(127.0.0.1); Fri, 15 Oct 2021 11:47:35 +0800 From: Tianjia Zhang To: Herbert Xu , "David S. Miller" , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Nathan Chancellor , Nick Desaulniers , Abaci Robot , Heyuan Shi , x86@kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tianjia Zhang Subject: [PATCH] crypto: x86/sm4 - Fix invalid section entry size Date: Fri, 15 Oct 2021 11:47:33 +0800 Message-Id: <20211015034733.51205-1-tianjia.zhang@linux.alibaba.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This fixes the following warning: vmlinux.o: warning: objtool: elf_update: invalid section entry size The size of the rodata section is 164 bytes, directly using the entry_size of 164 bytes will cause errors in some versions of the gcc compiler, while using 16 bytes directly will cause errors in the clang compiler. This patch correct it by filling the size of rodata to a 16-byte boundary. Fixes: a7ee22ee1445 ("crypto: x86/sm4 - add AES-NI/AVX/x86_64 implementation") Fixes: 5b2efa2bb865 ("crypto: x86/sm4 - add AES-NI/AVX2/x86_64 implementation") Reported-by: Peter Zijlstra Reported-by: Abaci Robot Signed-off-by: Tianjia Zhang Tested-by: Heyuan Shi --- arch/x86/crypto/sm4-aesni-avx-asm_64.S | 6 +++++- arch/x86/crypto/sm4-aesni-avx2-asm_64.S | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/x86/crypto/sm4-aesni-avx-asm_64.S b/arch/x86/crypto/sm4-aesni-avx-asm_64.S index 18d2f5199194..1cc72b4804fa 100644 --- a/arch/x86/crypto/sm4-aesni-avx-asm_64.S +++ b/arch/x86/crypto/sm4-aesni-avx-asm_64.S @@ -78,7 +78,7 @@ vpxor tmp0, x, x; -.section .rodata.cst164, "aM", @progbits, 164 +.section .rodata.cst16, "aM", @progbits, 16 .align 16 /* @@ -133,6 +133,10 @@ .L0f0f0f0f: .long 0x0f0f0f0f +/* 12 bytes, only for padding */ +.Lpadding_deadbeef: + .long 0xdeadbeef, 0xdeadbeef, 0xdeadbeef + .text .align 16 diff --git a/arch/x86/crypto/sm4-aesni-avx2-asm_64.S b/arch/x86/crypto/sm4-aesni-avx2-asm_64.S index d2ffd7f76ee2..9c5d3f3ad45a 100644 --- a/arch/x86/crypto/sm4-aesni-avx2-asm_64.S +++ b/arch/x86/crypto/sm4-aesni-avx2-asm_64.S @@ -93,7 +93,7 @@ vpxor tmp0, x, x; -.section .rodata.cst164, "aM", @progbits, 164 +.section .rodata.cst16, "aM", @progbits, 16 .align 16 /* @@ -148,6 +148,10 @@ .L0f0f0f0f: .long 0x0f0f0f0f +/* 12 bytes, only for padding */ +.Lpadding_deadbeef: + .long 0xdeadbeef, 0xdeadbeef, 0xdeadbeef + .text .align 16 -- 2.24.3 (Apple Git-128)