Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp773128rwl; Wed, 12 Apr 2023 04:04:02 -0700 (PDT) X-Google-Smtp-Source: AKy350Y9fABXiuEdS2pHxpIfdBCNUO76anX5BxaBGNGDJgH+iq482pyM+/IATwSjZ7NniO9uF5U/ X-Received: by 2002:a05:6a20:9383:b0:d9:d1e6:82ac with SMTP id x3-20020a056a20938300b000d9d1e682acmr2607889pzh.5.1681297442030; Wed, 12 Apr 2023 04:04:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681297442; cv=none; d=google.com; s=arc-20160816; b=kV3HMkA2rA+Q891EPLvZTSeJpBxxgkumYCf4Z9xujgcPz4Hndhrqu1SGqeavnZcgTr JrOb8h1/v0PmfCPM/djhpqbW5JJ/ZLkDGZiH+jWPe6yv555+rwYOqRJr1xFPND4oFYPP nCnEEu8Wf1cG210YHTB0gt2Bqkwwu50m7+ocxVFIOWPoTqMAysCj5Ut4k3AcMtFa+2ka wGM7LA6KeD9kTD2pHRiKX39N0Ac+TaSjpLL4/gosBI7J4pG9GaiqsuYGDT1xMfmxVA7d WEAELEZepS0NCUL+Q/V+DgH8016taFg5KAK2LtXFB6iqRO64zcIVQTCBGM88kWn7A+B5 sHqQ== 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=ULqrEHhe7wn94dGfEunoSUWn7Ar9RsjxKUXhCTKZfLLXL4dPn8f7RGWut7gkGfOr3x 0tM1TLRaR4pPzfpzMTzBnwBgb+q33yZDiU2ztfZ/+tLbgsuXI5aN/uIR4WJjkJhw5Npt GC8t+d/hcfXeTCnOUgFoiJOVknnOH/ZVfEpa9+w30aQ5sLEQWOVk4LPEAvWqnAwPqH4R i+eRqt9p+kZG9eUtQmWb00KY2dzCLv4DKZ7Jf06FF71289mqLHuPEt84Byecu0QojOTB OIi3g021fA8OusR2quitBcof3UWqJIUxlX+Xr223hZKQU9eDQhHVmRRitqiNqozZS3p3 m1lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rUc1jB3s; 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 h29-20020aa796dd000000b006303ebae0eesi1566687pfq.378.2023.04.12.04.03.49; Wed, 12 Apr 2023 04:04:02 -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=rUc1jB3s; 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 S229711AbjDLLBC (ORCPT + 99 others); Wed, 12 Apr 2023 07:01:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbjDLLBA (ORCPT ); Wed, 12 Apr 2023 07:01:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38B2A65B0 for ; Wed, 12 Apr 2023 04:00:59 -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 BB33C632EE for ; Wed, 12 Apr 2023 11:00:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AF39C4339E; Wed, 12 Apr 2023 11:00:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681297258; bh=QIM4dvy+y3uMDNtnBsSv0HyVwFsc2IPurP1uLhVlB6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rUc1jB3s4OWmcYrxzPWlTf0Hcp83OXraIUdGJLDtTxhJHmf49kYA9Cs0uA4J7vpDG zsC6npQXsyyKSabxyHpKC69XTwGMlsYE0AZPrYg/wPg9f0VpboUNvEa08w1pEO/znJ 4jSYW4kmnNv261NLqP3hlkhDODed5zD5mMbw+4XqjoJOYPLJ2CMssrZ1k4oxiwlG5N DvWfQOe/H7ZOyFvxnjG25z+KcMUk1bPaC328fwskclF+E8zF/s5NM8x6ecaPuQxIFG xvkfQWU6kezb6Sj2VMYXrpgcpL0Z8aSwAbUCtIrlYgY1tPX7CCVw3SQK8W1PEbnTQx EbBjUXrU2UAjg== From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: Ard Biesheuvel , Herbert Xu , Eric Biggers , Kees Cook Subject: [PATCH v2 07/13] crypto: x86/crc32c - Use RIP-relative addressing Date: Wed, 12 Apr 2023 13:00:29 +0200 Message-Id: <20230412110035.361447-8-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=795; i=ardb@kernel.org; h=from:subject; bh=QIM4dvy+y3uMDNtnBsSv0HyVwFsc2IPurP1uLhVlB6M=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIcWs3zs48Ht06m4vRWkr9U2V6VXOp28zRBkkblljkt1y0 MjKY3lHKQuDGAeDrJgii8Dsv+92np4oVes8SxZmDisTyBAGLk4BmIh8HsP/8O4rNb/N6m7kOCQp h1upFH58/Zz9dPVVRabTKrb/m7NmMjIsUVdNW6x2N7tONavw3PclBzNTMoTVheP99OMDYjfkWvE BAA== 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/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