[PATCH v3 6/7] RISC-V: Update image header

2021-10-28 Thread Nikita Ermakov
From: Atish Patra Update the RISC-V Linux kernel image headers as per the current header. Reference: /Documentation/riscv/boot-image-header.rst Signed-off-by: Atish Patra --- include/grub/riscv32/linux.h | 15 --- include/grub/riscv64/linux.h | 15 --- 2 files changed,

[PATCH v3 7/7] RISC-V: Use common linux loader

2021-10-28 Thread Nikita Ermakov
From: Atish Patra RISC-V doesn't have to do anything very different from other architectures to loader EFI stub linux kernel. As a result, just use the common linux loader instead of defining a RISC-V specific linux loader. Signed-off-by: Atish Patra --- grub-core/Makefile.core.def| 4 +--

[PATCH v3 2/7] efi: add definition of LoadFile2 protocol

2021-10-28 Thread Nikita Ermakov
From: Ard Biesheuvel Incorporate the EFI_LOAD_FILE2_PROTOCOL GUID and C types from the UEFI spec. Signed-off-by: Ard Biesheuvel Reviewed-by: Heinrich Schuchardt Signed-off-by: Nikita Ermakov --- grub-core/commands/efi/lsefi.c | 1 + include/grub/efi/api.h | 15 +++ 2

[PATCH v3 4/7] linux: ignore FDT unless we need to modify it

2021-10-28 Thread Nikita Ermakov
From: Ard Biesheuvel Now that we implemented supported for the LoadFile2 protocol for initrd loading, there is no longer a need to pass the initrd parameters via the device tree. This means there is no longer a reason to update the device tree in the first place, and so we can ignore it entirely.

[PATCH v3 1/7] loader: drop argv[] argument in grub_initrd_load()

2021-10-28 Thread Nikita Ermakov
In the case of an error grub_initrd_load() uses argv[] to print the filename that caused the error. It is also possible to obtain the filename from the file handles and there is no need to duplicate that information in argv[], so let's drop it. Signed-off-by: Nikita Ermakov --- grub-core/l

[PATCH v3 5/7] loader: Move arm64 linux loader to common code

2021-10-28 Thread Nikita Ermakov
From: Atish Patra ARM64 linux loader code is written in such a way that it can be reused across different architectures without much change. Move it to common code so that RISC-V doesn't have to define a separate loader. Signed-off-by: Atish Patra --- grub-core/Makefile.core.def |

[PATCH v3 0/7] Add LoadFile2 and riscv Linux loader

2021-10-28 Thread Nikita Ermakov
loader to common code RISC-V: Update image header RISC-V: Use common linux loader Nikita Ermakov (1): loader: drop argv[] argument in grub_initrd_load() grub-core/Makefile.core.def | 8 +- grub-core/commands/efi/lsefi.c| 1 + grub-core/loader/arm/linux.c

[PATCH v3 3/7] efi: implemented LoadFile2 initrd loading protocol for Linux

2021-10-28 Thread Nikita Ermakov
d (based on the PE/COFF image version), and defer loading the initrd contents until the point where the kernel invokes the LoadFile2 protocol. Signed-off-by: Ard Biesheuvel Signed-off-by: Nikita Ermakov --- grub-core/loader/arm64/linux.c | 117 - 1 file changed,

Re: [PATCH v2 0/7] Add LoadFile2 and riscv Linux loader

2021-10-16 Thread Nikita Ermakov
Hi Daniel, all, On Thu, 14 Oct 2021, 21:50 Daniel Kiper, wrote: > On Fri, Oct 08, 2021 at 07:46:17PM +0200, Heinrich Schuchardt wrote: > > On 6/2/21 23:12, Nikita Ermakov wrote: > > > Hello, > > > > > > This is the second version of the patch series. The pat

Re: [PATCH v2 0/7] Add LoadFile2 and riscv Linux loader

2021-08-29 Thread Nikita Ermakov
: > Hi Nikita, > > Nikita Ermakov 于2021年8月28日周六 下午8:22写道: > > > > Hi Atish, Fu, > > > > On Fri, 27 Aug 2021 at 19:29, Fu Wei wrote: > > > > > > Hi Atish, > > > > > > Great thanks for adding me the loop! > > > >

Re: [PATCH v2 0/7] Add LoadFile2 and riscv Linux loader

2021-08-28 Thread Nikita Ermakov
> Atish Patra 于2021年8月28日周六 上午12:22写道: > > > > On Wed, Jun 2, 2021 at 2:13 PM Nikita Ermakov wrote: > > > > > > Hello, > > > > > > This is the second version of the patch series. The patch series is > > > almost the > > > same as

[PATCH v2 3/7] efi: implemented LoadFile2 initrd loading protocol for Linux

2021-06-02 Thread Nikita Ermakov
d (based on the PE/COFF image version), and defer loading the initrd contents until the point where the kernel invokes the LoadFile2 protocol. Signed-off-by: Ard Biesheuvel Signed-off-by: Nikita Ermakov --- grub-core/loader/arm64/linux.c | 117 - 1 file changed,

[PATCH v2 5/7] loader: Move arm64 linux loader to common code

2021-06-02 Thread Nikita Ermakov
From: Atish Patra ARM64 linux loader code is written in such a way that it can be reused across different architectures without much change. Move it to common code so that RISC-V doesn't have to define a separate loader. Signed-off-by: Atish Patra --- grub-core/Makefile.core.def |

[PATCH v2 7/7] RISC-V: Use common linux loader

2021-06-02 Thread Nikita Ermakov
From: Atish Patra RISC-V doesn't have to do anything very different from other architectures to loader EFI stub linux kernel. As a result, just use the common linux loader instead of defining a RISC-V specific linux loader. Signed-off-by: Atish Patra --- grub-core/Makefile.core.def| 4 +--

[PATCH v2 2/7] efi: add definition of LoadFile2 protocol

2021-06-02 Thread Nikita Ermakov
From: Ard Biesheuvel Incorporate the EFI_LOAD_FILE2_PROTOCOL GUID and C types from the UEFI spec. Signed-off-by: Ard Biesheuvel Reviewed-by: Heinrich Schuchardt Signed-off-by: Nikita Ermakov --- grub-core/commands/efi/lsefi.c | 1 + include/grub/efi/api.h | 15 +++ 2

[PATCH v2 4/7] linux: ignore FDT unless we need to modify it

2021-06-02 Thread Nikita Ermakov
From: Ard Biesheuvel Now that we implemented supported for the LoadFile2 protocol for initrd loading, there is no longer a need to pass the initrd parameters via the device tree. This means there is no longer a reason to update the device tree in the first place, and so we can ignore it entirely.

[PATCH v2 6/7] RISC-V: Update image header

2021-06-02 Thread Nikita Ermakov
From: Atish Patra Update the RISC-V Linux kernel image headers as per the current header. Reference: /Documentation/riscv/boot-image-header.rst Signed-off-by: Atish Patra --- include/grub/riscv32/linux.h | 15 --- include/grub/riscv64/linux.h | 15 --- 2 files changed,

[PATCH v2 1/7] loader: drop argv[] argument in grub_initrd_load()

2021-06-02 Thread Nikita Ermakov
In the case of an error grub_initrd_load() uses argv[] to print the filename that caused the error. It is also possible to obtain the filename from the file handles and there is no need to duplicate that information in argv[], so let's drop it. Signed-off-by: Nikita Ermakov --- grub-core/l

[PATCH v2 0/7] Add LoadFile2 and riscv Linux loader

2021-06-02 Thread Nikita Ermakov
ed to modify it Atish Patra (3): loader: Move arm64 linux loader to common code RISC-V: Update image header RISC-V: Use common linux loader Nikita Ermakov (1): loader: drop argv[] argument in grub_initrd_load() grub-core/Makefile.core.def | 8 +- grub-core/commands/efi/ls

[PATCH 6/8] RISC-V: Update image header

2021-05-28 Thread Nikita Ermakov
From: Atish Patra Update the RISC-V Linux kernel image headers as per the current header. Reference: /Documentation/riscv/boot-image-header.rst Signed-off-by: Atish Patra --- include/grub/riscv32/linux.h | 15 --- include/grub/riscv64/linux.h | 15 --- 2 files changed,

[PATCH 4/8] linux: ignore FDT unless we need to modify it

2021-05-28 Thread Nikita Ermakov
From: Ard Biesheuvel Now that we implemented supported for the LoadFile2 protocol for initrd loading, there is no longer a need to pass the initrd parameters via the device tree. This means there is no longer a reason to update the device tree in the first place, and so we can ignore it entirely.

[PATCH 7/8] RISC-V: Use common linux loader

2021-05-28 Thread Nikita Ermakov
From: Atish Patra RISC-V doesn't have to do anything very different from other architectures to loader EFI stub linux kernel. As a result, just use the common linux loader instead of defining a RISC-V specific linux loader. Signed-off-by: Atish Patra --- grub-core/Makefile.core.def| 4 +--

[PATCH 8/8] linux: Make load_file2_guid and device_path_guid static

2021-05-28 Thread Nikita Ermakov
The load_file2_guid and device_path_guid variables must be preserved outside of the function scope. Signed-off-by: Nikita Ermakov --- grub-core/loader/efi/linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c

[PATCH 3/8] efi: implemented LoadFile2 initrd loading protocol for Linux

2021-05-28 Thread Nikita Ermakov
From: Ard Biesheuvel Recent Linux kernels will invoke the LoadFile2 protocol installed on a well-known vendor media path to load the initrd if it is exposed by the firmware. Using this method is preferred for two reasons: - the Linux kernel is in charge of allocating the memory, and so it can i

[PATCH 5/8] loader: Move arm64 linux loader to common code

2021-05-28 Thread Nikita Ermakov
From: Atish Patra ARM64 linux loader code is written in such a way that it can be reused across different architectures without much change. Move it to common code so that RISC-V doesn't have to define a separate loader. Signed-off-by: Atish Patra --- grub-core/Makefile.core.def |

[PATCH 2/8] efi: add definition of LoadFile2 protocol

2021-05-28 Thread Nikita Ermakov
From: Ard Biesheuvel Incorporate the EFI_LOAD_FILE2_PROTOCOL GUID and C types from the UEFI spec. Signed-off-by: Ard Biesheuvel --- grub-core/commands/efi/lsefi.c | 1 + include/grub/efi/api.h | 15 +++ 2 files changed, 16 insertions(+) diff --git a/grub-core/commands/efi

[PATCH 1/8] loader/linux: permit NULL argument for argv[] in grub_initrd_load()

2021-05-28 Thread Nikita Ermakov
From: Ard Biesheuvel grub_initrd_load() takes a char *argv[] argument which is only used when an error occurs, to print the name of the file that caused the error. In order to be able to split initrd loading from handling the initrd command, let's permit argv to be NULL, and fall back to the file

[PATCH 0/8] Add LoadFile2 and riscv Linux loader

2021-05-28 Thread Nikita Ermakov
header RISC-V: Use common linux loader Nikita Ermakov (1): linux: Make load_file2_guid and device_path_guid static grub-core/Makefile.core.def | 8 +- grub-core/commands/efi/lsefi.c | 1 + grub-core/loader/efi/fdt.c | 7 +- grub-core/loader/{arm64

Re: GRUB loader support for RISC-V Linux

2021-05-28 Thread Nikita Ermakov
Hi! On Thu, 27 May 2021 at 18:46, Daniel Kiper wrote: > > Hi Nikita, > > On Wed, May 19, 2021 at 06:26:42PM +0300, Nikita Ermakov wrote: > > Hi! > > > > I'm sorry for such a long delay. > > No worries. We are still busy with the release... > >

Re: GRUB loader support for RISC-V Linux

2021-05-19 Thread Nikita Ermakov
v64.qcow2c [4] http://ftp.altlinux.org/pub/distributions/ALTLinux/ports/riscv64/Sisyphus/noarch/RPMS.classic/opensbi-firmware-generic-0.9-alt1.noarch.rpm On Sat, 10 Apr 2021 at 11:18, Nikita Ermakov wrote: > > Hei, > > On Thu, 8 Apr 2021 at 18:26, Daniel Kiper wrote: > > > > Hey, >

Re: GRUB loader support for RISC-V Linux

2021-04-10 Thread Nikita Ermakov
Hei, On Thu, 8 Apr 2021 at 18:26, Daniel Kiper wrote: > > Hey, > > On Wed, Apr 07, 2021 at 06:48:54PM +0300, Nikita Ermakov wrote: > > Hi Atish, > > > > Thank you for the answer. > > > > On Sun, 4 Apr 2021 at 18:42, Atish Patra wrote: > > > Hi

Re: GRUB loader support for RISC-V Linux

2021-04-07 Thread Nikita Ermakov
Hi Atish, Thank you for the answer. On Sun, 4 Apr 2021 at 18:42, Atish Patra wrote: > > Hi Nikita, > Yes. It was discussed earlier that we should consolidate riscv & ARM64 > implementation as the ARM64 has a very generic implementation. RISC-V should > also use LOAD_FILE2 always. > > However,

Re: GRUB loader support for RISC-V Linux

2021-04-04 Thread Nikita Ermakov
Hello! On Fri, 2 Apr 2021 at 18:06, Heinrich Schuchardt wrote: > > I have seen these alternative patch series implementing launching Linux > via the RISC-V EFI stub. > > Nikita Ermakov, 2021/03/24 > [PATCH 0/2] Linux loader for riscv64 > https://lists.gnu.org/archive/ht

Re: [PATCH 0/2] Linux loader for riscv64

2021-03-26 Thread Nikita Ermakov
Hi Daniel, On Fri, 26 Mar 2021 at 20:07, Daniel Kiper wrote: > > Hi Nikita, > > On Wed, Mar 24, 2021 at 05:50:26PM +0300, Nikita Ermakov wrote: > > Hello. > > > > In this patch series I would like to add a possibility to load Linux kernel > > with a EFI stu

[PATCH 2/2] RISC-V: Allow to boot Linux with EFI stub on riscv64

2021-03-24 Thread Nikita Ermakov
- Split a riscv loader to the riscv32 and riscv64 loaders. - Add loader to boot Linux with EFI stub on riscv64. It is based on the grub-core/loader/arm64/linux.c Signed-off-by: Nikita Ermakov --- grub-core/Makefile.core.def | 4 +- grub-core/loader/{riscv => risc

[PATCH 0/2] Linux loader for riscv64

2021-03-24 Thread Nikita Ermakov
l.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=474efecb65dceb15f793b6e2f2b226e952f0f8e9 Nikita Ermakov (2): RISC-V: Update magic number RISC-V: Allow to boot Linux with EFI stub on riscv64 grub-core/Makefile.core.def | 4 +- grub-core/loader/{riscv => risc

[PATCH 1/2] RISC-V: Update magic number

2021-03-24 Thread Nikita Ermakov
The image header for riscv in the kernel was modified to improve compatibility with the ARM64 header. Signed-off-by: Nikita Ermakov --- include/grub/riscv32/linux.h | 4 ++-- include/grub/riscv64/linux.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/grub