Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5220108rdb; Wed, 13 Dec 2023 02:27:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUYeOTITLCxUYGwfqjP0BZHTMQ6/G2I0ht4LGoy2Ednja0703/CICvgdbvS74JOi+8lMOr X-Received: by 2002:a05:6870:a68a:b0:203:294a:50da with SMTP id i10-20020a056870a68a00b00203294a50damr494923oam.75.1702463245175; Wed, 13 Dec 2023 02:27:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702463245; cv=none; d=google.com; s=arc-20160816; b=TBNdHwN1JCkZDROftWHOy84pLXqlDhzDjTHNOY0t70YJAPnl7bpqrinlYM2dVqPlBh jFV2RvSr/m4BnVeah7h9CB/gHDo2LLg+uZOr2Amn4As6KmcBLBc9ntDB57/xEPLrG/3p K87WBCo50Fc3vAgl2ocoWMW778E6hlgpQvhwiL3UOUgWEW7yF3UPVBMB2PKum3iFBQfy vGA9Z+6voPhbFuxxMBVd5eqJwvPSeay/LfLHYhz6Slgu5QXr+Brw/8ztD1JurjMiWD2B HktK+vEkcB4HgvbMTjJobJ1lEMBaYCHDRYDXV0T30V99Oumrj5yM6RqumVaxTSY21Z6+ Mc4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :in-reply-to:from:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=Wqwu+sAlTrd1IESXb5I5A5wdxGrnXcrDJsiE7ECrmOQ=; fh=aaCxQOdjrz+CrjS4fefsagbrYyqB2si6MjvJF3oekCU=; b=RRL857D8JPrC76Q8NUrzbnkj1ypZGLqyGvy9nKSG7V2qkeAygYcN7JYKa4T2XKAP9d p1fJ+ioYwt+lByWFpnetKYr4CYJ/hBhRtKDon1ReqmEAf4Q86dqEKjI7gtduPYrXl7bP hgnzqQOFJ0SC/K4+tKfRA1iX5y9mYo3UGzyvn9x3/gR8ri6p52tLReoKXJ1hF9lTeT90 ZH06ecuD29Zc3DSOxAfSLsCrTgocPKMZt1EcMfPYY2eB50SFJaLp/jajEUYtzgdFHsZM yxC4y2uu2hDB4EirTqEVwf2of8qbGktJCpcBe7fUDZMCHLbH+APzOFDfGr8XeLlGLZWd viCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id v18-20020a631512000000b005b92d40e11bsi9452772pgl.168.2023.12.13.02.27.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 02:27:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 506378225C9F; Wed, 13 Dec 2023 02:27:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233145AbjLMK1G (ORCPT + 99 others); Wed, 13 Dec 2023 05:27:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231863AbjLMK1F (ORCPT ); Wed, 13 Dec 2023 05:27:05 -0500 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 650EDE8 for ; Wed, 13 Dec 2023 02:27:09 -0800 (PST) X-QQ-mid: bizesmtp79t1702463167tcr6ufva Received: from [10.4.6.71] ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 13 Dec 2023 18:26:02 +0800 (CST) X-QQ-SSF: 00200000000000B0B000000A0000000 X-QQ-FEAT: hoArX50alxEwBXgz7H828rQPfU4yCvC4EsFNNxEEJw9G+Qj6wXQGud/XnpIeu gzsjzr7vzPbJdkTk7qpCyHhAXmN6jsoOMT6g5nDU/+/oXwJCQXaFLBKP2t52SEDxqnZV7jM LO7odQU8OgeMDCiBukYm3Qj3gDWvNQS00C5P3OYGX7XfzyTwW25djjB2AAAHwafzTGVBT42 2GXhZMmLANroa6P8eXuDmRuHBW1qawrpw+WNDoYf7/02e0ySkvPrE9LdsBN0Jf9xxBE00lT Mp8i9YaSLZfixre13lDKyjJh63qGtZgJtYcGazaGhR0aIbH0cZP7SGovFgoSmg+4Y0pLMyL T6suoB3IITd8Y7IA1iXkYe8XM8v+UJYB87XFdVrn1p2Zo93qzlQ6351rbbH5Q== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 2304332684790857452 Message-ID: Date: Wed, 13 Dec 2023 18:26:02 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH V2 0/2] riscv: kexec_file: Support loading Image binary file To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, lihuafei1@huawei.com, conor.dooley@microchip.com, liaochang1@huawei.com, guoren@kernel.org, ajones@ventanamicro.com, alexghiti@rivosinc.com, evan@rivosinc.com, sunilvl@ventanamicro.com, xianting.tian@linux.alibaba.com, samitolvanen@google.com, masahiroy@kernel.org, apatel@ventanamicro.com, jszhang@kernel.org, duwe@suse.de, eric.devolder@oracle.com, emil.renner.berthing@canonical.com Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org References: <20231016092006.3347632-1-songshuaishuai@tinylab.org> From: Song Shuai In-Reply-To: <20231016092006.3347632-1-songshuaishuai@tinylab.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz4a-0 X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_MUA_MOZILLA, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,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 howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Dec 2023 02:27:22 -0800 (PST) 在 2023/10/16 17:20, Song Shuai 写道: > Changes since V1: > https://lore.kernel.org/linux-riscv/20230914020044.1397356-1-songshuaishuai@tinylab.org/ > > - Patch1: fix the build error due to the missing functions in machine_kexec_file.c > - Patch2: use FIELD_GET() to get the flags's endianness as Emil proposed > - Cover: update the kexec-tools link as this one[2] which is based on horms/kexec-tools main branch ping ... > > This series makes the kexec_file_load() syscall support to load Image binary file. > At the same time, corresponding support for kexec-tools had been pushed to my repo[2]. > > Now, we can leverage that kexec-tools and this series to use the > kexec_load() or kexec_file_load() syscall to boot both vmlinux > and Image file, as seen in these combo tests: > > ``` > 1. kexec -l vmlinux [other options] // or boot paniced kernel with -p > 2. kexec -l Image > 3. kexec -s -l vmlinux > 4. kexec -s -l Image > ``` > > Though all of the aforementioned tests had been passed in my RV64 Qemu-virt, > it should be noted that tests 3 and 4 should be the emphasis for the current series. > > ~~[1]: https://github.com/sugarfillet/kexec-tools/commits/rv-Image~~ > [2]: https://github.com/sugarfillet/kexec-tools/commits/main_rv > > Song Shuai (2): > riscv: kexec_file: Split the loading of kernel and others > riscv: kexec_file: Support loading Image binary file > > arch/riscv/include/asm/kexec.h | 6 + > arch/riscv/kernel/Makefile | 2 +- > arch/riscv/kernel/elf_kexec.c | 469 ------------------------- > arch/riscv/kernel/kexec_elf.c | 147 ++++++++ > arch/riscv/kernel/kexec_image.c | 98 ++++++ > arch/riscv/kernel/machine_kexec_file.c | 344 ++++++++++++++++++ > 6 files changed, 596 insertions(+), 470 deletions(-) > delete mode 100644 arch/riscv/kernel/elf_kexec.c > create mode 100644 arch/riscv/kernel/kexec_elf.c > create mode 100644 arch/riscv/kernel/kexec_image.c > -- Thanks Song Shuai