Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2427485rwo; Thu, 3 Aug 2023 09:11:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlGpnUg/CLMZP85cntdkz8fcrZqef6TMT6AWTo3E5TbTbrX1MdOVFrsL36+oIn01eXUt4VAL X-Received: by 2002:a17:906:31c2:b0:992:9a5e:3172 with SMTP id f2-20020a17090631c200b009929a5e3172mr7293434ejf.59.1691079095077; Thu, 03 Aug 2023 09:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691079095; cv=none; d=google.com; s=arc-20160816; b=AsIk2nduo/+hpYObYGA+FzCy9CQqeyCyT3HuhbE39Y/0OKRYZ/GkIgIx7YDRtosgLs Z6b2TjGZpNGMGVFHkooKwAxVxEt6Mnjj2ywmddqK5ClvJOeXRfRKxWPMvkdgCHdTiJib bjCKJIfDqk5KJqu2IQUoUW+JJeUtXrb1z7YMCo7uNMzcLkbqxOc3p+cUgo7s3237yPb1 Hex7LH4qIDeIfl4QChUwcl6NBMFrbWVmgyMH/loxHaKNCtSzF65mqOxkoaKTBts81I14 JflP2DfXDmu9ozU16g5h6k6OcCN8jo9lJEbCo83jCbyrvg2dKUsn+fnX5t4KtqwRmqRA XE0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=CuyROLY0NGWQoID1UmJNyY1O39oeHhjvhDz5wnEhV+Y=; fh=FQ262bkYiHwGtBhl0Nw8jsVb+uwypf4wgieXxVb9DTg=; b=N5r2qcEKN+a9B0Mcm6XHKYELUKByFloy8vpkmyeslwbBiJJgdJ0P6SHJVibUlIucy9 hyymstqXk/Md6W15E9uC9dW+hcUsw73mOQ9bVwfEL3Bjj2q7OhypdnVTWDz5dwUaOpu6 nl2SAIocmZ3NHHOJfqEClPv1hB+kGFd9VCeXYPS/yUbILLRSYLYzorBYDacLRpOS1JeW qmVQp2+oLjSvyEL+eVJFlK3v9vSdTXCEXGsvrQ5C6dajVBJgC08emxGDDOCRV7zjkGX7 1MLy+4ZJf57EFLldr140/f0AZ0Q1BeWgY4fNgmtNyjZCeDxpFuQA8Pxd/QDhO1eoX7yp /g7Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k11-20020a17090666cb00b00991f1e4b03dsi28280ejp.406.2023.08.03.09.11.10; Thu, 03 Aug 2023 09:11:35 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237151AbjHCPe1 (ORCPT + 99 others); Thu, 3 Aug 2023 11:34:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235973AbjHCPeZ (ORCPT ); Thu, 3 Aug 2023 11:34:25 -0400 Received: from frasgout12.his.huawei.com (unknown [14.137.139.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B671730FF for ; Thu, 3 Aug 2023 08:34:23 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.18.147.228]) by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4RGsxF1JF7z9xGWx for ; Thu, 3 Aug 2023 23:20:49 +0800 (CST) Received: from [10.81.221.240] (unknown [10.81.221.240]) by APP1 (Coremail) with SMTP id LxC2BwBXC7vUyMtkePU6AA--.360S2; Thu, 03 Aug 2023 16:33:52 +0100 (CET) Message-ID: Date: Thu, 3 Aug 2023 17:33:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/3] riscv/purgatory: do not link with string.o and its dependencies Content-Language: en-US To: Palmer Dabbelt , Conor Dooley Cc: Paul Walmsley , aou@eecs.berkeley.edu, Conor Dooley , lihuafei1@huawei.com, liaochang1@huawei.com, masahiroy@kernel.org, keescook@chromium.org, akpm@linux-foundation.org, heiko@sntech.de, ribalda@chromium.org, hi@alyssa.is, lizhengyu3@huawei.com, linux-riscv@lists.infradead.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, duwe@suse.de, roberto.sassu@huaweicloud.com, petr@tesarici.cz References: From: Petr Tesarik In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CM-TRANSID: LxC2BwBXC7vUyMtkePU6AA--.360S2 X-Coremail-Antispam: 1UD129KBjvJXoWxZFyUGrWDGFWDuFy8uFW8Crg_yoWrGryrpF 4vkF1DKrW8Gr18Cr1Dtr1UZryUtw4UGw1UJryUWFyjyr4Utr1jqF4DWr12gr1DJr48Gr1U JFy7Wr15ur1UZrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkK14x267AKxVW5JVWrJwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4j6r 4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcVAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2kI c2xKxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14 v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_GFv_WrylIxkG c2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_ Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbQVy7 UUUUU== X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,MAY_BE_FORGED, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_L3,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On 8/3/2023 5:13 PM, Palmer Dabbelt wrote: > On Wed, 26 Jul 2023 09:33:49 PDT (-0700), Conor Dooley wrote: >> On Wed, Jul 26, 2023 at 11:54:00AM +0200, Petr Tesarik wrote: >>> From: Petr Tesarik >>> >>> Linking with this object file makes kexec_file_load(2) fail because of >>> multiple unknown relocation types: >>> >>> - R_RISCV_ADD16, R_RISCV_SUB16: used by alternatives in strcmp() >>> - R_RISCV_GOT_HI20: used to resolve _ctype in strcasecmp() >>> >>> All this hassle is needed for one single call to memcmp() from >>> verify_sha256_digest() to compare 32 bytes of SHA256 checksum. >>> >>> Simply replace this memcmp() call with an explicit loop over those 32 >>> bytes >>> and remove the need to link with string.o and all the other object files >>> that provide undefined symbols from that object file. >>> >>> Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file") >>> Signed-off-by: Petr Tesarik >> >> This version keeps the automation happy, >> Acked-by: Conor Dooley > > Oddly enough, this breaks my builds.  I tried fixing the first one with > something like FTR I have no idea how a patch to the purgatory code and its Makefile can have any effect on the compilation of asm-offsets.s in another directory. Petr T >    From 41c5a952f77e53bf4201296abff0132725aa19e6 Mon Sep 17 00:00:00 2001 >    From: Palmer Dabbelt >    Date: Wed, 2 Aug 2023 20:22:33 -0700 >    Subject: [PATCH] RISC-V: Include io from timex >       Without this I get some implicit declarations. >         CC      arch/riscv/kernel/asm-offsets.s >    In file included from linux/include/linux/timex.h:67, >                     from linux/include/linux/time32.h:13, >                     from linux/include/linux/time.h:60, >                     from linux/include/linux/ktime.h:24, >                     from linux/include/linux/timer.h:6, >                     from linux/include/linux/workqueue.h:9, >                     from linux/include/linux/mm_types.h:19, >                     from linux/include/linux/mmzone.h:22, >                     from linux/include/linux/gfp.h:7, >                     from linux/include/linux/mm.h:7, >                     from linux/arch/riscv/kernel/asm-offsets.c:10: >    linux/arch/riscv/include/asm/timex.h: In function 'get_cycles': >    linux/arch/riscv/include/asm/timex.h:25:16: error: implicit > declaration of function 'readl_relaxed' > [-Werror=implicit-function-declaration] >       25 |         return readl_relaxed(((u32 *)clint_time_val)); >          | >       Signed-off-by: Palmer Dabbelt >    --- >     arch/riscv/include/asm/timex.h | 1 + >     1 file changed, 1 insertion(+) >       diff --git a/arch/riscv/include/asm/timex.h > b/arch/riscv/include/asm/timex.h >    index a06697846e69..1a4d181193e0 100644 >    --- a/arch/riscv/include/asm/timex.h >    +++ b/arch/riscv/include/asm/timex.h >    @@ -7,6 +7,7 @@ >     #define _ASM_RISCV_TIMEX_H >         #include >    +#include >         typedef unsigned long cycles_t; > >    --    2.41.0 > > The other two look fine and are somewhat independent, so I've picked > those up > for fixes. > > Thanks! > >> >> Thanks, >> Conor.