From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PULL_REQUEST, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13992C83000 for ; Tue, 28 Apr 2020 17:58:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9ACD20757 for ; Tue, 28 Apr 2020 17:58:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=atishpatra.org header.i=@atishpatra.org header.b="LQzvdqLM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728313AbgD1R6B (ORCPT ); Tue, 28 Apr 2020 13:58:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727827AbgD1R6B (ORCPT ); Tue, 28 Apr 2020 13:58:01 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07FDDC03C1AB for ; Tue, 28 Apr 2020 10:58:01 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id k13so25783250wrw.7 for ; Tue, 28 Apr 2020 10:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5lOQR/0LhdL7Cn40m4Omd/1YL4MKB8xUQs57NlDuHek=; b=LQzvdqLM0oAZv3fkh6QdWruitiuJ8wS90F5YLeN+LjB+Cr4EK7t8TJCzxLIpRe8GTa tXIFSunSbn7/lJlK0l5Yn78GRhtJS8ep29w6Mh/maQgdvrtOBf8wQOB3I/Y1RuHji5iR H8QnB8AxX1FoW4LF+NGNF6uQFqliwu4k0yWPY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5lOQR/0LhdL7Cn40m4Omd/1YL4MKB8xUQs57NlDuHek=; b=mGJpGl8Yse8iwMYa8hlcSla/Jv9+23aXvSiY58OJmNWpNy0Mv/ovOmqWBN34o7jvNk 8lc7xCZyD7byD832hgPCidH/kHvbIGEoXXWPyei1yb3zQOdLMrox0dAzi5yuuYV0g5Dw Zp6+BUSRzS7cllZmHGy0jYxvpYrN7UhFooGF7oYwmNGe0sE+459eEpzIVCPiso9WZDS6 mrKeiFdxPMAgYD0qqWV488RLBTjU+QpMf/5a418C+TN7GLlt+TfCc0ZtZwLMYDqw9oWI +OOhMeHZDgZj1vHaUMlWwXwprixXXoeyyvTY5njeca28CFG8BTwLhr1MQfU1q/aH4Nvw 76Bg== X-Gm-Message-State: AGi0PuZQbWfQJr0gBrflrozayjS+bQUxOb4/8Z5WLnuBAkrTbRgE+7/a 8sWBidFeXeqnqtIWuNkroHttBB6H/KxsnGKtZdbh X-Google-Smtp-Source: APiQypKWJk01qLF2xkgo+QNE09A4kSBGEaG2H+m491sR6fEG52tfyM+gNyaDBuhPUd7YMpcrFO4ZpKQBDDix1isnEv0= X-Received: by 2002:adf:ab5c:: with SMTP id r28mr34098877wrc.384.1588096679681; Tue, 28 Apr 2020 10:57:59 -0700 (PDT) MIME-Version: 1.0 References: <20200425193128.25638-1-ardb@kernel.org> In-Reply-To: From: Atish Patra Date: Tue, 28 Apr 2020 10:57:48 -0700 Message-ID: Subject: Re: [GIT PULL] EFI stub loading support for RISC-V To: Ard Biesheuvel , Palmer Dabbelt Cc: linux-efi , Atish Patra , Paul Walmsley , Albert Ou , linux-riscv Content-Type: text/plain; charset="UTF-8" Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org On Sun, Apr 26, 2020 at 12:52 PM Atish Patra wrote: > > On Sat, Apr 25, 2020 at 12:31 PM Ard Biesheuvel wrote: > > > > Palmer, > > > > As discussed, below are the changes for v5.8 that can be taken via the > > RISC-V tree to implement booting RISC-V Linux from EFI firmware. > > > > You can fetch and merge the signed tag directly, or merge 22090f84bc3f80 > > and cherry pick the 4 patches on top of it, if you see any need to do so > > (but please use a topic branch in that case) > > > > Please be aware (as is noted in the tag) that these changes are really > > the bare minimum that is needed to launch the kernel from EFI firmware. > > In the current state, you may be able to boot from Uboot in EFI mode, > > but Tianocore based boot will not work at all, unless you convert the > > EFI memory map back to DT memory nodes in the firmware implementation, > > and I can assure you that that is not something that will be accepted in > > upstream Tianocore. > > > > So in summary, this is unfinished work, and I can only recommend merging > > these changes once there is a plan in place to complete the implementation. > > > > I have started looking into this part. My initial plan was to start > looking into it right after I got > the boot time services working but other things took priority. Thanks > for your review and > suggestion throughout the process. I will coordinate with Abner/Daniel > to test RISC-V UEFI > runtime services(once implemented) with tianocore. > > -- > > Ard. > > > > > > The following changes since commit 22090f84bc3f8081e0ec180ccaedc85820085376: > > > > efi/libstub: unify EFI call wrappers for non-x86 (2020-04-23 20:15:06 +0200) > > > > are available in the Git repository at: > > > > git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git tags/riscv-efi-for-v5.8 > > > > for you to fetch changes up to 66b4ac6b9dd1fdbb8ac7a1f20a8d08066368245d: > > > > RISC-V: Add EFI stub support. (2020-04-25 13:59:54 +0200) > > > > ---------------------------------------------------------------- > > EFI stub loading support for RISC-V > > > > This branch implements support for loading the RISC-V Linux kernel > > straight from EFI firmware, by adding PE/COFF metadata to the kernel > > image and incorporating the kernel's EFI stub. > > > > Note that this is the *bare* minimum that is needed to boot from EFI > > firmware. The following pieces are still missing at this point, and > > will be required for full interoperability with generic EFI firmware: > > - using the EFI memory map instead of the device tree to populate the > > memblock tables > > - parsing and handling of generic EFI configuration tables (such as > > SMBIOS), as well as architecture specific ones that may be defined > > for RISC-V > > - runtime mapping of EFI runtime services memory and MMIO regions, and > > support for EFI runtime services (get/set time, get/set variable, reset > > system) > > > > ---------------------------------------------------------------- > > > > Cc: Atish Patra > > Cc: Palmer Dabbelt > > Cc: Paul Walmsley > > Cc: Albert Ou > > Cc: linux-riscv@lists.infradead.org > > > > Atish Patra (4): > > include: pe.h: Add RISC-V related PE definition > > RISC-V: Define fixmap bindings for generic early ioremap support > > RISC-V: Add PE/COFF header for EFI stub > > RISC-V: Add EFI stub support. > > > > arch/riscv/Kconfig | 22 ++++++ > > arch/riscv/Makefile | 1 + > > arch/riscv/configs/defconfig | 1 + > > arch/riscv/include/asm/Kbuild | 1 + > > arch/riscv/include/asm/efi.h | 33 +++++++++ > > arch/riscv/include/asm/fixmap.h | 18 +++++ > > arch/riscv/include/asm/io.h | 1 + > > arch/riscv/include/asm/sections.h | 13 ++++ > > arch/riscv/kernel/Makefile | 4 ++ > > arch/riscv/kernel/efi-header.S | 100 +++++++++++++++++++++++++++ > > arch/riscv/kernel/head.S | 16 +++++ > > arch/riscv/kernel/image-vars.h | 53 +++++++++++++++ > > arch/riscv/kernel/vmlinux.lds.S | 22 +++++- > > drivers/firmware/efi/Kconfig | 3 +- > > drivers/firmware/efi/libstub/Makefile | 10 +++ > > drivers/firmware/efi/libstub/riscv-stub.c | 109 ++++++++++++++++++++++++++++++ > > include/linux/pe.h | 3 + > > 17 files changed, 407 insertions(+), 3 deletions(-) > > create mode 100644 arch/riscv/include/asm/efi.h > > create mode 100644 arch/riscv/include/asm/sections.h > > create mode 100644 arch/riscv/kernel/efi-header.S > > create mode 100644 arch/riscv/kernel/image-vars.h > > create mode 100644 drivers/firmware/efi/libstub/riscv-stub.c > > > > -- > Regards, > Atish Hi Palmer, There were few build errors for all-yes config and nommu reported by 0-day tests. As some of the fixes require to add some dummy declarations for efi runtime related functions, Ard suggested that we should drop the series for now and merge with full uefi support later. -- Regards, Atish From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PULL_REQUEST, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0D4AC83000 for ; Tue, 28 Apr 2020 17:58:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C2D9F20757 for ; Tue, 28 Apr 2020 17:58:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oaaUVD8R"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=atishpatra.org header.i=@atishpatra.org header.b="LQzvdqLM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2D9F20757 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=atishpatra.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:To: Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5lOQR/0LhdL7Cn40m4Omd/1YL4MKB8xUQs57NlDuHek=; b=oaaUVD8Rc1HcVRi5br+TeadVM YwmAzOmUfe7NAlQeN5NZrwseWyzKjoL4SQWDqxHNqEROKsT2IcpzbeWPQWa+5rhOlETHX6Y3sDKhP m1HmKWxdFc9IACCP3lxIlavgsp9atvkUi+HfZB4NJN9VhJL2fwNv76ydt4GqDWno8GVQ8P9As1zVR HE37sywu7xiiurCFUSBF+E+DghrdfqZIuhCxY2RTWhJeTwsuRF2HIsckBti9COLBMbu0CmUrf/NmB Y1hKV28oLPcqCHAzamwrE6r2cWY7EiaL191yrc85YjQLnMHEWA+EvZbjM2bSP1RGF6vdOVhhVo8NS e13e/JxfQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTUUf-0003ot-9H; Tue, 28 Apr 2020 17:58:05 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTUUb-0003o1-JX for linux-riscv@lists.infradead.org; Tue, 28 Apr 2020 17:58:03 +0000 Received: by mail-wr1-x444.google.com with SMTP id x17so25003232wrt.5 for ; Tue, 28 Apr 2020 10:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5lOQR/0LhdL7Cn40m4Omd/1YL4MKB8xUQs57NlDuHek=; b=LQzvdqLM0oAZv3fkh6QdWruitiuJ8wS90F5YLeN+LjB+Cr4EK7t8TJCzxLIpRe8GTa tXIFSunSbn7/lJlK0l5Yn78GRhtJS8ep29w6Mh/maQgdvrtOBf8wQOB3I/Y1RuHji5iR H8QnB8AxX1FoW4LF+NGNF6uQFqliwu4k0yWPY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5lOQR/0LhdL7Cn40m4Omd/1YL4MKB8xUQs57NlDuHek=; b=T8IpURNVZOubVUGlz4L+ZzQj2fjVOOw/MZG+l9q0LXNyTX3yA8rAhFE74SPYMZLw0v g53phmwPUb4gyjQ/qA+907UGXSkXoptojbzSFIATL7PtmUpSH5IhddKSMMswSkbTvmPT QheLdR0DNodRtc6dyeCIYWAlOzUZ12TMsAp4fBFDIpjILjWSYM7PoDD7vnzyRazvLczZ ULUJ75Lvc4TEDh/+M5P3YtjE2XIDnne9p29e9sM2BQMtaF/jJcmGRX+g6DSctifLHF42 U6pCGN/ZgZvZFaHJui7OMZPURT51ESt8z/NVHNJPDNQsnrLUK8ogF/jd17YXXh8ITOyc k9zQ== X-Gm-Message-State: AGi0PubdCf2Dt2Nsv+NtY4CwLmVXMtTqEIhuZ4Ynr9qe8WReq5d1T+C1 XLpci3+fxYG5ioULe7gwSWXF46TZ2CPt9M6y7s5J X-Google-Smtp-Source: APiQypKWJk01qLF2xkgo+QNE09A4kSBGEaG2H+m491sR6fEG52tfyM+gNyaDBuhPUd7YMpcrFO4ZpKQBDDix1isnEv0= X-Received: by 2002:adf:ab5c:: with SMTP id r28mr34098877wrc.384.1588096679681; Tue, 28 Apr 2020 10:57:59 -0700 (PDT) MIME-Version: 1.0 References: <20200425193128.25638-1-ardb@kernel.org> In-Reply-To: From: Atish Patra Date: Tue, 28 Apr 2020 10:57:48 -0700 Message-ID: Subject: Re: [GIT PULL] EFI stub loading support for RISC-V To: Ard Biesheuvel , Palmer Dabbelt Content-Type: text/plain; charset="UTF-8" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200428_105801_704398_7A7B4376 X-CRM114-Status: GOOD ( 30.73 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , linux-riscv , linux-efi , Albert Ou , Paul Walmsley Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org On Sun, Apr 26, 2020 at 12:52 PM Atish Patra wrote: > > On Sat, Apr 25, 2020 at 12:31 PM Ard Biesheuvel wrote: > > > > Palmer, > > > > As discussed, below are the changes for v5.8 that can be taken via the > > RISC-V tree to implement booting RISC-V Linux from EFI firmware. > > > > You can fetch and merge the signed tag directly, or merge 22090f84bc3f80 > > and cherry pick the 4 patches on top of it, if you see any need to do so > > (but please use a topic branch in that case) > > > > Please be aware (as is noted in the tag) that these changes are really > > the bare minimum that is needed to launch the kernel from EFI firmware. > > In the current state, you may be able to boot from Uboot in EFI mode, > > but Tianocore based boot will not work at all, unless you convert the > > EFI memory map back to DT memory nodes in the firmware implementation, > > and I can assure you that that is not something that will be accepted in > > upstream Tianocore. > > > > So in summary, this is unfinished work, and I can only recommend merging > > these changes once there is a plan in place to complete the implementation. > > > > I have started looking into this part. My initial plan was to start > looking into it right after I got > the boot time services working but other things took priority. Thanks > for your review and > suggestion throughout the process. I will coordinate with Abner/Daniel > to test RISC-V UEFI > runtime services(once implemented) with tianocore. > > -- > > Ard. > > > > > > The following changes since commit 22090f84bc3f8081e0ec180ccaedc85820085376: > > > > efi/libstub: unify EFI call wrappers for non-x86 (2020-04-23 20:15:06 +0200) > > > > are available in the Git repository at: > > > > git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git tags/riscv-efi-for-v5.8 > > > > for you to fetch changes up to 66b4ac6b9dd1fdbb8ac7a1f20a8d08066368245d: > > > > RISC-V: Add EFI stub support. (2020-04-25 13:59:54 +0200) > > > > ---------------------------------------------------------------- > > EFI stub loading support for RISC-V > > > > This branch implements support for loading the RISC-V Linux kernel > > straight from EFI firmware, by adding PE/COFF metadata to the kernel > > image and incorporating the kernel's EFI stub. > > > > Note that this is the *bare* minimum that is needed to boot from EFI > > firmware. The following pieces are still missing at this point, and > > will be required for full interoperability with generic EFI firmware: > > - using the EFI memory map instead of the device tree to populate the > > memblock tables > > - parsing and handling of generic EFI configuration tables (such as > > SMBIOS), as well as architecture specific ones that may be defined > > for RISC-V > > - runtime mapping of EFI runtime services memory and MMIO regions, and > > support for EFI runtime services (get/set time, get/set variable, reset > > system) > > > > ---------------------------------------------------------------- > > > > Cc: Atish Patra > > Cc: Palmer Dabbelt > > Cc: Paul Walmsley > > Cc: Albert Ou > > Cc: linux-riscv@lists.infradead.org > > > > Atish Patra (4): > > include: pe.h: Add RISC-V related PE definition > > RISC-V: Define fixmap bindings for generic early ioremap support > > RISC-V: Add PE/COFF header for EFI stub > > RISC-V: Add EFI stub support. > > > > arch/riscv/Kconfig | 22 ++++++ > > arch/riscv/Makefile | 1 + > > arch/riscv/configs/defconfig | 1 + > > arch/riscv/include/asm/Kbuild | 1 + > > arch/riscv/include/asm/efi.h | 33 +++++++++ > > arch/riscv/include/asm/fixmap.h | 18 +++++ > > arch/riscv/include/asm/io.h | 1 + > > arch/riscv/include/asm/sections.h | 13 ++++ > > arch/riscv/kernel/Makefile | 4 ++ > > arch/riscv/kernel/efi-header.S | 100 +++++++++++++++++++++++++++ > > arch/riscv/kernel/head.S | 16 +++++ > > arch/riscv/kernel/image-vars.h | 53 +++++++++++++++ > > arch/riscv/kernel/vmlinux.lds.S | 22 +++++- > > drivers/firmware/efi/Kconfig | 3 +- > > drivers/firmware/efi/libstub/Makefile | 10 +++ > > drivers/firmware/efi/libstub/riscv-stub.c | 109 ++++++++++++++++++++++++++++++ > > include/linux/pe.h | 3 + > > 17 files changed, 407 insertions(+), 3 deletions(-) > > create mode 100644 arch/riscv/include/asm/efi.h > > create mode 100644 arch/riscv/include/asm/sections.h > > create mode 100644 arch/riscv/kernel/efi-header.S > > create mode 100644 arch/riscv/kernel/image-vars.h > > create mode 100644 drivers/firmware/efi/libstub/riscv-stub.c > > > > -- > Regards, > Atish Hi Palmer, There were few build errors for all-yes config and nommu reported by 0-day tests. As some of the fixes require to add some dummy declarations for efi runtime related functions, Ard suggested that we should drop the series for now and merge with full uefi support later. -- Regards, Atish