[PATCH 1/2] fdt: move prop_entry_size to fdt.h

2018-06-11 Thread Leif Lindholm
To be able to resuse the prop_entry_size macro, move it to and rename it grub_fdt_prop_entry_size. Signed-off-by: Leif Lindholm --- grub-core/lib/fdt.c | 25 ++--- include/grub/fdt.h | 5 + 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/grub-core/lib

[PATCH 0/2] efi/fdt: set #address-cells/#size-cells on empty tree

2018-06-11 Thread Leif Lindholm
the required name change). Second part is adding the two properties to the empty tree. Leif Lindholm (2): fdt: move prop_entry_size to fdt.h efi/fdt: set address/size cells to 2 for empty tree grub-core/lib/fdt.c| 25 ++--- grub-core/loader/efi/fdt.c | 18

[PATCH 2/2] efi/fdt: set address/size cells to 2 for empty tree

2018-06-11 Thread Leif Lindholm
hange corresponds with linux kernel commit ae8a442dfdc4 ("efi/libstub/arm*: Set default address and size cells values for an empty dtb") and ensures booting through grub does not behave differently from booting the stub loader directly. See also https://patchwork.kernel.org/patch/9561201/ Sign

Re: [PATCH 0/2] efi/fdt: set #address-cells/#size-cells on empty tree

2018-06-14 Thread Leif Lindholm
On Thu, Jun 14, 2018 at 03:38:13PM +0200, Daniel Kiper wrote: > On Mon, Jun 11, 2018 at 05:24:57PM +0100, Leif Lindholm wrote: > > Set #address-cells and #size-cells properties (to 2) for ARM*/UEFI > > systems when creating an empty DT at boot time. This resolves an issue > >

[PATCH 2/2] commands/file: use definitions from arm64/linux.h

2018-06-25 Thread Leif Lindholm
Clean up code for matching IS_ARM64 slightly by making use of struct linux_arm_kernel_header and GRUB_LINUX_ARM64_MAGIC_SIGNATURE. Signed-off-by: Leif Lindholm --- grub-core/commands/file.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/grub-core/commands/file.c

[PATCH 0/2] use arm*/linux.h for file command

2018-06-25 Thread Leif Lindholm
We now have pretty, architecture-safe, structs and macros for kernel image headers and magic values. Use this to get rid of some hardcoding in the "file" command. Leif Lindholm (2): commands/file: use definitions from arm/linux.h commands/file: use definitions from arm64/linux.h

[PATCH 1/2] commands/file: use definitions from arm/linux.h

2018-06-25 Thread Leif Lindholm
Clean up code for matching IS_ARM slightly by making use of struct linux_arm_kernel_header and GRUB_LINUX_ARM_MAGIC_SIGNATURE. Signed-off-by: Leif Lindholm --- grub-core/commands/file.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/grub-core/commands

[PATCH v3 0/6] efi: arm linux loader unification and correctness

2018-06-27 Thread Leif Lindholm
parate set), and the follow-on changes this required for the unified apis. Leif Lindholm (6): efi: add central copy of grub_efi_find_mmap_size efi: add grub_efi_get_ram_base() function for arm64 arm64 linux loader: rename functions and macros and move to common headers arm/efi: switch to a

[PATCH v3 5/6] arm: delete unused efi support from loader/arm

2018-06-27 Thread Leif Lindholm
The 32-bit arm efi port now shares the 64-bit linux loader, so delete the now unused bits from the 32-bit linux loader. This in turn leaves the grub-core/kern/arm/efi/misc.c unused, so delete that too. Signed-off-by: Leif Lindholm --- grub-core/Makefile.am | 1 - grub-core/kern/arm

[PATCH v3 4/6] arm/efi: switch to arm64 linux loader

2018-06-27 Thread Leif Lindholm
Switch over to the EFI-stub aware arm64 loader for 32-bit ARM platforms. This *WILL* stop non-efistub Linux kernels from booting on arm-efi. Signed-off-by: Leif Lindholm --- grub-core/Makefile.core.def | 7 --- grub-core/kern/efi/mm.c | 2 +- include/grub/arm/linux.h| 5

[PATCH v3 2/6] efi: add grub_efi_get_ram_base() function for arm64

2018-06-27 Thread Leif Lindholm
runtime. Signed-off-by: Leif Lindholm --- grub-core/kern/efi/mm.c | 36 include/grub/efi/efi.h | 3 +++ 2 files changed, 39 insertions(+) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c index fd39d23b4..10ffa2c9b 100644 --- a/grub-core/kern/efi

[PATCH v3 1/6] efi: add central copy of grub_efi_find_mmap_size

2018-06-27 Thread Leif Lindholm
There are several implementations of this function in the tree. Add a central version in grub-core/efi/mm.c. Signed-off-by: Leif Lindholm --- grub-core/kern/efi/mm.c | 20 include/grub/efi/efi.h | 1 + 2 files changed, 21 insertions(+) diff --git a/grub-core/kern/efi

[PATCH v3 6/6] efi: restrict arm/arm64 linux loader initrd placement

2018-06-27 Thread Leif Lindholm
. Signed-off-by: Leif Lindholm --- grub-core/loader/arm64/linux.c | 39 ++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c index 577fbda54..0d550182f 100644 --- a/grub-core/loader/arm64

[PATCH v3 3/6] arm64 linux loader: rename functions and macros and move to common headers

2018-06-27 Thread Leif Lindholm
In preparation for using the linux loader for 32-bit and 64-bit platforms, rename grub_arm64*/GRUB_ARM64* to grub_efi*/GRUB_EFI*. Move prototypes for now-common functions to efi/efi.h. Signed-off-by: Leif Lindholm --- grub-core/loader/arm64/linux.c| 14 +++--- grub-core/loader

Re: [PATCH v3 1/6] efi: add central copy of grub_efi_find_mmap_size

2018-07-06 Thread Leif Lindholm
On Fri, Jul 06, 2018 at 05:00:45PM +0200, Daniel Kiper wrote: > On Wed, Jun 27, 2018 at 06:17:15PM +0100, Leif Lindholm wrote: > > There are several implementations of this function in the tree. > > Add a central version in grub-core/efi/mm.c. > > I am happy with the code its

Re: [PATCH v3 2/6] efi: add grub_efi_get_ram_base() function for arm64

2018-07-06 Thread Leif Lindholm
On Fri, Jul 06, 2018 at 05:12:27PM +0200, Daniel Kiper wrote: > On Wed, Jun 27, 2018 at 06:17:16PM +0100, Leif Lindholm wrote: > > Since ARM platforms do not have a common memory map, add a helper > > function that finds the lowest address region with the EFI_MEMORY_WB > >

Re: [PATCH v3 3/6] arm64 linux loader: rename functions and macros and move to common headers

2018-07-06 Thread Leif Lindholm
On Fri, Jul 06, 2018 at 05:28:17PM +0200, Daniel Kiper wrote: > On Wed, Jun 27, 2018 at 06:17:17PM +0100, Leif Lindholm wrote: > > In preparation for using the linux loader for 32-bit and 64-bit platforms, > > rename grub_arm64*/GRUB_ARM64* to grub_efi*/GRUB_EFI*. > > > &

Re: [PATCH v3 4/6] arm/efi: switch to arm64 linux loader

2018-07-06 Thread Leif Lindholm
On Fri, Jul 06, 2018 at 05:48:21PM +0200, Daniel Kiper wrote: > On Wed, Jun 27, 2018 at 06:17:18PM +0100, Leif Lindholm wrote: > > Switch over to the EFI-stub aware arm64 loader for 32-bit ARM platforms. > > Hmmm... Does it mean that ARM64 EFI stub can work on 32-bit ARM plat

Re: [PATCH v3 6/6] efi: restrict arm/arm64 linux loader initrd placement

2018-07-06 Thread Leif Lindholm
On Fri, Jul 06, 2018 at 06:00:11PM +0200, Daniel Kiper wrote: > On Wed, Jun 27, 2018 at 06:17:20PM +0100, Leif Lindholm wrote: > > The 32-bit arm Linux kernel is built as a zImage, which self-decompresses > > down to near start of RAM. In order for an initrd/initramfs to be >

Re: [PATCH v3 1/6] efi: add central copy of grub_efi_find_mmap_size

2018-07-06 Thread Leif Lindholm
On Fri, Jul 06, 2018 at 06:55:51PM +0200, Daniel Kiper wrote: > On Fri, Jul 06, 2018 at 05:21:17PM +0100, Leif Lindholm wrote: > > On Fri, Jul 06, 2018 at 05:00:45PM +0200, Daniel Kiper wrote: > > > On Wed, Jun 27, 2018 at 06:17:15PM +0100, Leif Lindholm wrote: > &g

[PATCH v4 0/6] efi: arm linux loader unification and correctness

2018-07-09 Thread Leif Lindholm
itted as a separate set), and the follow-on changes this required for the unified apis. Leif Lindholm (6): efi: add central copy of grub_efi_find_mmap_size efi: add grub_efi_get_ram_base() function for arm64 arm64 linux loader: rename functions and macros and move to common headers arm/efi:

[PATCH v4 4/6] arm/efi: switch to arm64 linux loader

2018-07-09 Thread Leif Lindholm
Linux kernels from booting on arm-efi. Signed-off-by: Leif Lindholm --- grub-core/Makefile.core.def | 7 --- grub-core/kern/efi/mm.c | 2 +- include/grub/arm/linux.h| 5 + include/grub/efi/efi.h | 2 -- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/grub-core

[PATCH v4 3/6] arm64 linux loader: rename functions and macros and move to common headers

2018-07-09 Thread Leif Lindholm
In preparation for using the linux loader for 32-bit and 64-bit platforms, rename grub_arm64*/GRUB_ARM64* to grub_armxx*/GRUB_ARMXX*. Move prototypes for now-common functions to efi/efi.h. Signed-off-by: Leif Lindholm --- grub-core/loader/arm64/linux.c| 14 +++--- grub-core/loader

[PATCH v4 1/6] efi: add central copy of grub_efi_find_mmap_size

2018-07-09 Thread Leif Lindholm
There are several implementations of this function in the tree. Add a central version in grub-core/efi/mm.c. Signed-off-by: Leif Lindholm --- grub-core/kern/efi/mm.c | 20 include/grub/efi/efi.h | 1 + 2 files changed, 21 insertions(+) diff --git a/grub-core/kern/efi

[PATCH v4 6/6] efi: restrict arm/arm64 linux loader initrd placement

2018-07-09 Thread Leif Lindholm
. Signed-off-by: Leif Lindholm --- grub-core/loader/arm64/linux.c | 39 ++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c index f90c5f926..1f86229f8 100644 --- a/grub-core/loader/arm64

[PATCH v4 5/6] arm: delete unused efi support from loader/arm

2018-07-09 Thread Leif Lindholm
The 32-bit arm efi port now shares the 64-bit linux loader, so delete the now unused bits from the 32-bit linux loader. This in turn leaves the grub-core/kern/arm/efi/misc.c unused, so delete that too. Signed-off-by: Leif Lindholm --- grub-core/Makefile.am | 1 - grub-core/kern/arm

[PATCH v4 2/6] efi: add grub_efi_get_ram_base() function for arm64

2018-07-09 Thread Leif Lindholm
runtime. Signed-off-by: Leif Lindholm --- grub-core/kern/efi/mm.c | 31 +++ include/grub/efi/efi.h | 3 +++ 2 files changed, 34 insertions(+) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c index fd39d23b4..b7cf144e5 100644 --- a/grub-core/kern/efi/mm.c

[RFC PATCH] i386: don't include lib/i386/reset.c in EFI builds

2018-07-09 Thread Leif Lindholm
each i386 platform variant in Makefile.core.def, include the contents of lib/i386/reset.c only when GRUB_MACHINE_EFI is not set. Signed-off-by: Leif Lindholm --- grub-core/lib/i386/reboot.c | 4 1 file changed, 4 insertions(+) diff --git a/grub-core/lib/i386/reboot.c b/grub-core/lib/i38

Re: [RFC PATCH] i386: don't include lib/i386/reset.c in EFI builds

2018-07-11 Thread Leif Lindholm
On Wed, Jul 11, 2018 at 01:03:12PM +0200, Daniel Kiper wrote: > On Mon, Jul 09, 2018 at 07:49:06PM +0100, Leif Lindholm wrote: > > Commit 0ba90a7f0178 ("efi: Move grub_reboot() into kernel") broke > > the build on i386-efi - genmoddep.awk bails out with message >

Re: [RFC PATCH] i386: don't include lib/i386/reset.c in EFI builds

2018-07-12 Thread Leif Lindholm
On Thu, Jul 12, 2018 at 01:44:36PM +0200, Daniel Kiper wrote: > On Wed, Jul 11, 2018 at 12:53:01PM +0100, Leif Lindholm wrote: > > On Wed, Jul 11, 2018 at 01:03:12PM +0200, Daniel Kiper wrote: > > > On Mon, Jul 09, 2018 at 07:49:06PM +0100, Leif Lindholm wrote: > > >

Re: [RFC PATCH] i386: don't include lib/i386/reset.c in EFI builds

2018-07-13 Thread Leif Lindholm
On Fri, Jul 13, 2018 at 01:27:08PM +0200, Daniel Kiper wrote: > > > > (i386_)ieee1275 implements its own grub_reboot(), so that should be > > > > fine. (This does mean that i386_ieee1275 may currently be unable to > > > > load the reboot module on master.) > > > > > > Hmmm... So, it looks that your

Re: [RFC PATCH] i386: don't include lib/i386/reset.c in EFI builds

2018-07-13 Thread Leif Lindholm
On Fri, Jul 13, 2018 at 03:59:38PM +0200, Daniel Kiper wrote: > On Fri, Jul 13, 2018 at 01:53:52PM +0100, Leif Lindholm wrote: > > On Fri, Jul 13, 2018 at 01:27:08PM +0200, Daniel Kiper wrote: > > > > > > (i386_)ieee1275 implements its own grub_reboot(), so that should

[PATCH 1/3] loader/i386/linux: use central copy of grub_efi_find_mmap_size

2018-07-13 Thread Leif Lindholm
Delete local copy of function to determine required buffer size for the UEFI memory map, use helper in kern/efi/mm.c. Signed-off-by: Leif Lindholm --- grub-core/loader/i386/linux.c | 51 +-- 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a

[PATCH 3/3] loader/multiboot_mbi2: use central copy of grub_efi_find_mmap_size

2018-07-13 Thread Leif Lindholm
Delete local copy of function to determine required buffer size for the UEFI memory map, use helper in kern/efi/mm.c. Signed-off-by: Leif Lindholm --- grub-core/loader/multiboot_mbi2.c | 38 +- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a

[PATCH 0/3] use central copy of grub_efi_find_mmap_size

2018-07-13 Thread Leif Lindholm
ested. Leif Lindholm (3): loader/i386/linux: use central copy of grub_efi_find_mmap_size loader/ia64/linux: use central copy of grub_efi_find_mmap_size loader/multiboot_mbi2: use central copy of grub_efi_find_mmap_size grub-core/loader/i386/linux.c

[PATCH 2/3] loader/ia64/linux: use central copy of grub_efi_find_mmap_size

2018-07-13 Thread Leif Lindholm
Delete local copy of function to determine required buffer size for the UEFI memory map, use helper in kern/efi/mm.c. Signed-off-by: Leif Lindholm --- grub-core/loader/ia64/efi/linux.c | 46 ++- 1 file changed, 2 insertions(+), 44 deletions(-) diff --git a

Re: [RFC][PATCH 2/2] arm: grub-install: Default to arm-efi target in EFI-based QEMU virt models

2018-09-20 Thread Leif Lindholm
On Tue, Aug 28, 2018 at 01:33:48PM -0600, dann frazier wrote: > From: dann frazier > > We currently default to the arm-uboot target in grub-install, > but arm-efi should be used for some systems with UEFI firmware, such as > Tianocore/EDK2-based QEMU models. We could change the default to arm-efi

Re: [PATCH 1/9] efi: Rename armxx to arch

2018-11-07 Thread Leif Lindholm
ly. > > Signed-off-by: Alexander Graf Certainly no objection to this. Only comment: if this is the way to go, perhaps linux.c should move to loader/efi/linux-generic.c or something? Anyway - Acked-by: Leif Lindholm > --- > grub-core/loader/arm64/linux.c| 10 +- > gru

Re: [PATCH 2/9] PE: Add RISC-V definitions

2018-11-07 Thread Leif Lindholm
ion of https://docs.microsoft.com/en-gb/windows/desktop/Debug/pe-format Reviewed-by: Leif Lindholm > --- > include/grub/efi/pe32.h | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h > index 7d44732d2..d1359eb66 100644 &

[PATCH 3/5] loader/efi/fdt.c: fixup grub_file_open call

2018-11-14 Thread Leif Lindholm
The verifiers framework changed the api of grub_file_open, but did not fix up all users. Add the file type GRUB_FILE_TYPE_DEVICE_TREE_IMAGE to the "devicetree" command handler call. Signed-off-by: Leif Lindholm --- grub-core/loader/efi/fdt.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH 1/5] grub/verify.h: add include guard

2018-11-14 Thread Leif Lindholm
verify.h was added without include guards. This means compiling anything including both grub/verify.h and grub/lib/cmdline.h fails (at least loader/arm64/linux.c. Add the necessary include guard. Signed-off-by: Leif Lindholm --- include/grub/verify.h | 5 + 1 file changed, 5 insertions

[PATCH 2/5] file.h: add device tree file type

2018-11-14 Thread Leif Lindholm
The api change of grub_file_open for adding verifiers did not include a type for device tree blobs. Add GRUB_FILE_TYPE_DEVICE_TREE_IMAGE to the grub_file_type enum. Signed-off-by: Leif Lindholm --- include/grub/file.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/grub/file.h b

[PATCH 0/5] Fix non-x86 builds after verifiers framework merged

2018-11-14 Thread Leif Lindholm
common and arm64 fixes have actually been tested. Fu Wei, Julien - can you guys have a look at fixing arm64/xen_boot.c? I'm not 100% certain how multiboot should be handled. Cc: Fu Wei Cc: Julien Grall Reported-by: Alexander Graf Leif Lindholm (5): grub/verify.h: add include guard f

[PATCH 4/5] arm64/efi: fix breakage caused by verifiers

2018-11-14 Thread Leif Lindholm
- add variable "err" (used but not defined) - add GRUB_FILE_TYPE_LINUX_KERNEL to grub_file_open call Signed-off-by: Leif Lindholm --- grub-core/loader/arm64/linux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/lo

[PATCH 5/5] arm-uboot, ia64, sparc64: fix up grub_file_open calls

2018-11-14 Thread Leif Lindholm
The verifiers framework changed the grub_file_open interface, breaking all non-x86 linux loaders. Add file types to the grub_file_open calls to make them build again. Signed-off-by: Leif Lindholm --- Bundling these changes together in a single patch, since I haven't actually tested

Re: [PATCH 0/5] Fix non-x86 builds after verifiers framework merged

2018-11-16 Thread Leif Lindholm
On Fri, Nov 16, 2018 at 03:05:22PM +0100, Daniel Kiper wrote: > On Wed, Nov 14, 2018 at 07:29:14PM +0000, Leif Lindholm wrote: > > The verifiers framework caused some breakage for non-x86 > > platforms that need fixing. > > > > Basically, this boils down to: > > -

Re: [PATCH v3 10/10] fdt: Add device tree file type

2018-11-19 Thread Leif Lindholm
On Mon, Nov 19, 2018 at 11:11:09AM +0100, Andreas Schwab wrote: > On Nov 14 2018, Alexander Graf wrote: > > > diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c > > index a4c6e8036..d8ebe648e 100644 > > --- a/grub-core/loader/efi/fdt.c > > +++ b/grub-core/loader/efi/fdt.c > > @@

Re: [PATCH v4 10/10] fdt: Treat device tree file type like ACPI

2018-11-26 Thread Leif Lindholm
se their threat level is the same. > > Signed-off-by: Alexander Graf Acked-by: Leif Lindholm > > --- > > v3 -> v4: > > - Rebase onto current git master > --- > grub-core/commands/efi/shim_lock.c | 1 + > include/grub/file.h| 4 ++

Re: [PATCH 0/2] arm64: Support HP Envy X2

2018-11-29 Thread Leif Lindholm
Hi Alex, On Wed, Nov 28, 2018 at 03:31:05PM +0100, Alexander Graf wrote: > I got a new toy this week: An HP Envy X2 system. This is one of those shiny > new Qualcomm Snapdragon based Windows tablet/notebook hybrid things. > > While running Windows on those is actually not a terribly bad experienc

Re: [PATCH 0/2] arm64: Support HP Envy X2

2018-12-11 Thread Leif Lindholm
On Wed, Nov 28, 2018 at 03:31:05PM +0100, Alexander Graf wrote: > I got a new toy this week: An HP Envy X2 system. This is one of those shiny > new Qualcomm Snapdragon based Windows tablet/notebook hybrid things. > > While running Windows on those is actually not a terribly bad experience now > th

Re: [PATCH 1/1] grub-core/loader/efi/fdt.c: do not copy random memory

2018-12-17 Thread Leif Lindholm
, yes. Reviewed-by: Leif Lindholm > --- > grub-core/loader/efi/fdt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c > index a18ca8ccb..ee9c5592c 100644 > --- a/grub-core/loader/efi/fdt.

Re: [PATCH v2 0/2] arm64: Support HP Envy X2

2019-01-07 Thread Leif Lindholm
ust bumps the > header alignment to 4K always on arm64-efi. This way we improve overall > compatibility - there surely will be more devices coming with similar > constraints. > > v1 -> v2: > > - Remove explicit device wording from patch > - Use GRUB_EFI_PAGE

Re: Discuss support for the linux kernel's EFI Handover Protocol on x86 and ARM

2019-01-11 Thread Leif Lindholm
On Thu, Jan 10, 2019 at 09:59:38AM +0100, Alexander Graf wrote: > > Am 10.01.2019 um 09:12 schrieb Michael Chang : > > > > Hi, > > > > With the advent of new verifier framework and shim lock protocol support > > to the grub's community, we are driving to the world of UEFI Secure > > Boot, well, a

Re: [PATCH v2 2/2] mkimage: arm64-efi: Align first section to page

2019-01-14 Thread Leif Lindholm
On Mon, Jan 14, 2019 at 02:41:30PM +0100, Alexander Graf wrote: > On 01/14/2019 02:37 PM, Daniel Kiper wrote: > > On Sun, Dec 23, 2018 at 03:52:07AM +0100, Alexander Graf wrote: > > > In order to enforce NX semantics on non-code pages, UEFI firmware > > > may require that all code is EFI_PAGE_SIZE

Re: [PATCH v4 06/10] RISC-V: Add Linux load logic

2019-01-17 Thread Leif Lindholm
On Thu, Jan 17, 2019 at 01:24:29PM +0100, Daniel Kiper wrote: > > +static grub_err_t > > +finalize_params_linux (void) > > +{ > > + int node, retval; > > + > > Please drop this empty line. > > > + void *fdt; > > + > > + fdt = grub_fdt_load (0x400); > > Why this number? Please define constant

[PATCH] linux, efi, arm*, fdt: break FDT extra allocation space out into a #define

2019-01-22 Thread Leif Lindholm
A certain amount of dynamic space is required for the handover from GRUB/Linux-EFI-stub. This entails things like initrd addresses, address-cells entries and associated strings. But move this into a proper centralised #define rather than live-code it in the loader. Signed-off-by: Leif Lindholm

Re: [PATCH v4 06/10] RISC-V: Add Linux load logic

2019-01-23 Thread Leif Lindholm
On Tue, Jan 22, 2019 at 05:09:18PM +0100, Alexander Graf wrote: > On 17.01.19 13:24, Daniel Kiper wrote: > > On Mon, Nov 26, 2018 at 12:38:11AM +0100, Alexander Graf wrote: > >> We currently only support to run grub on RISC-V as UEFI payload. Ideally, > >> we also only want to support running Linux

Re: [PATCH v4 06/10] RISC-V: Add Linux load logic

2019-01-23 Thread Leif Lindholm
On Wed, Jan 23, 2019 at 05:53:00PM +0100, Daniel Kiper wrote: > On Wed, Jan 23, 2019 at 11:47:25AM +0000, Leif Lindholm wrote: > > On Tue, Jan 22, 2019 at 05:09:18PM +0100, Alexander Graf wrote: > > > On 17.01.19 13:24, Daniel Kiper wrote: > > > > On Mon, No

Re: [PATCH] arm: Move initrd upper to leave more space for kernel

2019-02-01 Thread Leif Lindholm
On Fri, Feb 01, 2019 at 11:46:14AM +0100, Daniel Kiper wrote: > > diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h > > index 712ba17b9..d0b24d474 100644 > > --- a/include/grub/arm/linux.h > > +++ b/include/grub/arm/linux.h > > @@ -42,7 +42,7 @@ struct linux_arm_kernel_header { > >

[PATCH] arm64/efi: fix grub_efi_get_ram_base()

2019-02-21 Thread Leif Lindholm
l value to GRUB_EFI_MAX_USABLE_ADDRESS, as originally intended. Reported-by: Steve McIntyre <93...@debian.org> Signed-off-by: Leif Lindholm --- grub-core/kern/efi/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c

Re: [PATCH] grub-install: check for arm-efi as a default target

2019-02-21 Thread Leif Lindholm
Hi Steve, On Mon, Feb 11, 2019 at 02:42:34AM +, Steve McIntyre wrote: > Much like on x86, we can work out if the system is running on top of > EFI firmware. If so, return "arm-efi". If not, fall back to > "arm-uboot" as previously. Right, this clearly needs a fix. > Heavily inspired by the e

Re: [PATCH] grub-install: check for arm-efi as a default target

2019-02-21 Thread Leif Lindholm
On Thu, Feb 21, 2019 at 02:53:48PM +, Steve McIntyre wrote: > >> Right, this clearly needs a fix. > >> > >> > Heavily inspired by the existing code for x86. > >> > >> Mmm. I would much prefer if we could break out the efi test in a > >> separate helper function. And clean it up while we're at i

Re: [PATCH] grub-install: check for arm-efi as a default target

2019-02-21 Thread Leif Lindholm
oad the efivar module and check for > /sys/firmware/efi into a common helper routine is_efi_system() > > Signed-off-by: Steve McIntyre <93...@debian.org> LGTM: Reviewed-by: Leif Lindholm > --- > grub-core/osdep/basic/platfor

Re: [PATCH] grub-install: check for arm-efi as a default target

2019-02-26 Thread Leif Lindholm
On Thu, Feb 21, 2019 at 04:31:32PM +0100, Daniel Kiper wrote: > On Thu, Feb 21, 2019 at 03:04:26PM +0000, Leif Lindholm wrote: > > On Thu, Feb 21, 2019 at 02:46:11PM +, Steve McIntyre wrote: > > > Much like on x86, we can work out if the system is running on top of > &g

Re: [RFC] arm64/linux/loader: Use EFI CODE allocations for the linux kernel

2019-04-04 Thread Leif Lindholm
to release. This complements f826330683675f0deb55b58fd229afd7d65fb053 ("efi: change heap allocation type to GRUB_EFI_LOADER_CODE"), so I'm all for it. Reviewed-by: Leif Lindholm This does bring to mind the clunkiness of the above. Marking *everything* executable bypasses the improved se

Re: [RFC] arm64/linux/loader: Use EFI CODE allocations for the linux kernel

2019-04-08 Thread Leif Lindholm
On Mon, Apr 08, 2019 at 12:19:05PM +0300, Alexander Graf wrote: > On 05.04.19 06:06, Leif Lindholm wrote: > > This does bring to mind the clunkiness of the above. Marking > > *everything* executable bypasses the improved security provided by the > > firmware. Should I register

Re: [PATCH] arm: Move trampolines into code section

2019-04-29 Thread Leif Lindholm
xt section instead. That way everyone knows they are executable. > > Fixes: a51f953f4ee87 ("mkimage: Align efi sections on 4k boundary") > Reported-by: Julien ROBIN > Reported-by: Leif Lindholm > > Signed-off-by: Alexander Graf I can confirm that in combination

Re: [PATCH] arm: Move trampolines into code section

2019-04-30 Thread Leif Lindholm
nes into the > .text section instead. That way everyone knows they are executable. > > Fixes: a51f953f4ee87 ("mkimage: Align efi sections on 4k boundary") > Reported-by: Julien ROBIN > Reported-by: Leif Lindholm > > Signed-off-by: Alexander Graf Right, so

Re: [PATCH] arm: Move trampolines into code section

2019-04-30 Thread Leif Lindholm
On Tue, Apr 30, 2019 at 03:06:35PM +0200, Alexander Graf wrote: > > Right, so with a brain that's actually awake: > > > >> --- > >> util/grub-mkimagexx.c | 29 + > >> 1 file changed, 13 insertions(+), 16 deletions(-) > >> > >> diff --git a/util/grub-mkimagexx.c b/util/g

Re: [PATCH v2 0/2] Fix fallout from 4k section alignment patch

2019-05-01 Thread Leif Lindholm
red because of the change > > 2) A missing adjustment in the original patch > > This patch set fixes both issues, making 32bit ARM targets for UEFI > fully functional again for me. This looks good to me. Reviewed-by: Leif Lindholm Tested-by: Leif Lindholm Thanks! >

Re: [PATCH v2 6/8] travis: Add smoke tests for arm and aarch64

2019-05-14 Thread Leif Lindholm
Just noticed this hadn't been merged, so time for a comment :) On Thu, May 02, 2019 at 08:55:35AM +0200, Alexander Graf wrote: > We've had an arm regression in grub recently where grub would not even > be able to boot up anymore. So let's include arm and aarch64 in our > simple "hello world" smoke

Re: [PATCH v2 7/8] travis: Add ARM thumb target to tests

2019-05-14 Thread Leif Lindholm
Comment here as well: On Thu, May 02, 2019 at 08:55:36AM +0200, Alexander Graf wrote: > We hit an error case which only got triggered on ARM Thumb code. So > let's make sure we test that combination as well. This is the default for at least several and possibly most ARMv7-A distributions/prebuilt

Re: [PATCH v2 7/8] travis: Add ARM thumb target to tests

2019-05-14 Thread Leif Lindholm
On Tue, May 14, 2019 at 06:32:06AM -0700, Alexander Graf wrote: > > But, wait... > > arm-linux-gnueabi is the softfloat (v5te) toolchain - if we want to > > test that, fine - but we definitely need to test arm-linux-gnueabihf. > > > > First of all, I would expect that this toolchain will not use T3

Re: [PATCH] 10_linux: Add devicetree command, if a dtb is present.

2019-05-28 Thread Leif Lindholm
On Tue, May 28, 2019 at 11:27:08AM +0200, Daniel Kiper wrote: > On Thu, May 23, 2019 at 10:31:13PM +0100, Dimitri John Ledkov wrote: > > Specifically support dtb paths as created by flash-kernel package on > > Debian/Ubuntu systems, and a generic one. Possibly this needs to be > > extended to suppo

Re: [PATCH v2 7/8] travis: Add ARM thumb target to tests

2019-05-29 Thread Leif Lindholm
On Wed, May 29, 2019 at 05:41:07PM +0200, Alexander Graf wrote: > On 14.05.19 16:06, Leif Lindholm wrote: > > On Tue, May 14, 2019 at 06:32:06AM -0700, Alexander Graf wrote: > >>> But, wait... > >>> arm-linux-gnueabi is the softfloat (v5te) toolchain - if we want

Re: FreeBSD port work

2019-06-03 Thread Leif Lindholm
Hi Eric, On Fri, May 31, 2019 at 07:22:26AM -0400, Eric McCorkle wrote: > I've been doing some work to refurbish the FreeBSD port, and I may take > over maintaining it. I also want to modify GRUB to pass GELI keys into > the kernel using the newer keybuf mechanism, but that's later (I posted > ab

[PATCH] configure: disable arm movw/movt relocations for GCC

2019-06-04 Thread Leif Lindholm
tions' flag used by GCC. Reported-by: Alexander Graf Signed-off-by: Leif Lindholm --- Note: unless this is added before the travis-ci set, the arm ci build will fail when enabled. --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/co

Re: [PATCH v3 06/10] travis: Add smoke tests for arm and aarch64

2019-06-04 Thread Leif Lindholm
On Tue, Jun 04, 2019 at 12:27:30PM +0200, Alexander Graf wrote: > We've had an arm regression in grub recently where grub would not even > be able to boot up anymore. So let's include arm and aarch64 in our > simple "hello world" smoke tests as well. > > For OVMF on ARM to work, we need a newer ve

Re: [PATCH v3 10/10] travis: Disable IA64 target

2019-06-04 Thread Leif Lindholm
On Tue, Jun 04, 2019 at 12:27:34PM +0200, Alexander Graf wrote: > The IA64 target currently does not compile due to the following error > message: > > grub-mkimage: error: undefined symbol grub_arch_sync_dma_caches. > > If anyone cares enough about IA64 to fix it up, be my guest and revert > thi

Re: [PATCH v3 10/10] travis: Disable IA64 target

2019-06-04 Thread Leif Lindholm
On Tue, Jun 04, 2019 at 03:37:39PM +0200, John Paul Adrian Glaubitz wrote: > On 6/4/19 3:34 PM, Leif Lindholm wrote: > > I am reasonably convinced this was simply neglected when d8901e3ba1 > > ("cache: Fix compilation for ppc, sparc and arm64") was pushed. > > (An

Re: [PATCH v3 09/10] travis: Disable MIPS target

2019-06-04 Thread Leif Lindholm
s actually make sense But until someone steps up to clean up and look after mips, from my point of view: Reviewed-by: Leif Lindholm > Signed-off-by: Alexander Graf > --- > .travis.yml | 11 +++ > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/.tra

[PATCH] ia64: build fix in cache.h

2019-06-04 Thread Leif Lindholm
ectures in order to not get missing symbol errors when running grub-mkimage. Reported-by: Alexander Graf Signed-off-by: Leif Lindholm --- include/grub/cache.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/grub/cache.h b/include/grub/cache.h index ccfa717e6..85819f

Re: [PATCH] ia64: build fix in cache.h

2019-06-04 Thread Leif Lindholm
On Wed, Jun 05, 2019 at 12:11:00AM +0200, John Paul Adrian Glaubitz wrote: > On 6/4/19 8:51 PM, Leif Lindholm wrote: > > Add ia64 to the architectures excluding a declaration for > > grub_arch_sync_dma_caches. > > > > IA64 does not include any of the source file

[PATCH v2] ia64: build fix in cache.h

2019-06-06 Thread Leif Lindholm
ectures in order to not get missing symbol errors when running grub-mkimage. Reported-by: Alexander Graf Signed-off-by: Leif Lindholm Tested-by: John Paul Adrian Glaubitz --- Changes in v2: - Alphabetically sort macros in conditional. - Add Adrian's T-b. include/grub/cache.h | 3 ++- 1

Re: [PATCH 1/1] lsefisystab: support device tree

2019-07-06 Thread Leif Lindholm
ff-by: Heinrich Schuchardt Good idea! Reviewed-by: Leif Lindholm This is also a good nudge that I ought to go through and update that table in general. SMBIOS 3.0, ESRT and MEMATTR are missing - and some of the others are architecture-specific. / Leif > --- > grub-core/comman

Re: [PATCH v7 1/2] Define SMBIOS3 entry point structures for EFI

2019-07-06 Thread Leif Lindholm
On Fri, Jul 05, 2019 at 08:47:02AM -0400, David Michael wrote: > This adds the GUID, and includes it in lsefisystab output. > > Signed-off-by: David Michael Oh, and here we already have the SMBIOS 3.0 entry, splendid. Reviewed-by: Leif Lindholm Daniel: please consider merging

Re: [Aarch64-laptops] [PATCH v7 2/2] Add a module for retrieving SMBIOS information

2019-07-06 Thread Leif Lindholm
On Sat, Jul 06, 2019 at 12:23:17PM +0100, Leif Lindholm wrote: > > Another use case is aarch64 laptops effort. We have the same kernel, > > and the same image bootable and usable across 4 different laptop > > models, with the only difference between them being the DTB to load. &g

Re: [Aarch64-laptops] [PATCH v7 2/2] Add a module for retrieving SMBIOS information

2019-07-06 Thread Leif Lindholm
On Fri, Jul 05, 2019 at 01:58:59PM +0100, Dimitri John Ledkov wrote: > On Fri, 5 Jul 2019 at 13:48, David Michael wrote: > > > > The following are two use cases from Rajat Jain : > > > > 1) We have a board that boots Linux and this board itself can be > >plugged into one of different chassis t

Re: EFI_PXE_BASE_CODE_PROTOCOL

2019-08-06 Thread Leif Lindholm
+Peter Jones (sorry Peter) On Tue, Aug 06, 2019 at 08:34:58AM +0200, Heinrich Schuchardt wrote: > iPXE uses the EFI simple network protocol to execute DHCP. OK. > Can GRUB already do the same when the EFI_PXE_BASE_CODE_PROTOCOL is not > present? Yes. As of very recently (proper* DHCP support wa

Re: EFI_PXE_BASE_CODE_PROTOCOL

2019-08-06 Thread Leif Lindholm
On Tue, Aug 06, 2019 at 08:52:09PM +0200, Heinrich Schuchardt wrote: > > > > EFI_PXE_BASE_CODE_PACKET DhcpAck is a union: > > > > > > > > typedef union { > > > > UINT8 Raw[1472]; > > > > EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4; > > > > EFI_PXE_BASE_CODE_DHCPV6_PA

Re: [PATCH] arm64: make sure fdt has #address-cells and #size-cells properties

2019-11-07 Thread Leif Lindholm
On Thu, Oct 31, 2019 at 11:37:40AM +0100, Javier Martinez Canillas wrote: > From: Mark Salter > > Recent upstream changes to kexec-tools relies on #address-cells > and #size-cells properties in the FDT. If grub2 needs to create > a chosen node, it is likely because firmware did not provide one. >

Re: [EXTERNAL] Re: [PATCH 0/2] Implement a grub loader for RISC-V LINUX

2020-01-17 Thread Leif Lindholm
On Thu, Jan 16, 2020 at 13:14:39 +, Atish Patra wrote: > > Thanks a lot for tackling this problem - it's been on the back > burner for way too long :). Unfortunately this patch set loads grub > via UEFI, but then does not execute Linux using the UEFI > protocol. While that's a nice hack for sta

Re: [PATCH 1/5] efi: Allocate half of available memory by default

2020-02-13 Thread Leif Lindholm
On Thu, Feb 06, 2020 at 15:27:29 +0100, Patrick Steinhardt wrote: > By default, GRUB will allocate a quarter of the pages it got available > in the EFI subsystem. On many current systems, this will amount to > roughly 800MB of RAM assuming an address space of 32 bits. This is > plenty for most use

Re: [PATCH v2 0/6] Support Argon2 KDF in LUKS2

2020-02-20 Thread Leif Lindholm
Hi Patrick, On Thu, Feb 20, 2020 at 19:00:48 +0100, Patrick Steinhardt wrote: > this is the second version of my patchset to add support for Argon2 > encryption keys for LUKS2. > > The most important change is that I've now verbosely imported the argon2 > code from the official reference implemen

Re: [PATCH v3 1/5] efi: Always try to allocate heap size of 1.6GB

2020-03-13 Thread Leif Lindholm
On Tue, Mar 10, 2020 at 19:58:28 +0100, Patrick Steinhardt wrote: > By default, GRUB will allocate a quarter of the pages it got available > in the EFI subsystem. On many current systems, this will amount to > roughly 800MB of RAM assuming an address space of 32 bits. This is > plenty for most use

Re: [PATCH v3 3/5] argon2: Import Argon2 from cryptsetup

2020-03-17 Thread Leif Lindholm
On Tue, Mar 17, 2020 at 06:51:54 +0100, Patrick Steinhardt wrote: > > > some open questions, and I'm not sure I feel comfortable with hitting > > > master so close to the pending release. Let me know if you feel > > > otherwise. > > > > I have the same feeling. So, if it is not very critical for y

Re: [PATCH 1/3] configure: Enforce gnu99 C language standard

2020-04-02 Thread Leif Lindholm
On Thu, Apr 02, 2020 at 17:07:48 +0200, Daniel Kiper wrote: > Commit d5a32255d (misc: Make grub_strtol() "end" pointers have safer > const qualifiers) introduced "restrict" keyword into some functions > definitions. This keyword was introduced in C99 standard. However, some > compilers by default m

Re: [PATCH 1/3] configure: Enforce gnu99 C language standard

2020-04-02 Thread Leif Lindholm
On Thu, Apr 02, 2020 at 19:08:21 +0200, Daniel Kiper wrote: > > > -# Optimization flag. Allow user to override. > > > +if test "x$BUILD_CFLAGS" = x; then > > > + BUILD_CFLAGS='-std=gnu99' > > > +fi > > > + > > > +if test "x$HOST_CFLAGS" = x; then > > > + HOST_CFLAGS='-std=gnu99' > > > +fi > > >

Re: [PATCH v2 2/4] configure: Enforce gnu99 C language standard

2020-04-07 Thread Leif Lindholm
r > --- > v2 - suggestions/fixes: >- unconditionally enforce gnu99 C language standard > (suggested by Leif Lindholm). > --- > configure.ac | 4 > 1 file changed, 4 insertions(+) > > diff --git a/configure.ac b/configure.ac > index b2576b013..fc74ee800 100

Re: [PATCH v2 3/4] INSTALL/configure: Update install doc and configure comment

2020-04-07 Thread Leif Lindholm
On Fri, Apr 03, 2020 at 14:45:02 +0200, Daniel Kiper wrote: > ..to reflect the GRUB build reality in them. > > Additionally, fix ./configure command example formatting in INSTALL file. > > Signed-off-by: Daniel Kiper > --- > INSTALL | 51 +++

  1   2   3   4   >