Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp848847rwb; Wed, 26 Jul 2023 04:03:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlFmxXZ3qIFWHrDyhPHrytP3sJGF80FqUMnVwV11gQyuT35H3jDs5TmZ4yG8TI2VJoTVE/le X-Received: by 2002:a17:90a:4a88:b0:268:def:a322 with SMTP id f8-20020a17090a4a8800b002680defa322mr1253520pjh.9.1690369411753; Wed, 26 Jul 2023 04:03:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690369411; cv=none; d=google.com; s=arc-20160816; b=MFTNZWQEN7lJiLHCAE8it7pM1mVRu07Bghh6aSp67pMYb7snoxQj5boqwPPW0cWbHw 1RmpQfrEPq7I5P074dtzNcbAlMcgdDqnGdML+dwcSom8NxxykrMvq9FxpzL9PyNxdUnw jX8H8LSzmn9YGeDfihYMNNKuXKWQUX7gvrujMWDWuicgc6c4eEr5Pqne7IijOUlOpoBc 0G1XGq9M/RE8QixAgX9h5qlbGkwiD3FXw+HeLd63cBSbo8MmPxkjIe0AxjkZeSlV0KL0 lJa/TtZKDuANtvtecl/d3rLExwlmtrwQ4ABSR84QpxWZUpw7qnVKnkjEmrqTrg/xQGB7 qXwg== 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 :message-id:date:subject:cc:to:from; bh=YtAG+jDweaPsKz6Kx42fyxxhIVOIkhLdbbVmOQs0w7Y=; fh=628iOkxKoFjwYFpe4/UUsO7eEG2fFpt/bCqQ+fGWed4=; b=JzfLsOxukeA3xeWI77487dE2npgAYXFD3lne0gQDGULj+SMg5pd0m5WinD954ywRUq fcX6brLy042z8Mnqf3NDphqOOdC29K1nZPk9h1fI1CNlN9f5eS5iWznT3D/j0VdI5YeK qrCypYRYjhz2xJMQsuCh8zt43PU+bNiyOMGww6UIQHtf/DDYPXeJvw03roSh4r1cOX9R LQEaMv1UA4SF+B9syjh53Kf/vZCPLDTSifII8R8dbY7Al0hS0/MZpiFT3cHhTENftTGk spheGOLLhtoAIb+OKjAxm5MzYqrtITMKKG6rwTy8jvZa6nV5V5cZbsZrkjjVe/4wQjTg 49VQ== 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 p8-20020a17090a2d8800b00262e28866d4si943419pjd.163.2023.07.26.04.03.16; Wed, 26 Jul 2023 04:03:31 -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 S232771AbjGZJ4E (ORCPT + 99 others); Wed, 26 Jul 2023 05:56:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231497AbjGZJza (ORCPT ); Wed, 26 Jul 2023 05:55:30 -0400 Received: from frasgout12.his.huawei.com (unknown [14.137.139.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC0751BD5 for ; Wed, 26 Jul 2023 02:54:50 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.18.147.228]) by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4R9pnS4JV2z9v7cV for ; Wed, 26 Jul 2023 17:41:32 +0800 (CST) Received: from A2101119013HW2.china.huawei.com (unknown [10.81.211.226]) by APP1 (Coremail) with SMTP id LxC2BwBHo95C7cBk+WYTBQ--.33492S2; Wed, 26 Jul 2023 10:54:22 +0100 (CET) From: Petr Tesarik To: 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 , linux-riscv@lists.infradead.org (open list:RISC-V ARCHITECTURE), kexec@lists.infradead.org, linux-kernel@vger.kernel.org (open list) Cc: Torsten Duwe , Roberto Sassu , petr@tesarici.cz Subject: [PATCH v2 0/3] RISC-V: Fix a few kexec_file_load(2) failures Date: Wed, 26 Jul 2023 11:53:58 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: LxC2BwBHo95C7cBk+WYTBQ--.33492S2 X-Coremail-Antispam: 1UD129KBjvdXoWruw1fGr48Cw17uFW3XFWrKrg_yoWkWrg_WF W8ta1Dtw4IqFs5JF47tw1rtFWFkF1xtryDCwnxtrW7Gr9xWFy5JanYkrsrZw10qFsaq3sx XFZ8X34ftw47WjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbh8FF20E14v26ryj6rWUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j6F 4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628v n2kIc2xKxwCY1x0262kKe7AKxVWUtVW8ZwCY1x0264kExVAvwVAq07x20xyl42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r4a6rW5MIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE 42xK8VAvwI8IcIk0rVWrJr0_WFyUJwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87 Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjfUnF4iUUUUU X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_L3,RDNS_DYNAMIC,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 From: Petr Tesarik The kexec_file_load(2) syscall does not work at least in some kernel builds. For details see the relevant section in this blog post: https://sigillatum.tesarici.cz/2023-07-21-state-of-riscv64-kdump.html This patch series handles an additional relocation types, removes the need to implement a Global Offset Table (GOT) for the purgatory and fixes the placement of initrd. Changelog ========= Changes from v1: - Replace memcmp() with a for loop. - Drop handling of 16-bit add/subtract relocations. They were used only by alternatives in strcmp(), which was referenced only by string.o. - Add the initrd placement fix. Petr Tesarik (1): riscv/purgatory: do not link with string.o and its dependencies Torsten Duwe (2): riscv/kexec: handle R_RISCV_CALL_PLT relocation type riscv/kexec: load initrd high in available memory arch/riscv/kernel/elf_kexec.c | 3 ++- arch/riscv/purgatory/Makefile | 26 +------------------------- arch/riscv/purgatory/purgatory.c | 6 ++++-- 3 files changed, 7 insertions(+), 28 deletions(-) -- 2.25.1