Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp773766rwl; Wed, 12 Apr 2023 04:04:29 -0700 (PDT) X-Google-Smtp-Source: AKy350bmndZMjp9p3RrA97wKGjVvP9AxWaRo2Qsm+UvaPAcHC1ESDmQ3TvhTKSuqQ+hJ2vdYv8I5 X-Received: by 2002:a05:6a21:7896:b0:d9:ec4b:82c6 with SMTP id bf22-20020a056a21789600b000d9ec4b82c6mr2643521pzc.0.1681297469620; Wed, 12 Apr 2023 04:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681297469; cv=none; d=google.com; s=arc-20160816; b=PluVaGSU3ZsllsCGpjLWazBn7CoOFiYEdBTgRVgkWEv8IH2sQXU9zaovfrlfPTFrtx xjJLklCa6/Hv3fdY6knfFeQjmY7Sav+7mXu+OueG7bb9g21lZMw108hVXDOBlSQkNVzh bGB93Xdzj3TbKWsez60acoZW9MZm00s7Jciz7PCihNM+o9t5OsfgiODsxufFXBjl0wpy 3mpRxqt8I/J6fg1LiD3L6l1Yx9IymrBzCjutaumknFUADmj9heX7JzTKf7SugwUL0HVj +XiSJo84jy5pntGKj7/aoSTVdt3OBh1hAEB8iwnAs1g2XMlHsTrmqQrkYYB6kQ0Jm6Dw sT1A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=X1KmSKUQBgRaUR+jcCwZXl4hovN4mgILR3KC3np2r5I=; b=dzwzUd9R7S2lzapbJhsqg5FldvpUUiFLCo18W2xunb0T399hVYScexP0TsFu5FttVC AFaVbWbzOcGmNBcjcBD5BmSinJBBrqylhw8qRqu3iI/R2uBFDkcyiFr/c3tpsXV4RLlY 5jN1nudbX9SaP8yKY2utZ/2ApA9v34tiHTqKtM+J6+lkLURwz+BwSpW7XmQnMzZynv+l flE/YCblAZmDcsd/UWHx31BDaaRJOfD3lEEbcRUJs0fdzfmv0nQZGL+eC03beULvvREP lI9qjo87bQpUP08TY3cGOQSrioNeoOpI6A74B7i96/IN0Qh8sk0UNcojPflagPQk9HRA a+yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VhYbnuBD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020aa79e49000000b006396e2eb0d5si6411612pfq.244.2023.04.12.04.04.12; Wed, 12 Apr 2023 04:04:29 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VhYbnuBD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbjDLLBQ (ORCPT + 99 others); Wed, 12 Apr 2023 07:01:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbjDLLBN (ORCPT ); Wed, 12 Apr 2023 07:01:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 527616A69 for ; Wed, 12 Apr 2023 04:01:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D60F4632EB for ; Wed, 12 Apr 2023 11:01:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A791C4339C; Wed, 12 Apr 2023 11:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681297261; bh=WCIInqLVBgl0lnWstcFe7pmbtXMzjb9G1XFch4e7MRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VhYbnuBDrtISvotGsBEsnNMlt9hFKI5WTIhPulC6Wxf5gtgguZFWz2mFFwvz6Jwdn iNF5Ym/AwObwcTz8WJ4FmjOb93W3su0a0I21I23pHldTMfs4bUP/ev5Ga6s56DgoO7 F0AjuE0EGzyb0F5f7kCHhl774Wa7C28MJfgSsVWaKmfNqff9148rWDIapI/PsvjiBv M+Inzgyx1Iu2MIUWlxpArBgv2XeA8kMhpF4A4gFHMR8qGRv2npwSP/B3bPMojrvgwD 8avxUiQcWb5V5Zy/QGrFxxRPrdJHUAaNIgkUmnu+128YBlQiJJqetzh63G8hGGF0KO +m1UWIHW2c9fA== From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: Ard Biesheuvel , Herbert Xu , Eric Biggers , Kees Cook Subject: [PATCH v2 09/13] crypto: x86/ghash - Use RIP-relative addressing Date: Wed, 12 Apr 2023 13:00:31 +0200 Message-Id: <20230412110035.361447-10-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230412110035.361447-1-ardb@kernel.org> References: <20230412110035.361447-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1040; i=ardb@kernel.org; h=from:subject; bh=WCIInqLVBgl0lnWstcFe7pmbtXMzjb9G1XFch4e7MRM=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIcWs3/fU+S1pkq3l/RKTdpk9/yW8W0Mtb7FhfLjLxfeeT 759jivuKGVhEONgkBVTZBGY/ffdztMTpWqdZ8nCzGFlAhnCwMUpABO5fZ3hv/uzJbWSJS/a47OC Dnjd+Cl0+Mjh4qi2BQZftK8cLT39robhf+K3cy8/RmoJXeX7zrB3+ovsZ3Y6Oz6xZ8f9+Hq7Kz8 /kxcA X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 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 Prefer RIP-relative addressing where possible, which removes the need for boot time relocation fixups. Signed-off-by: Ard Biesheuvel --- arch/x86/crypto/ghash-clmulni-intel_asm.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/crypto/ghash-clmulni-intel_asm.S b/arch/x86/crypto/ghash-clmulni-intel_asm.S index 257ed9446f3ee1a9..99cb983ded9e369f 100644 --- a/arch/x86/crypto/ghash-clmulni-intel_asm.S +++ b/arch/x86/crypto/ghash-clmulni-intel_asm.S @@ -93,7 +93,7 @@ SYM_FUNC_START(clmul_ghash_mul) FRAME_BEGIN movups (%rdi), DATA movups (%rsi), SHASH - movaps .Lbswap_mask, BSWAP + movaps .Lbswap_mask(%rip), BSWAP pshufb BSWAP, DATA call __clmul_gf128mul_ble pshufb BSWAP, DATA @@ -110,7 +110,7 @@ SYM_FUNC_START(clmul_ghash_update) FRAME_BEGIN cmp $16, %rdx jb .Lupdate_just_ret # check length - movaps .Lbswap_mask, BSWAP + movaps .Lbswap_mask(%rip), BSWAP movups (%rdi), DATA movups (%rcx), SHASH pshufb BSWAP, DATA -- 2.39.2