Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2140016rwl; Sat, 8 Apr 2023 08:29:30 -0700 (PDT) X-Google-Smtp-Source: AKy350bEa4wPwIV6kKcMbJrsGzwOXF0eWeDyHx57bF/s5LKMWHRj4BUOp/NDISTTx8o6uR4YBad2 X-Received: by 2002:a05:6402:2811:b0:4bb:afe3:e0a with SMTP id h17-20020a056402281100b004bbafe30e0amr2999585ede.3.1680967770533; Sat, 08 Apr 2023 08:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680967770; cv=none; d=google.com; s=arc-20160816; b=aR+vXBqRXQrTSuc8M5bPCbRewNhyfBCCG0owAJB9Scvp5Ar3anvh+Ksq+nUjQGJt4t Wb1/L5wuZCtKwPF+uDBWstPANqzdKK4CP8YkjzHNqdlGhsIrj0D06fh3Xis1z+w0gsyo QQgA7Njz4a0Phc14uSkCmMEjQFg6JL648O9A7BL5lHsRQoh8wCEc6pBnz0Gp+mIgwleU xTYJ5AObbZdjUOLUg9W6AofkC8NY1O48iGd+5LqYbpGRmafRS3tt2rFfxEF0T6i9QHx0 qOM6eP/6EOHe/5YSN1/UKU9yadwk19QFx8uTd/WEKiACHztb2NsWat3QpXIqB2wmUSoH W2ZA== 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=grqPZ8JWXcWo6FHQinGL1XLHjDd/aHkgzn6ty49r04g=; b=iMm2cslnqo7cu4tye/azzF/R4JD/Lca/MVfYuWnfTB1jgWje+OshFatKpNe9Sg2jHA +5oWLbSEQm9j+EhU5K6+tbb6JVuac+kxYt1tKv3Pf4Sg0O27IOT3FeQ6mOlRXR68Z9+L w6D/XZlCHUCRkVqEVY8jzGwh9JJzA3r/nNOWoqetKjHY1fVhugdkZEhbA/jh/33Pyr8P rBsPbf1yRNK27jwG1Sy+lXkGPdFZhc2J8Ib0vzTS1i9/pYlY+pAheUBLXHPRAnhdw78n +4aeVn1sBtt0JRSVnCZqymWuk4yAOifsJXrxKAIWho4+IxIVwMuDhbP1L5bYorq0V/4x gyxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OzPOkFSS; 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 l8-20020aa7c308000000b004fd1f2a0eb2si5411280edq.423.2023.04.08.08.29.06; Sat, 08 Apr 2023 08:29:30 -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=OzPOkFSS; 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 S229912AbjDHP1y (ORCPT + 99 others); Sat, 8 Apr 2023 11:27:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbjDHP1v (ORCPT ); Sat, 8 Apr 2023 11:27:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53F8EB47A for ; Sat, 8 Apr 2023 08:27:50 -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 D8E8B60B42 for ; Sat, 8 Apr 2023 15:27:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CC03C4339C; Sat, 8 Apr 2023 15:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680967669; bh=QIM4dvy+y3uMDNtnBsSv0HyVwFsc2IPurP1uLhVlB6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OzPOkFSSg6oU7LxdT9nkNIxKAnu18p3r6mKPA/wjWd73wk3U6oj0pobp4CyQVY5P4 ybPflmmGFhfk8nU8SK33NRDAlwOk6cCyh7W9n8Sn1VmxcCj8mEeOq8g8bpQ0akJDbs xyDdxKCUOujRGXNqcG5fBY1ZgYFVY/E8NAe5qPlN7lLTllALIKIpCbyuEB6ecgWGHt GUjZvKmp5Zcd/n7fNeC8csSIadjAQIL/40gsDkE/EUtk2lD3DA/RCBr+k9gTTGDOK0 bRqJa+ZlBHf88YCFsAF1f5ZVHvkfwy0+HxJPgWMVyBhsqa8NePH5RavKNWzREHPc6T BdzxTHkNymO6A== From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: Ard Biesheuvel , Herbert Xu , Eric Biggers , Kees Cook Subject: [PATCH 07/10] crypto: x86/crc32c - Use RIP-relative addressing Date: Sat, 8 Apr 2023 17:27:19 +0200 Message-Id: <20230408152722.3975985-8-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=795; i=ardb@kernel.org; h=from:subject; bh=QIM4dvy+y3uMDNtnBsSv0HyVwFsc2IPurP1uLhVlB6M=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIcWw/Vpw4Pfo1N1eitJW6psq06ucT99miDJI3LLGJLvlo JGVx/KOUhYGMQ4GWTFFFoHZf9/tPD1RqtZ5lizMHFYmkCEMXJwCMJHI6wz/3VYtnjXvi673ouh0 d4sdJ9Ty7V/+3L+jMUTz0P0z3tpnljL84dgoutZeY6dhY+xdkf0/Y76pHA8/n/R57c6/T6O2xHo +5wYA X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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/crc32c-pcl-intel-asm_64.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S index ec35915f0901a087..5f843dce77f1de66 100644 --- a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S +++ b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S @@ -168,7 +168,8 @@ continue_block: xor crc2, crc2 ## branch into array - mov jump_table(,%rax,8), %bufp + leaq jump_table(%rip), %bufp + mov (%bufp,%rax,8), %bufp JMP_NOSPEC bufp ################################################################ -- 2.39.2