Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3150784ybt; Mon, 22 Jun 2020 16:40:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwMmCFcCsV/ZPhUJIeYErHzt51xaZ6F9H+GEkaWxfydcbbvo2V+7BdXLok6YWDUISsWZy0 X-Received: by 2002:a17:907:7283:: with SMTP id dt3mr18386934ejc.195.1592869208998; Mon, 22 Jun 2020 16:40:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592869208; cv=none; d=google.com; s=arc-20160816; b=BcWHZS4HnAsF444JRVexa9mhRSHW3kzhs796OqFBaUf4ZLoO7vNmXh8LXsE+y5VWj9 FRm8mF8LjvYtPYSq5gEwvK1O0oe+B5kWYY8Qkd/C8w+9NtbchaTZxOKwQIySQ/EMXxXS 6I2wuMlwAhiK1CDO9JzvTtVW7tJU0BVK1qcS0ohvoyC9oXJ44yDNF7QmPT+oWKAAGNQg 2fxpZy8wv+mAi7VpuQwySqAsdo3CyIK1dH/tnofPjPZVXIRJvaKGqOBITQ+PQgwUCb6y BgWy8PjPcbOuc+Bk/3IAikHB9TfhsrZDxGY5h0llhan4gZj3itM7ZDhyMsJyC5x7K/YW 7gbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=gQRngbxyDaJsXc3eQ4RGxEukqq41ioPgAa6TX8jqgRA=; b=D8x0BHtA4/b10oLKI0h7/cHnjU1hMCzcNTbf67ulDhXp9rM/DyIUlIpc8naSzreuWJ sV+yaZqf5tVrljqeuzjbdRP6FeZfuNpXZYkwNJX0dKfBKVRpB1yM/7WtQ6Jz20WYP5Rk 9+XxgS3W0JYvInpDwWtNEeQzHIYwDw7Xey7GV5v6SAW6Q4rtP9nN4Sz2FPraY8d3D4UE ClnMQaYHeAG9VM7n04+5E8SQUgQEgXlBGYpHxlpmGVK3kbL/ykBvQySoos0S6L0GCaE4 r1CFwDg/o4zZDwDGadTr+p56aef91roJAZS0iceBGSg2T8LMqPtBvgUSfhvZ8ZZ16RGs /fxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=AxpsZkf4; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si10587501edt.578.2020.06.22.16.39.33; Mon, 22 Jun 2020 16:40:08 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=AxpsZkf4; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728636AbgFVX2o (ORCPT + 99 others); Mon, 22 Jun 2020 19:28:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728580AbgFVX2o (ORCPT ); Mon, 22 Jun 2020 19:28:44 -0400 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2746BC061573; Mon, 22 Jun 2020 16:28:44 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id l6so17661813ilo.2; Mon, 22 Jun 2020 16:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gQRngbxyDaJsXc3eQ4RGxEukqq41ioPgAa6TX8jqgRA=; b=AxpsZkf41+RaD8t28rKrQKnH/b6eOIOKffLCW38yHSZfQWCnA0KL8WPiS7HqlCRw5S NMdHnlTnZy4sEpkx/DNdsEkoFkbPpS2rE5wqLZsM89SCQIlCgyJR1kNgeRz2qB/tfN8p iA9S0dGEAABSPWSMhkkqUdO7rUqZxbcb1kIR8mxj+lvAbXYpMLS9WDzoH710YsMHgOLA 43SA+ZKxLSFqKzcSz6ZYtguNVcZnP9fLe3fsIFpbju+3hg8s01/6f9j4MgnJmW0FoqcN n/lHAsiOy+9DFD72ehHEcP0+l5r4mp7Eq8Dyf0fVriG3U53Fa3Yhhuc9IhPYWfrGj+6K UZEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gQRngbxyDaJsXc3eQ4RGxEukqq41ioPgAa6TX8jqgRA=; b=f/9u7Dabo5Lm3ZQeNShFkAZFTR0yt9wFEkxX+LFx9l7mFHnHFod/0Q5DsFv4A9XC0y EDqd40Km32jtq7UuaEBZyqtuFdaB9eszFsxgrk3IeerDWFGPsFwcLsdN3NltPs75QFMe 4Vni5DgEKz3U3Ln66CYehKazqJcBokpb6v/6GLHPjJ8Rq8s5vpLWpInKWNPIntFbPWD6 QJbawbgzCHHl5iq92eQaqybXLHd29AqyXkaIg8RRab9odnl/3a/kkQ6ygdI6WNugLJZv eJ3yPLqAhIZlyZqZaFz+CNZzLV5Oo9cmCCvGukhGO+SxUA70gqYzb7dA1xPnQgnpBC9k gY6Q== X-Gm-Message-State: AOAM531qUKye9ypnH8BTJ+SjsX0Leek+oxpJMDLmgdR83i4gfC8QUdkN oazYfhlyUlqs6dPARuq1nuQ= X-Received: by 2002:a92:d3cd:: with SMTP id c13mr20378677ilh.101.1592868523498; Mon, 22 Jun 2020 16:28:43 -0700 (PDT) Received: from jiancai.svl.corp.google.com ([2620:15c:2ce:0:b7ed:16a3:9dc0:21bb]) by smtp.googlemail.com with ESMTPSA id s17sm6800602ioj.10.2020.06.22.16.28.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 16:28:43 -0700 (PDT) From: Jian Cai Cc: caij2003@gmail.com, jiancai@google.com, ndesaulniers@google.com, manojgupta@google.com, sedat.dilek@gmail.com, maskray@google.com, Herbert Xu , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH] crypto, x86: aesni: add compatibility with IAS Date: Mon, 22 Jun 2020 16:24:33 -0700 Message-Id: <20200622232434.162730-1-caij2003@gmail.com> X-Mailer: git-send-email 2.27.0.111.gc72c7da667-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Clang's integrated assembler complains "invalid reassignment of non-absolute variable 'var_ddq_add'" while assembling arch/x86/crypto/aes_ctrby8_avx-x86_64.S. It was because var_ddq_add was reassigned with non-absolute values several times, which IAS did not support. We can avoid the reassignment by replacing the uses of var_ddq_add with its definitions accordingly to have compatilibility with IAS. Link: https://github.com/ClangBuiltLinux/linux/issues/1008 Reported-by: Sedat Dilek Reported-by: Fangrui Song Tested-by: Sedat Dilek # build+boot Linux v5.7.5; clang v11.0.0-git Signed-off-by: Jian Cai --- arch/x86/crypto/aes_ctrby8_avx-x86_64.S | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/arch/x86/crypto/aes_ctrby8_avx-x86_64.S b/arch/x86/crypto/aes_ctrby8_avx-x86_64.S index ec437db1fa54..494a3bda8487 100644 --- a/arch/x86/crypto/aes_ctrby8_avx-x86_64.S +++ b/arch/x86/crypto/aes_ctrby8_avx-x86_64.S @@ -127,10 +127,6 @@ ddq_add_8: /* generate a unique variable for ddq_add_x */ -.macro setddq n - var_ddq_add = ddq_add_\n -.endm - /* generate a unique variable for xmm register */ .macro setxdata n var_xdata = %xmm\n @@ -140,9 +136,7 @@ ddq_add_8: .macro club name, id .altmacro - .if \name == DDQ_DATA - setddq %\id - .elseif \name == XDATA + .if \name == XDATA setxdata %\id .endif .noaltmacro @@ -165,9 +159,8 @@ ddq_add_8: .set i, 1 .rept (by - 1) - club DDQ_DATA, i club XDATA, i - vpaddq var_ddq_add(%rip), xcounter, var_xdata + vpaddq (ddq_add_1 + 16 * (i - 1))(%rip), xcounter, var_xdata vptest ddq_low_msk(%rip), var_xdata jnz 1f vpaddq ddq_high_add_1(%rip), var_xdata, var_xdata @@ -180,8 +173,7 @@ ddq_add_8: vmovdqa 1*16(p_keys), xkeyA vpxor xkey0, xdata0, xdata0 - club DDQ_DATA, by - vpaddq var_ddq_add(%rip), xcounter, xcounter + vpaddq (ddq_add_1 + 16 * (by - 1))(%rip), xcounter, xcounter vptest ddq_low_msk(%rip), xcounter jnz 1f vpaddq ddq_high_add_1(%rip), xcounter, xcounter -- 2.27.0.111.gc72c7da667-goog