Re: Linux DRTM on UEFI platforms

2022-08-11 Thread Matthew Garrett
On Fri, Aug 12, 2022 at 12:52:58PM +0930, Brendan Trotter wrote: > Hi, > > On Fri, Aug 12, 2022 at 3:55 AM Matthew Garrett wrote: > > On Thu, Aug 11, 2022 at 07:25:58PM +0930, Brendan Trotter wrote: > > > On Thu, Aug 11, 2022 at 3:16 AM Matthew Garrett > > > wrote: > > > > The kernel has no

Re: [PATCH V2] i386: Using 64-bit boot protocol for 64-bit linux kernel

2022-08-11 Thread Wei Zhang
On Fri, Aug 12, 2022 at 1:18 AM Daniel Kiper wrote: > > On Thu, Aug 04, 2022 at 11:07:30PM +0800, Wei Zhang wrote: > > On Wed, Aug 3, 2022 at 11:33 PM Daniel Kiper wrote: > > > > > > On Sat, Jul 23, 2022 at 07:20:43PM +0800, Wei Zhang wrote: > > > > From: Wei Zhang > > > > > > > > Currently

Re: Linux DRTM on UEFI platforms

2022-08-11 Thread Brendan Trotter
Hi, On Fri, Aug 12, 2022 at 3:55 AM Matthew Garrett wrote: > On Thu, Aug 11, 2022 at 07:25:58PM +0930, Brendan Trotter wrote: > > On Thu, Aug 11, 2022 at 3:16 AM Matthew Garrett wrote: > > > The kernel has no way to know this - *any* code you've run before > > > performing a measurement could

Re: [PATCH] search: Support searching for GPT partition label with --part-label

2022-08-11 Thread Glenn Washburn
On Tue, 22 Feb 2022 16:16:09 +0100 Sean Nyekjaer wrote: > Hi, > > I have rebased this to grub-2.06. > > Still seems to function, any plans to apply this? This patch now needs to be rebased on to latest with minor updates to reflect changes in the search code. I don't think Daniel K saw this

Re: search: Support searching for partition UUID with --part-uuid

2022-08-11 Thread Glenn Washburn
On Tue, 3 Nov 2020 20:45:23 +0300 Dmitry wrote: > Hello, > > Please review and accept a patch from attachments. Attaching a patch makes it hard to review, please resubmit inline using git send-email. Also make sure to have your SOB (Signed-off-by) line at the end of the commit message. Glenn

Re: [PATCH] Add a link to environment variables inside docs

2022-08-11 Thread Glenn Washburn
On Sat, 09 Jan 2021 19:30:34 +0100 "Andrea G. Monaco" wrote: > > This is trivial, but it might save some time to beginners. Please > consider for insertion. Reviewed-by: Glenn Washburn Glenn > > Cheers, > Andrea Monaco > > > --- > docs/grub.texi | 4 +++- > 1 file changed, 3

Re: [PATCH] efi: Copy load_options into environment

2022-08-11 Thread Glenn Washburn
On Tue, 8 Dec 2020 20:39:50 -0600 Jordan Webb wrote: > When GRUB is loaded as an EFI application, it will copy the EFI > LoadOptions into an environment variable called "efi_load_options" and > export it. I'm not familiar with EFI LoadOptions, however they don't seem to be a string necessarily

Re: [PATCH 0/2] templates/linux_xen: Properly handle multiple initrd files

2022-08-11 Thread Mauricio Faria de Oliveira
On Thu, Aug 11, 2022 at 1:51 PM Daniel Kiper wrote: > > On Mon, Aug 08, 2022 at 07:04:23PM -0300, Mauricio Faria de Oliveira wrote: > > The linux_xen template seems to be broken for multiple initrd files. > > Linux fails to boot when it needs a real initrd but early/microcode > > initrd(s) are

[PATCH 2/2] templates/linux_xen: Properly order the multiple initrd files

2022-08-11 Thread Mauricio Faria de Oliveira
The linux_xen template orders the "early" initrd file(s) _first_ (i.e., before the "real" initrd files) and that seems reasonable, as microcode updates usually come first. However, this usually breaks Linux boot with initrd under Xen because Xen assumes the real initrd is the first multiboot[2]

[PATCH 0/2] templates/linux_xen: Properly handle multiple initrd files

2022-08-11 Thread Mauricio Faria de Oliveira
Adding the xen-devel list as requested in grub-devel [0]: On Thu, Aug 11, 2022 at 1:51 PM Daniel Kiper wrote: > In general patches LGTM. However, I would prefer to hear an opinion from Xen > folks too. So, please repost the patch set and add > xen-de...@lists.xenproject.org > to the list of

[PATCH 1/2] templates/linux_xen: Properly load multiple initrd files

2022-08-11 Thread Mauricio Faria de Oliveira
The linux_xen template can put multiple initrd files in the same multiboot[2] module[2] command, which is against specs. This causes ONLY the _first_ initrd file to be loaded; other files just have filenames in a "cmdline" string of the first initrd file and are NOT loaded. Fix this by inserting

Re: Linux DRTM on UEFI platforms

2022-08-11 Thread Matthew Garrett
On Thu, Aug 11, 2022 at 07:25:58PM +0930, Brendan Trotter wrote: > Hi, > > On Thu, Aug 11, 2022 at 3:16 AM Matthew Garrett wrote: > > The kernel has no way to know this - *any* code you've run before > > performing a measurement could tamper with the kernel such that it > > believes it's fine.

Re: [PATCH v3] disk/cryptodisk: When cheatmounting, use the sector info of the cheat device

2022-08-11 Thread Glenn Washburn
Adding Daniel to this email. Glenn On Tue, 14 Jun 2022 15:55:21 +0200 Fabian Vogt wrote: > When using grub-probe with cryptodisk, the mapped block device from the host > is used directly instead of decrypting the source device in GRUB code. > In that case, the sector size and count of the host

Re: [PATCH v6 0/2] Have LUKS2 cryptomounts be useable with grub-probe

2022-08-11 Thread Glenn Washburn
On Fri, 8 Jul 2022 12:06:06 +0200 Josselin Poiret wrote: > Hello Daniel, > > Thanks for the review. The following updated patches should contain all the > changes you asked for. In case this got forgotten, I've reviewed this patch series. The only nit that Daniel can probably fix before

Re: [PATCH v2 1/1] Add support for grub-emu to kexec Linux menu entries

2022-08-11 Thread Daniel Kiper
On Mon, Aug 08, 2022 at 11:43:15PM +0200, Vladimir 'phcoder' Serbinenko wrote: > I like it in general however I had a comment: in future GRUB could be able to > do the same through second approach: load a constructed kexec blob with all > the > parts. This would allow to e.g. kexec FreeBSD. This

Re: [PATCH v2 1/1] Add support for grub-emu to kexec Linux menu entries

2022-08-11 Thread Daniel Kiper
On Mon, Aug 08, 2022 at 02:58:06PM -0400, Robbie Harwood wrote: > Daniel Kiper writes: > > > On Tue, Jul 19, 2022 at 04:39:34PM -0400, Robbie Harwood wrote: > > > >> +static grub_err_t > >> +grub_linux_boot (void) > >> +{ > >> + grub_err_t rc = GRUB_ERR_NONE; > >> + char *initrd_param; > >> +

Re: [PATCH v2 1/1] Add support for grub-emu to kexec Linux menu entries

2022-08-11 Thread Robbie Harwood
"Vladimir 'phcoder' Serbinenko" writes: > I like it in general however I had a comment: in future GRUB could be able > to do the same through second approach: load a constructed kexec blob with > all the parts. This would allow to e.g. kexec FreeBSD. This didn't have to > be implemented now.

Re: [PATCH 4/6] Add memtool module with memory allocation stress-test

2022-08-11 Thread Glenn Washburn
On Thu, 11 Aug 2022 14:41:02 -0300 Diego Domingos wrote: > From: Daniel Axtens > > When working on memory, it's nice to be able to test your work. > > Add a memtest module. When compiled with --enable-mm-debug, it exposes > 3 commands: Does this build without giving --enable-mm-debug to

[PATCH v5 2/2] cryptodisk: Allows UUIDs to be compared in a dash-insensitive manner

2022-08-11 Thread Glenn Washburn
A user can now specify UUID strings with dashes, instead of having to remove dashes. This is backwards-compatability preserving and also fixes a source of user confusion over the inconsistency with how UUIDs are specified between file system UUIDs and cryptomount UUIDs. Since cryptsetup, the

[PATCH v5 0/2] cryptodisk: Allows UUIDs to be compared in a dash-insensitive manner

2022-08-11 Thread Glenn Washburn
Updates since v4: * Add patch to add missing casts to grub_strncasecmp() * Remove patch forcing null termination of uuid from header * Use correct patch for uuid comparison. The previous had bad variable name usage, but the logic is the same. Glenn Glenn Washburn (2): misc: Add cast in

[PATCH v5 1/2] misc: Add cast in grub_strncasecmp() to drop sign when calling grub_tolower()

2022-08-11 Thread Glenn Washburn
Note this cast was fixed in grub_strcasecmp() in commit ce41ab7aab (* grub-core/kern/misc.c (grub_strcmp): Use unsigned comparison as per common usage and preffered in several parts of code.), but this commit omitted fixing it in grub_strncasecmp(). Signed-off-by: Glenn Washburn ---

[PATCH 5/6] ibmvtpm: Add support for trusted boot using a vTPM 2.0

2022-08-11 Thread Diego Domingos
From: Stefan Berger Add support for trusted boot using a vTPM 2.0 on the IBM IEEE1275 PowerPC platform. With this patch grub now measures text and binary data into the TPM's PCRs 8 and 9 in the same way as the x86_64 platform does. This patch requires Daniel Axtens's patches for claiming more

[PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2

2022-08-11 Thread Diego Domingos
Hello, This is an addition to the series sent from Daniel Axtens (https://lists.gnu.org/archive/html/grub-devel/2022-04/msg00064.html). Patch 'ieee1275: request memory with ibm,client-architecture-support' implements vectors 1-4 of client-architecture-support negotiation However, during some

[PATCH 2/6] ieee1275: drop len -= 1 quirk in heap_init

2022-08-11 Thread Diego Domingos
From: Daniel Axtens This was apparently 'required by some firmware': commit dc9468500919 ("2007-02-12 Hollis Blanchard "). It's not clear what firmware that was, and what platform from 14 years ago which exhibited the bug then is still both in use and buggy now. It doesn't cause issues on

[PATCH 4/6] Add memtool module with memory allocation stress-test

2022-08-11 Thread Diego Domingos
From: Daniel Axtens When working on memory, it's nice to be able to test your work. Add a memtest module. When compiled with --enable-mm-debug, it exposes 3 commands: * lsmem - print all allocations and free space in all regions * lsfreemem - print free space in all regions *

[PATCH 6/6] ieee1275: implement vec5 for cas negotiation

2022-08-11 Thread Diego Domingos
As a legacy support, if the vector 5 is not implemented, Power Hypervisor will consider the max CPUs as 64 instead 256 currently supported during client-architecture-support negotiation. This patch implements the vector 5 and set the MAX CPUs to 256 while setting the others values to 0 (default).

[PATCH 1/6] ieee1275: request memory with ibm, client-architecture-support

2022-08-11 Thread Diego Domingos
From: Daniel Axtens On PowerVM, the first time we boot a Linux partition, we may only get 256MB of real memory area, even if the partition has more memory. This isn't enough to reliably verify a kernel. Fortunately, the Power Architecture Platform Reference (PAPR) defines a method we can call

[PATCH 3/6] ieee1275: support runtime memory claiming

2022-08-11 Thread Diego Domingos
From: Daniel Axtens On powerpc-ieee1275, we are running out of memory trying to verify anything. This is because: - we have to load an entire file into memory to verify it. This is difficult to change with appended signatures. - We only have 32MB of heap. - Distro kernels are now often

[PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2

2022-08-11 Thread Diego Domingos
Hello, This is an addition to the series sent from Daniel Axtens (https://lists.gnu.org/archive/html/grub-devel/2022-04/msg00064.html). Patch 'ieee1275: request memory with ibm,client-architecture-support' implements vectors 1-4 of client-architecture-support negotiation However, during some

Re: [PATCH V2] i386: Using 64-bit boot protocol for 64-bit linux kernel

2022-08-11 Thread Daniel Kiper
On Thu, Aug 04, 2022 at 11:07:30PM +0800, Wei Zhang wrote: > On Wed, Aug 3, 2022 at 11:33 PM Daniel Kiper wrote: > > > > On Sat, Jul 23, 2022 at 07:20:43PM +0800, Wei Zhang wrote: > > > From: Wei Zhang > > > > > > Currently GRUB boots linux with 32-bit protocol for 64 bit kernel. > > > Thus if

[PATCH] grub-shell: Only show grub-mkrescue output if it returns an error

2022-08-11 Thread Glenn Washburn
The previous behavior ignored an error and the output from grub-mkrescue. This made it difficult to discover that grub-mkrescue was the reason that tests which rely on grub-shell were failing. Even after discovering grub-mkrescue was the culprit, there was no output to indicate why it was failing.

Re: [PATCH 0/2] templates/linux_xen: Properly handle multiple initrd files

2022-08-11 Thread Daniel Kiper
On Mon, Aug 08, 2022 at 07:04:23PM -0300, Mauricio Faria de Oliveira wrote: > The linux_xen template seems to be broken for multiple initrd files. > Linux fails to boot when it needs a real initrd but early/microcode > initrd(s) are found by grub-mkconfig. > > Patch 1 allows initrd(s) other than

Re: [PATCH v3] efi: Add efitextmode command for getting/setting the text mode resolution

2022-08-11 Thread Glenn Washburn
On Wed, 10 Aug 2022 15:55:52 +0200 Daniel Kiper wrote: > On Tue, Aug 02, 2022 at 05:39:13PM +0200, Daniel Kiper wrote: > > On Fri, Jul 22, 2022 at 02:16:33AM -0500, Glenn Washburn wrote: > > > This command is meant to behave similarly to the 'mode' command of the EFI > > > Shell application. In

[PATCH] arm64/linux: Remove magic number header field check

2022-08-11 Thread Ard Biesheuvel
The 'ARM\x64' magic number in the file header identifies an image as one that implements the bare metal boot protocol, allowing the loader to simply move the file to a suitably aligned address in memory, with sufficient headroom for the trailing .bss segment (the required memory size is described

[PATCH v9 10/10] tests: add support for LoongArch

2022-08-11 Thread Xiaotian Wu
Signed-off-by: Xiaotian Wu --- tests/ahci_test.in | 2 +- tests/ehci_test.in | 2 +- tests/ohci_test.in | 2 +- tests/pata_test.in | 2 +- tests/uhci_test.in | 2 +- tests/util/grub-shell.in | 14 ++ 6 files changed, 19 insertions(+), 5 deletions(-)

[PATCH v9 07/10] LoongArch: Add auxiliary files

2022-08-11 Thread Xiaotian Wu
Signed-off-by: Xiaotian Wu Signed-off-by: Zhou Yang --- grub-core/kern/efi/mm.c | 3 +- grub-core/kern/loongarch64/cache.c | 39 grub-core/kern/loongarch64/cache_flush.S | 33 ++ grub-core/kern/loongarch64/efi/init.c| 77

[PATCH v9 00/10] Add support for LoongArch

2022-08-11 Thread Xiaotian Wu
LoongArch is a new Loongson 3A5000 CPU instruction set, you can read documents[1] or visit the development community[2] to get more information. [1]: https://loongson.github.io/LoongArch-Documentation/README-EN.html [2]: https://github.com/loongson This patch series will add the basic support

[PATCH v9 06/10] LoongArch: Add awareness for LoongArch relocations

2022-08-11 Thread Xiaotian Wu
Signed-off-by: Xiaotian Wu Signed-off-by: Zhou Yang --- grub-core/kern/dl.c| 9 +- grub-core/kern/loongarch64/dl.c| 102 + grub-core/kern/loongarch64/dl_helper.c | 202 + include/grub/dl.h | 1 +

[PATCH v9 09/10] LoongArch: Support new relocation types

2022-08-11 Thread Xiaotian Wu
Signed-off-by: Xiaotian Wu --- conf/Makefile.common | 3 + configure.ac | 14 +++-- grub-core/kern/dl.c| 9 +-- grub-core/kern/loongarch64/dl.c| 71 - grub-core/kern/loongarch64/dl_helper.c | 68

[PATCH v9 05/10] LoongArch: Add stubs for Linux loading commands

2022-08-11 Thread Xiaotian Wu
Signed-off-by: Xiaotian Wu --- grub-core/loader/loongarch64/linux.c | 59 include/grub/loongarch64/linux.h | 31 +++ 2 files changed, 90 insertions(+) create mode 100644 grub-core/loader/loongarch64/linux.c create mode 100644

[PATCH v9 04/10] LoongArch: Add early startup code

2022-08-11 Thread Xiaotian Wu
Signed-off-by: Xiaotian Wu Signed-off-by: Zhou Yang --- grub-core/kern/loongarch64/efi/startup.S | 34 1 file changed, 34 insertions(+) create mode 100644 grub-core/kern/loongarch64/efi/startup.S diff --git a/grub-core/kern/loongarch64/efi/startup.S

[PATCH v9 03/10] LoongArch: Add setjmp implementation

2022-08-11 Thread Xiaotian Wu
Signed-off-by: Xiaotian Wu Signed-off-by: Zhou Yang Signed-off-by: Sun Haiyong --- grub-core/lib/loongarch64/setjmp.S | 69 ++ grub-core/lib/setjmp.S | 2 + include/grub/loongarch64/setjmp.h | 27 3 files changed, 98 insertions(+) create

[PATCH v9 08/10] LoongArch: Add to build system

2022-08-11 Thread Xiaotian Wu
Signed-off-by: Xiaotian Wu Signed-off-by: Zhou Yang --- Makefile.util.def | 1 + configure.ac| 22 - gentpl.py | 25 ++- grub-core/Makefile.am | 6 + grub-core/Makefile.core.def | 16

[PATCH v9 02/10] Add LoongArch definitions

2022-08-11 Thread Xiaotian Wu
Signed-off-by: Xiaotian Wu Signed-off-by: Zhou Yang --- include/grub/elf.h | 23 +++ 1 file changed, 23 insertions(+) diff --git a/include/grub/elf.h b/include/grub/elf.h index c478933ee..1c8d4f5d5 100644 --- a/include/grub/elf.h +++ b/include/grub/elf.h @@ -248,6 +248,7 @@

[PATCH v9 01/10] PE: Add LoongArch definitions

2022-08-11 Thread Xiaotian Wu
Signed-off-by: Xiaotian Wu Signed-off-by: Zhou Yang --- include/grub/efi/pe32.h | 36 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h index 0ed8781f0..de56edef6 100644 ---

Re: Linux DRTM on UEFI platforms

2022-08-11 Thread Daniel Kiper
On Thu, Aug 11, 2022 at 07:25:58PM +0930, Brendan Trotter wrote: > Hi, > > On Thu, Aug 11, 2022 at 3:16 AM Matthew Garrett wrote: > > On Wed, Aug 10, 2022 at 06:37:18PM +0930, Brendan Trotter wrote: > > > > > [1] doesn't provide any useful information. How does a kernel know > > > that the

Re: Linux DRTM on UEFI platforms

2022-08-11 Thread Brendan Trotter
Hi, On Thu, Aug 11, 2022 at 3:16 AM Matthew Garrett wrote: > On Wed, Aug 10, 2022 at 06:37:18PM +0930, Brendan Trotter wrote: > > > [1] doesn't provide any useful information. How does a kernel know > > that the callback provided by boot loader actually measures what it's > > supposed to