Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp567059rwr; Thu, 20 Apr 2023 03:31:04 -0700 (PDT) X-Google-Smtp-Source: AKy350YR/nHvEkens/ae8OExZ53bI64KhNu7zI5pCk3l26nMd7a3fWqiTjy/v9kYBIMZvYxN/t8c X-Received: by 2002:a17:902:d490:b0:1a9:1b4:9fe5 with SMTP id c16-20020a170902d49000b001a901b49fe5mr1237536plg.5.1681986664477; Thu, 20 Apr 2023 03:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681986664; cv=none; d=google.com; s=arc-20160816; b=v3mhiaNNAsfAEYrJBHjYwEt0Q2Nd40Jj/5Jxb36kvEWCCMlKWtSnwRStLn/L4YdY9R nFE1Xer78hV2CqJ+iR4MnS9KpJG1FeBV1TWtpHSN/KAuUR+gP3PJ84jk2IY4JFvN5SPR /7+S5rSUyZkdsMBhOrWXQiguhHN8NS7B5+AQA3TyZSrCiQdL1pMMwGKImf5OtNja17is gAbvaCd/QKlo9R1VLMyGRLsESq63rdH69QZjntEuy22lVdBbTse7YxpLxWdToUsglKGD X7PWu3WkkxG1l6gc4l+Z1swVztkGVgRzScn0Du/VlJ8bvhUsncT3UF9ysvkqmqR42aAe jLTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=DdoUEAUpt4OIvZHDymR6cihsaUWwAC34MfdZkq6QOv4=; b=H6kt/Ae0cd5/98eI/sMK/1JeYWFsqwAQaFH6jlgSqnyxclGuDIWkWxtmvx9jCw8Jut ENnMqCbuXpiq0XnLp36g+sVy7t5mPn9kEwUpKQg0Knyzztzw8ZvCRlgXLRw3Awvd1pVN XkE1IPWyREHR1jOfhUaYOxCpo9XdqXrMn0SKv89AbVMHuxCcmGoeGPmYQmQbfn1m7Ice IorK5vezYKjy91ZEjpUVfFgQkKvPCNm1zJ6afVhiopCnwVLLDZjcq9m4xdAATlgF/rvY wTDG93YdCtFYGJti35ZLNwqyKZJKut30r9bEO1gTV+ncey1eDe4igZXq2HZk8v7spdgL DAXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y15-20020a17090322cf00b001a52db202c7si1586090plg.382.2023.04.20.03.30.47; Thu, 20 Apr 2023 03:31:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234590AbjDTKW4 (ORCPT + 99 others); Thu, 20 Apr 2023 06:22:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234587AbjDTKWY (ORCPT ); Thu, 20 Apr 2023 06:22:24 -0400 Received: from 167-179-156-38.a7b39c.syd.nbn.aussiebb.net (167-179-156-38.a7b39c.syd.nbn.aussiebb.net [167.179.156.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25F6D55A7 for ; Thu, 20 Apr 2023 03:22:01 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1ppRQJ-000YdC-0j; Thu, 20 Apr 2023 18:21:57 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Thu, 20 Apr 2023 18:21:56 +0800 Date: Thu, 20 Apr 2023 18:21:56 +0800 From: Herbert Xu To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, Eric Biggers , Kees Cook Subject: Re: [PATCH v2 00/13] crypto: x86 - avoid absolute references Message-ID: References: <20230412110035.361447-1-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230412110035.361447-1-ardb@kernel.org> X-Spam-Status: No, score=2.7 required=5.0 tests=BAYES_00,HELO_DYNAMIC_IPADDR2, RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS,TVD_RCVD_IP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Apr 12, 2023 at 01:00:22PM +0200, Ard Biesheuvel wrote: > This is preparatory work for allowing the x86 kernel to be built as a > PIE executable, which relies mostly on RIP-relative symbol references > from code, as these don't need to be updated when a binary is loaded at > an address different from its link time address. > > Most changes are quite straight-forward, i.e., just adding a (%rip) > suffix is enough in many cases. However, some are slightly trickier, and > need some minor reshuffling of the asm code to get rid of the absolute > references in the code. > > Tested with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y on a x86 CPU that > implements AVX, AVX2 and AVX512. > > Changes since v1: > - add missing tags from Thomas Garnier > - simplify AES-NI GCM tail handling and drop an entire permute vector > table (patch #2) > - add a couple of patches to switch to local labels, which removes ~1000 > useless code symbols (e.g., _loop0, _loop1, _done etc etc) from > kallsyms > > Cc: Herbert Xu > Cc: Eric Biggers > Cc: Kees Cook > > Ard Biesheuvel (13): > crypto: x86/aegis128 - Use RIP-relative addressing > crypto: x86/aesni - Use RIP-relative addressing > crypto: x86/aria - Use RIP-relative addressing > crypto: x86/camellia - Use RIP-relative addressing > crypto: x86/cast5 - Use RIP-relative addressing > crypto: x86/cast6 - Use RIP-relative addressing > crypto: x86/crc32c - Use RIP-relative addressing > crypto: x86/des3 - Use RIP-relative addressing > crypto: x86/ghash - Use RIP-relative addressing > crypto: x86/sha256 - Use RIP-relative addressing > crypto: x86/aesni - Use local .L symbols for code > crypto: x86/crc32 - Use local .L symbols for code > crypto: x86/sha - Use local .L symbols for code > > arch/x86/crypto/aegis128-aesni-asm.S | 6 +- > arch/x86/crypto/aesni-intel_asm.S | 198 +++++++-------- > arch/x86/crypto/aesni-intel_avx-x86_64.S | 254 +++++++++----------- > arch/x86/crypto/aria-aesni-avx-asm_64.S | 28 +-- > arch/x86/crypto/aria-aesni-avx2-asm_64.S | 28 +-- > arch/x86/crypto/aria-gfni-avx512-asm_64.S | 24 +- > arch/x86/crypto/camellia-aesni-avx-asm_64.S | 30 +-- > arch/x86/crypto/camellia-aesni-avx2-asm_64.S | 30 +-- > arch/x86/crypto/camellia-x86_64-asm_64.S | 6 +- > arch/x86/crypto/cast5-avx-x86_64-asm_64.S | 38 +-- > arch/x86/crypto/cast6-avx-x86_64-asm_64.S | 32 +-- > arch/x86/crypto/crc32-pclmul_asm.S | 16 +- > arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 70 +++--- > arch/x86/crypto/des3_ede-asm_64.S | 96 +++++--- > arch/x86/crypto/ghash-clmulni-intel_asm.S | 4 +- > arch/x86/crypto/sha1_avx2_x86_64_asm.S | 25 +- > arch/x86/crypto/sha256-avx-asm.S | 16 +- > arch/x86/crypto/sha256-avx2-asm.S | 54 +++-- > arch/x86/crypto/sha256-ssse3-asm.S | 16 +- > arch/x86/crypto/sha512-avx-asm.S | 8 +- > arch/x86/crypto/sha512-avx2-asm.S | 16 +- > arch/x86/crypto/sha512-ssse3-asm.S | 8 +- > 22 files changed, 509 insertions(+), 494 deletions(-) > > -- > 2.39.2 All applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt