Re: [PATCH v2 09/10] RISC-V: Add to build system

2018-11-14 Thread Bin Meng
Hi Alex, On Thu, Nov 15, 2018 at 1:02 AM Alexander Graf wrote: > > On 11/14/2018 04:34 PM, Bin Meng wrote: > > On Wed, Nov 14, 2018 at 11:28 PM Andreas Schwab wrote: > >> On Nov 14 2018, Bin Meng wrote: > >> > >>> - use riscv32-* toolchain to build riscv64 target (-m64 required) > >>> - use

[PATCH V2 2/3] verifiers: Core TPM support

2018-11-14 Thread Matthew Garrett
From: Matthew Garrett Add support for performing basic TPM measurements. Right now this only supports extending PCRs statically and only on UEFI. In future we might want to have some sort of mechanism for choosing which events get logged to which PCRs, but this seems like a good default policy

[PATCH V2 1/3] verifiers: Verify commands executed by grub

2018-11-14 Thread Matthew Garrett
From: Matthew Garrett Pass all commands executed by grub to the verifiers layer. Most verifiers will ignore this, but some (such as the TPM verifier) want to be able to measure and log each command executed in order to ensure that the boot state is as expected. Signed-off-by: Matthew Garrett

Re: [PATCH 2/3] verifiers: Core TPM support

2018-11-14 Thread Matthew Garrett
On Thu, Nov 15, 2018 at 6:39 AM Daniel Kiper wrote: > Could you be more C-ish? E.g. s/Major/major/, s/Minor/minor/, etc. These are the spec-defined member names, so I've a mild preference for keeping them that way - it makes it easier to compare with the spec and update stuff with later spec

Re: [PATCH 1/3] verifiers: Verify commands executed by grub

2018-11-14 Thread Matthew Garrett
On Thu, Nov 15, 2018 at 5:45 AM Daniel Kiper wrote: > Except lack of SOB patch LGTM. May I add your SOB before pushing this > patch. Or you can repost it with Feel free to add my SOB. ___ Grub-devel mailing list Grub-devel@gnu.org

[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 these.

[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

[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(+), 1 deletion(-)

[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(+)

Re: [PATCH 3/3] verifiers: Add TPM documentation

2018-11-14 Thread Daniel Kiper
On Fri, Nov 09, 2018 at 03:41:03PM -0800, Matthew Garrett wrote: > Describe the behaviour of grub when the TPM module is in use. Lack of SOB. Otherwise Reviewed-by: Daniel Kiper Daniel ___ Grub-devel mailing list Grub-devel@gnu.org

Re: [PATCH 2/3] verifiers: Core TPM support

2018-11-14 Thread Daniel Kiper
On Fri, Nov 09, 2018 at 03:41:02PM -0800, Matthew Garrett wrote: Hmmm... Here it is a bit better... > From: Matthew Garrett > > Add support for performing basic TPM measurements. Right now this only > supports extending PCRs statically and only on UEFI. In future we might > want to have some

[PATCH v3 09/10] RISC-V: Add to build system

2018-11-14 Thread Alexander Graf
This patch adds support for RISC-V to the grub build system. With this patch, I can successfully build grub on RISC-V as a UEFI application. Signed-off-by: Alexander Graf Reviewed-by: Alistair Francis --- v2 -> v3: - Fix riscv32 target --- configure.ac | 28

[PATCH v3 08/10] RISC-V: Add auxiliary files

2018-11-14 Thread Alexander Graf
To support a new architecture we need to provide a few helper functions for memory, cache, timer, etc support. This patch adds the remainders of those. Some bits are still disabled, as I couldn't guarantee that we're always running on models / in modes where the respective hardware is available.

[PATCH v3 03/10] elf.h: Add RISC-V definitions

2018-11-14 Thread Alexander Graf
The RISC-V ABI document outlines ELF header structure and relocation information. Pull the respective magic numbers into our elf header so we can make use of them. Signed-off-by: Alexander Graf Reviewed-by: Alistair Francis --- include/grub/elf.h | 59

[PATCH v3 02/10] PE: Add RISC-V definitions

2018-11-14 Thread Alexander Graf
The PE format defines magic numbers as well as relocation identifiers for RISC-V. Add them to our include file, so we can make use of them. Signed-off-by: Alexander Graf Reviewed-by: Leif Lindholm Reviewed-by: Alistair Francis --- include/grub/efi/pe32.h | 5 + 1 file changed, 5

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

2018-11-14 Thread Alexander Graf
We currently only support to run grub on RISC-V as UEFI payload. Ideally, we also only want to support running Linux underneath as UEFI payload. Prepare that with a Linux boot case that is not enabled in Linux yet. At least it will give people something to test against when they enable the Linux

[PATCH v3 04/10] RISC-V: Add setjmp implementation

2018-11-14 Thread Alexander Graf
This patch adds a 32/64 capable setjmp implementation for RISC-V. Signed-off-by: Alexander Graf Reviewed-by: Alistair Francis --- grub-core/lib/riscv/setjmp.S | 82 +++ include/grub/riscv32/setjmp.h | 27 ++ include/grub/riscv64/setjmp.h |

[PATCH v3 01/10] efi: Rename armxx to arch

2018-11-14 Thread Alexander Graf
Some architectures want to boot Linux as plain UEFI binary. Today that really only encompasses ARM and AArch64, but going forward more architectures may adopt that model. So rename our internal API accordingly. Signed-off-by: Alexander Graf Acked-by: Leif Lindholm Reviewed-by: Alistair Francis

[PATCH v3 07/10] RISC-V: Add awareness for RISC-V reloations

2018-11-14 Thread Alexander Graf
This patch adds awareness of RISC-V relocations throughout the grub tools as well as dynamic linkage and elf->PE relocation conversion support. Signed-off-by: Alexander Graf --- v2 -> v3: - Fix riscv32 target --- grub-core/kern/dl.c | 6 +- grub-core/kern/riscv/dl.c | 335

[PATCH v3 00/10] Add RISC-V support

2018-11-14 Thread Alexander Graf
As part of the plan for total world domination, we would like to make sure that booting on RISC-V is in a sane state before anyone goes and does quick hacks "just because". For that reason, U-Boot supports UEFI booting on RISC-V for a while now. This patch set is the second part of the puzzle,

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

2018-11-14 Thread Alexander Graf
We now have signature check logic in grub which allows us to treat files differently depending on their file type. Mark a loaded device tree as such and treat it like an overlayed ACPI table. Both describe hardware, so I suppose their threat level is the same. Signed-off-by: Alexander Graf ---

Re: [PATCH 1/3] verifiers: Verify commands executed by grub

2018-11-14 Thread Daniel Kiper
On Fri, Nov 09, 2018 at 03:41:01PM -0800, Matthew Garrett wrote: > From: Matthew Garrett > > Pass all commands executed by grub to the verifiers layer. Most > verifiers will ignore this, but some (such as the TPM verifier) want to > be able to measure and log each command executed in order to

Re: [PATCH] mkimage: pad DTBs to target-specific pointer size

2018-11-14 Thread Daniel Kiper
On Wed, Nov 07, 2018 at 11:44:08AM +1300, Matthew Daley wrote: > Device tree (DTB) lengths are being padded to a multiple of 4 bytes > rather than the target-specific pointer size. This causes objects > following OBJ_TYPE_DTB objects to be incorrectly parsed during GRUB > execution on arm64. > >

Re: [PATCH v2 09/10] RISC-V: Add to build system

2018-11-14 Thread Andreas Schwab
On Nov 14 2018, Bin Meng wrote: > - use riscv32-* toolchain to build riscv64 target (-m64 required) > - use riscv64-* toolchain to build riscv32 target (-m32 required) riscv does not use -m64/-m32. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9

Re: Network boot

2018-11-14 Thread Daniel Kiper
Hi Christopher, Sorry for late reply but I am busy. On Fri, Nov 02, 2018 at 12:32:09PM +0100, Christopher Lucas wrote: > Hello, > > I've recently bought a 32-bit EFI Windows Tablet with 64-bit CPU. It doesn't > have any Ethernet port so I'm using a USB-Ethernet adapter (rtl8153 chipset > works

Re: [PATCH] verifiers: fix double close on pgp's sig file descriptor

2018-11-14 Thread Daniel Kiper
On Tue, Nov 13, 2018 at 02:31:18PM +0800, Michael Chang wrote: > An error emerged as when I was tesing the verifiers branch, so instead > of putting it in pgp prefix, the verifiers is used to reflect what the > patch is based on. > > While running verify_detached, grub aborts with error. > >

Re: [PATCH v2 09/10] RISC-V: Add to build system

2018-11-14 Thread Bin Meng
On Wed, Nov 14, 2018 at 11:28 PM Andreas Schwab wrote: > > On Nov 14 2018, Bin Meng wrote: > > > - use riscv32-* toolchain to build riscv64 target (-m64 required) > > - use riscv64-* toolchain to build riscv32 target (-m32 required) > > riscv does not use -m64/-m32. > Ah, yes! I was brain-dead.

Re: [Xen-devel] [PATCH v4 12/19] xen: add PCI MMIO areas to memory map

2018-11-14 Thread Daniel Kiper
On Wed, Nov 14, 2018 at 01:49:16PM +0100, Roger Pau Monné wrote: > On Fri, Nov 09, 2018 at 08:14:57PM +0100, Daniel Kiper wrote: > > On Fri, Nov 02, 2018 at 01:37:31PM +0100, Juergen Gross wrote: > > > Add possible PCI space MMIO areas as "Reserved" to the memory map in > > > order to avoid using

Re: [PATCH v2 09/10] RISC-V: Add to build system

2018-11-14 Thread Bin Meng
Hi Alex, On Wed, Nov 14, 2018 at 9:11 PM Alexander Graf wrote: > > This patch adds support for RISC-V to the grub build system. With this > patch, I can successfully build grub on RISC-V as a UEFI application. > > Signed-off-by: Alexander Graf > Reviewed-by: Alistair Francis > --- >

Re: [PATCH v2 05/10] RISC-V: Add early startup code

2018-11-14 Thread Bin Meng
On Wed, Nov 14, 2018 at 9:11 PM Alexander Graf wrote: > > On entry, we need to save the system table pointer as well as our image > handle. Add an early startup file that saves them and then brings us > into our main function. > > Signed-off-by: Alexander Graf > Reviewed-by: Alistair Francis >

Re: [PATCH v2 08/10] RISC-V: Add auxiliary files

2018-11-14 Thread Bin Meng
Hi Alex, On Wed, Nov 14, 2018 at 9:11 PM Alexander Graf wrote: > > To support a new architecture we need to provide a few helper functions > for memory, cache, timer, etc support. > > This patch adds the remainders of those. Some bits are still disabled, > as I couldn't guarantee that we're

Re: [PATCH v2 02/10] PE: Add RISC-V definitions

2018-11-14 Thread Bin Meng
On Wed, Nov 14, 2018 at 9:11 PM Alexander Graf wrote: > > The PE format defines magic numbers as well as relocation identifiers for > RISC-V. Add them to our include file, so we can make use of them. > > Signed-off-by: Alexander Graf > Reviewed-by: Leif Lindholm > Reviewed-by: Alistair Francis

Re: [PATCH v2 03/10] elf.h: Add RISC-V definitions

2018-11-14 Thread Bin Meng
On Wed, Nov 14, 2018 at 9:11 PM Alexander Graf wrote: > > The RISC-V ABI document outlines ELF header structure and relocation > information. Pull the respective magic numbers into our elf header > so we can make use of them. > > Signed-off-by: Alexander Graf > Reviewed-by: Alistair Francis >

Re: [PATCH v2 01/10] efi: Rename armxx to arch

2018-11-14 Thread Bin Meng
On Wed, Nov 14, 2018 at 9:11 PM Alexander Graf wrote: > > Some architectures want to boot Linux as plain UEFI binary. Today that > really only encompasses ARM and AArch64, but going forward more > architectures may adopt that model. > > So rename our internal API accordingly. > > Signed-off-by:

Re: [PATCH v2 07/10] RISC-V: Add awareness for RISC-V reloations

2018-11-14 Thread Bin Meng
Hi Alex, On Wed, Nov 14, 2018 at 9:11 PM Alexander Graf wrote: > > This patch adds awareness of RISC-V relocations throughout the grub tools > as well as dynamic linkage and elf->PE relocation conversion support. > > Signed-off-by: Alexander Graf > --- > grub-core/kern/dl.c | 6 +- >

Re: [PATCH v2 04/10] RISC-V: Add setjmp implementation

2018-11-14 Thread Bin Meng
On Wed, Nov 14, 2018 at 9:11 PM Alexander Graf wrote: > > This patch adds a 32/64 capable setjmp implementation for RISC-V. > > Signed-off-by: Alexander Graf > Reviewed-by: Alistair Francis > --- > grub-core/lib/riscv/setjmp.S | 82 > +++ >

[PATCH v2 07/10] RISC-V: Add awareness for RISC-V reloations

2018-11-14 Thread Alexander Graf
This patch adds awareness of RISC-V relocations throughout the grub tools as well as dynamic linkage and elf->PE relocation conversion support. Signed-off-by: Alexander Graf --- grub-core/kern/dl.c | 6 +- grub-core/kern/riscv/dl.c | 335

[PATCH v2 04/10] RISC-V: Add setjmp implementation

2018-11-14 Thread Alexander Graf
This patch adds a 32/64 capable setjmp implementation for RISC-V. Signed-off-by: Alexander Graf Reviewed-by: Alistair Francis --- grub-core/lib/riscv/setjmp.S | 82 +++ include/grub/riscv32/setjmp.h | 27 ++ include/grub/riscv64/setjmp.h |

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

2018-11-14 Thread Alexander Graf
We currently only support to run grub on RISC-V as UEFI payload. Ideally, we also only want to support running Linux underneath as UEFI payload. Prepare that with a Linux boot case that is not enabled in Linux yet. At least it will give people something to test against when they enable the Linux

[PATCH v2 00/10] Add RISC-V support

2018-11-14 Thread Alexander Graf
As part of the plan for total world domination, we would like to make sure that booting on RISC-V is in a sane state before anyone goes and does quick hacks "just because". For that reason, U-Boot supports UEFI booting on RISC-V for a while now. This patch set is the second part of the puzzle,

[PATCH v2 03/10] elf.h: Add RISC-V definitions

2018-11-14 Thread Alexander Graf
The RISC-V ABI document outlines ELF header structure and relocation information. Pull the respective magic numbers into our elf header so we can make use of them. Signed-off-by: Alexander Graf Reviewed-by: Alistair Francis --- include/grub/elf.h | 59

[PATCH v2 02/10] PE: Add RISC-V definitions

2018-11-14 Thread Alexander Graf
The PE format defines magic numbers as well as relocation identifiers for RISC-V. Add them to our include file, so we can make use of them. Signed-off-by: Alexander Graf Reviewed-by: Leif Lindholm Reviewed-by: Alistair Francis --- include/grub/efi/pe32.h | 5 + 1 file changed, 5

[PATCH v2 09/10] RISC-V: Add to build system

2018-11-14 Thread Alexander Graf
This patch adds support for RISC-V to the grub build system. With this patch, I can successfully build grub on RISC-V as a UEFI application. Signed-off-by: Alexander Graf Reviewed-by: Alistair Francis --- configure.ac | 28 ++-- gentpl.py

[PATCH v2 08/10] RISC-V: Add auxiliary files

2018-11-14 Thread Alexander Graf
To support a new architecture we need to provide a few helper functions for memory, cache, timer, etc support. This patch adds the remainders of those. Some bits are still disabled, as I couldn't guarantee that we're always running on models / in modes where the respective hardware is available.

[PATCH v2 01/10] efi: Rename armxx to arch

2018-11-14 Thread Alexander Graf
Some architectures want to boot Linux as plain UEFI binary. Today that really only encompasses ARM and AArch64, but going forward more architectures may adopt that model. So rename our internal API accordingly. Signed-off-by: Alexander Graf Acked-by: Leif Lindholm Reviewed-by: Alistair Francis

Re: [Xen-devel] [PATCH v4 12/19] xen: add PCI MMIO areas to memory map

2018-11-14 Thread Roger Pau Monné
On Fri, Nov 09, 2018 at 08:14:57PM +0100, Daniel Kiper wrote: > On Fri, Nov 02, 2018 at 01:37:31PM +0100, Juergen Gross wrote: > > Add possible PCI space MMIO areas as "Reserved" to the memory map in > > order to avoid using those areas for special Xen pages later. > > > > Signed-off-by: Juergen

Re: [Xen-devel] [PATCH v4 12/19] xen: add PCI MMIO areas to memory map

2018-11-14 Thread Roger Pau Monné
On Fri, Nov 02, 2018 at 01:37:31PM +0100, Juergen Gross wrote: > Add possible PCI space MMIO areas as "Reserved" to the memory map in > order to avoid using those areas for special Xen pages later. TBH, I'm not sure this is the best way to solve the issues related to where to map stuff in the

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

2018-11-14 Thread Alexander Graf
We now have signature check logic in grub which allows us to treat files differently depending on their file type. Mark a loaded device tree as such and treat it like an overlayed ACPI table. Both describe hardware, so I suppose their threat level is the same. Signed-off-by: Alexander Graf ---