Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2140028rwl; Sat, 8 Apr 2023 08:29:31 -0700 (PDT) X-Google-Smtp-Source: AKy350ZJSgd1sYT9J7/5MIinAp3OPIlBH6AXm2G4dFQZZCe6rxSUwEkxlfs38YyR1VzwqQrEWN33 X-Received: by 2002:a05:6402:524e:b0:500:3fd0:25a8 with SMTP id t14-20020a056402524e00b005003fd025a8mr2527774edd.0.1680967771235; Sat, 08 Apr 2023 08:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680967771; cv=none; d=google.com; s=arc-20160816; b=qEotjowgtpaZTJ4Z7KhctjCAisHpalvUvDggwv4gMMWwBIxUSWdmUtsBMZ5D7uzYit aZgbYZj6ZiQ7ctEwoNCCGU6qD3+7d+YNJX1xUQyLTimc15GEJUv0/eQsnO6GLGCIZI5u +Y6PuO9NmSnKRD3PFeYycBIGJZhjKs3UXweTpDJ+Tmc72WKkeEv7GDLrzGpDF9jEQTXG OIRACu9fLCCWQ4HV2yIXqRzlY6dQhwBos/qcl3F3Bd16CdCap9iq5EVmnC54eJnbf0lw abGqYwH5Hv6NGpEencOPyJ50GgK+Lv5Dt+MI1H47xtgHQBhngO2AuaK/Uhe4Q+ilp7W1 cBJA== 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=MfBXtfy4ca1juAgEEEUKcuwAHR0eoXpYSK5wGniwMhxei6lvC9fiAhfuarZRic4N5h 3MZQjjUhO2GklBMGRIG+7PGPWXS6VYIHXdYTUuK3lBgbHPBXo6NXfSkkghwPaXitGykJ Awm+fq0Lbd+xWho6/44dOAHPPVeGhDB5NrXmBEYl5kKK8SPvZ4Hapz9ezqxJZE8XTXEI PJ4eidBc27VQ9wWaoVWqHIyhe8JP2aQ5rDUKb/frKiKPMLxotf4EPc7UNqgCl5n1KJm2 oGUQ/1OAZuRRJS0oN5kdkA7wY7kgWulQayGg6DsIg8STu6vKITwu2UWIWd8hKI1dwNx9 IwKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oUkop1AM; 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 p13-20020aa7d30d000000b0050224f8ea35si2556368edq.290.2023.04.08.08.29.07; Sat, 08 Apr 2023 08:29:31 -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=oUkop1AM; 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 S229456AbjDHP14 (ORCPT + 99 others); Sat, 8 Apr 2023 11:27:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229916AbjDHP1y (ORCPT ); Sat, 8 Apr 2023 11:27:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7558610242 for ; Sat, 8 Apr 2023 08:27:53 -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 1597660AB4 for ; Sat, 8 Apr 2023 15:27:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 548A3C433EF; Sat, 8 Apr 2023 15:27:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680967672; bh=WCIInqLVBgl0lnWstcFe7pmbtXMzjb9G1XFch4e7MRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oUkop1AMFtlKcwRSaf0dsTeELozYiEpUwj/mPXmIGAiGkdhWDc3Xiqik9NPS2YhlU KHgHyz9DDU5ggtNyVUD+hCcaAqDrnHd4s/X3F22aNIa4buG8iwTE4uH/mK68X4Dp1z r0AWwccxMuE8WWcLuwA5BMU/cO76jeNBZEr5qj046hw9N3c/nk9vW9XB3yNKaBfHmV 4kVY41L7U7sMJ0mLfHqWy6ws1Dxj6AEus2Da0WLoVVdeRvdK3r4eooh5o8wjazuQPd 3RgqDcDDq3vVepe/aOJwBMK2g/wsGp2m9RMsBRkvGyi+tu8BozA0XMQlRFU+gHEDtY Rkgs+DKASt6CQ== From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: Ard Biesheuvel , Herbert Xu , Eric Biggers , Kees Cook Subject: [PATCH 09/10] crypto: x86/ghash - Use RIP-relative addressing Date: Sat, 8 Apr 2023 17:27:21 +0200 Message-Id: <20230408152722.3975985-10-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230408152722.3975985-1-ardb@kernel.org> References: <20230408152722.3975985-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=owGbwMvMwCFmkMcZplerG8N4Wi2JIcWw/cap81vSJFvL+yUm7TJ7/kt4t4Za3mLD+HCXi+89n 3z7HFfcUcrCIMbBICumyCIw+++7nacnStU6z5KFmcPKBDKEgYtTACayK5Lhv1dj8O9cE7a9046u mGpXZCF1Iywr1Y5Hi382O/eMgLCZvxj++y0RXLFZ6ejOA5Vcb5Q/XGfxdjf9YaiqH20spfSeK3g lLwA= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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