Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1287422rwb; Wed, 26 Jul 2023 10:07:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlHGMBi2jPape/ou3MJvYM+KOLnEEtkP5pvhs0ZqKLl+FqEM0qJUBeVRrtIrc7adVksrUnnm X-Received: by 2002:a17:902:ce86:b0:1b5:fb8:a821 with SMTP id f6-20020a170902ce8600b001b50fb8a821mr2867325plg.13.1690391245861; Wed, 26 Jul 2023 10:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690391245; cv=none; d=google.com; s=arc-20160816; b=QS0g3XmuFRpnRWjxtGhnDIWB9CZeeAoP9LHcxu0VkiYjOZd3LjZFyaTBbgRfbviRM7 eaRFrXxO3VECGeg7y6PJle63zPif/9Hgp1mRI18czQB19zzuRbWrhrJ9MwwZKuzhFJft sQAb+fAY+DWIPsokJO9pjriZ7blh7gorvDx+i8kfJJySIB6cTwR/qaRc91aN0lMfc63v hEPOy4pomlUCyME5WAl5SmSW4J0c7rbe+HuujT/tN++vlZ2zo+Qe7Tu/4s90ttV7Jzhn uqrbFin/2HzM6UNDX7cvBKyXwJ9suRhFBy0uzZt1SepLCZPFeBkxce8+z4TIh7npiFsF 4ddw== 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:dkim-signature; bh=qu98mFypzryfpNaKpoZ+to2I3RSD5K9vRrssyVUA0yo=; fh=8yFwv2Cczl8jFn/LRPipVZTtkahE3jc1OyvcxzeW4/4=; b=nTtdLJyF6VwIS4yH4mr7XGZk0D0W9RrpPwqwqzFBiXN+htd4CncoP76AwACkBENIrB Ri6zfDfrbx734JnnXKa8PDaH9g049NsuxcawVS0Et0/AIWl+sVCKVwQX7rZXlrR+rwXY cXGzf3xkxHSGsyfVC01o5+1E4nN+IoWOHzAfHyCh6Y6JA+Wq0Ir6DjDW7GS2B09Hx7rb rHG3nIJCp3GOQPtUhHgdfy5msOIA73+xgWHUlSXomSq+hLhiBrWYIEcGWL4M7P/oxB4c dRxllrY77jvoHHysT2q35Hp+r6AakCxqzm51vwdevxDEwDdX75Shgc1beJkz/sTq/6HA nqzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D54mej26; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 j3-20020a170903028300b001b8b37f0ab0si13819181plr.280.2023.07.26.10.07.12; Wed, 26 Jul 2023 10:07:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=D54mej26; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S229480AbjGZQd7 (ORCPT + 99 others); Wed, 26 Jul 2023 12:33:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjGZQd6 (ORCPT ); Wed, 26 Jul 2023 12:33:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 194BC2707 for ; Wed, 26 Jul 2023 09:33:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A9C2961BBD for ; Wed, 26 Jul 2023 16:33:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57627C433C7; Wed, 26 Jul 2023 16:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690389235; bh=qu98mFypzryfpNaKpoZ+to2I3RSD5K9vRrssyVUA0yo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D54mej26YFHACyW3/VOA+ZMi36bsP/fou7ZveiThS03CWvwwpJN/kdUnKqSNHiFJP FKS9xAVPUOTubYpjQIKpjkfmAuQtTpL5Aqakr9L257D1bsF/6THKz4UC9x0P16oMRB 9oPeimDouzi9q/Wo3+554QvmYQNKafyxGrnYBjCq0UICUO4Hh8BkYSHnM93w0hJyt0 WRmeAWylRa/zCCPNi3AzeeM6zGzeTYuR2aA9KQMN9cTtJj+9bZrcjmVG+udwROFsIs 4S6p/YUV5CCDWmweF5n1kRHjgdPpCZd/+j0cpig9S0pQCdhtdds1c800KpH6GH1k4u hh/OCaAABboWg== Date: Wed, 26 Jul 2023 17:33:49 +0100 From: Conor Dooley To: Petr Tesarik Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Li Huafei , Liao Chang , Masahiro Yamada , Kees Cook , Andrew Morton , Heiko Stuebner , Ricardo Ribalda , Alyssa Ross , Li Zhengyu , "open list:RISC-V ARCHITECTURE" , kexec@lists.infradead.org, open list , Torsten Duwe , Roberto Sassu , petr@tesarici.cz Subject: Re: [PATCH v2 2/3] riscv/purgatory: do not link with string.o and its dependencies Message-ID: <20230726-excavate-swoosh-424ede98f63d@spud> References: <2832b3e5ac781a0c0ade9d77b15a80e7f2fb4ab2.1690365011.git.petr.tesarik.ext@huawei.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1Yc8XiDptGjnzByY" Content-Disposition: inline In-Reply-To: <2832b3e5ac781a0c0ade9d77b15a80e7f2fb4ab2.1690365011.git.petr.tesarik.ext@huawei.com> 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,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org --1Yc8XiDptGjnzByY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 26, 2023 at 11:54:00AM +0200, Petr Tesarik wrote: > From: Petr Tesarik >=20 > Linking with this object file makes kexec_file_load(2) fail because of > multiple unknown relocation types: >=20 > - R_RISCV_ADD16, R_RISCV_SUB16: used by alternatives in strcmp() > - R_RISCV_GOT_HI20: used to resolve _ctype in strcasecmp() >=20 > All this hassle is needed for one single call to memcmp() from > verify_sha256_digest() to compare 32 bytes of SHA256 checksum. >=20 > Simply replace this memcmp() call with an explicit loop over those 32 byt= es > and remove the need to link with string.o and all the other object files > that provide undefined symbols from that object file. >=20 > Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file") > Signed-off-by: Petr Tesarik This version keeps the automation happy, Acked-by: Conor Dooley Thanks, Conor. --1Yc8XiDptGjnzByY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHQEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZMFK7AAKCRB4tDGHoIJi 0nywAP45WUTUj6aGAMM66t2i6LtknIHriZ5AtX22HuqEfK8W3gD45i6hU1k0jKxD iBzfCHatNLhnBRoYTPRflCChJJDBAA== =pFZE -----END PGP SIGNATURE----- --1Yc8XiDptGjnzByY--