Re: [PATCH v6 02/12] luks2: Use more intuitive slot key instead of index in user messages.

2020-12-02 Thread Glenn Washburn
On Wed, 2 Dec 2020 18:23:08 +0100 Daniel Kiper wrote: > On Fri, Nov 27, 2020 at 03:03:34AM -0600, Glenn Washburn wrote: > > Use the slot key name in the json array rather than the 0 based > > index in the json array for keyslots, segments, and digests. This > > is less confusing for the end user.

Re: [PATCH v6 01/12] luks2: Add slot_key member to struct grub_luks2_keyslot/segment/digest

2020-12-02 Thread Glenn Washburn
On Wed, 2 Dec 2020 18:01:47 +0100 Daniel Kiper wrote: > On Fri, Nov 27, 2020 at 03:03:33AM -0600, Glenn Washburn wrote: > > This allows code using these structs to know the named key > > associated with these json data structures. In the future we can > > use these to provide better error message

Re: [PATCH] arm-coreboot: Declare global struct ps2_state as static so symbols don't cause link failure

2020-12-02 Thread Glenn Washburn
Here is a log file showing the build failure. https://gitlab.com/grub2-testing/grub/-/jobs/885372725/raw On Thu, 3 Dec 2020 00:10:26 -0600 Glenn Washburn wrote: > This appears to be a new issue surfaced by switching from gcc 9.3.0 to > 10.1.0 cross compiling toolchain. When linking these two o

[PATCH] arm-coreboot: Declare global struct ps2_state as static so symbols don't cause link failure

2020-12-02 Thread Glenn Washburn
This appears to be a new issue surfaced by switching from gcc 9.3.0 to 10.1.0 cross compiling toolchain. When linking these two object files together, there is an error generated: "multiple definition of `ps2_state'". This only appears to be an issue when --target=arm-linux-gnueabi and --with-platf

Re: [SPECIFICATION RFC] The firmware and bootloader log specification

2020-12-02 Thread Julius Werner
Standardizing in-memory logging sounds like an interesting idea, especially with regards to components that can run on top of different firmware stacks (things like GRUB or TF-A). But I would be a bit wary of creating a "new standard to rule them all" and then expecting all projects to switch what

Re: [PATCH v6 05/12] luks2: grub_cryptodisk_t->total_sectors is the max number of device native sectors

2020-12-02 Thread Daniel Kiper
On Fri, Nov 27, 2020 at 03:03:37AM -0600, Glenn Washburn wrote: > We need to convert the sectors from the size of the underlying device to the > cryptodisk sector size; segment.size is in bytes which need to be converted > to cryptodisk sectors as well. And counter-intuitively, grub_disk_get_size >

Re: [PATCH v6 04/12] cryptodisk: Replace some literals with constants in grub_cryptodisk_endecrypt

2020-12-02 Thread Daniel Kiper
On Fri, Nov 27, 2020 at 03:03:36AM -0600, Glenn Washburn wrote: > This should improve readability of code by providing clues as to what the > value represents. The new macro GRUB_TYPE_BITS(type) returns the number of > bits allocated for type. Also add GRUB_TYPE_U_MAX/MIN(type) macros to get > the

Re: [PATCH v6 03/12] luks2: Remove unused argument in grub_error

2020-12-02 Thread Daniel Kiper
On Fri, Nov 27, 2020 at 03:03:35AM -0600, Glenn Washburn wrote: > Signed-off-by: Glenn Washburn Reviewed-by: Daniel Kiper Daniel ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

Re: [PATCH v6 02/12] luks2: Use more intuitive slot key instead of index in user messages.

2020-12-02 Thread Daniel Kiper
On Fri, Nov 27, 2020 at 03:03:34AM -0600, Glenn Washburn wrote: > Use the slot key name in the json array rather than the 0 based index in the > json array for keyslots, segments, and digests. This is less confusing for > the end user. For example, say you have a LUKS2 device with a key in slot 1 >

Re: [PATCH v6 01/12] luks2: Add slot_key member to struct grub_luks2_keyslot/segment/digest

2020-12-02 Thread Daniel Kiper
On Fri, Nov 27, 2020 at 03:03:33AM -0600, Glenn Washburn wrote: > This allows code using these structs to know the named key associated with > these json data structures. In the future we can use these to provide better > error messages to the user. > > Get rid of idx variable in luks2_get_keyslot

Re: [PATCH] efi/tpm: Extract duplicate code into independent functions

2020-12-02 Thread Daniel Kiper
On Thu, Oct 29, 2020 at 09:49:49PM +0800, Tianjia Zhang wrote: > Part of the code logic for processing the return value of efi > log_extend_event is repetitive and complicated. Extract the > repetitive code into an independent function. > > Signed-off-by: Tianjia Zhang Reviewed-by: Daniel Kiper

Re: [PATCH] efi/tpm: Add debug information for device protocol and eventlog

2020-12-02 Thread Daniel Kiper
On Thu, Oct 29, 2020 at 09:49:29PM +0800, Tianjia Zhang wrote: > Add a number of debug logs to the tpm module. The condition tag > for opening debugging is `tpm`. On TPM machines, this will bring > great convenience to diagnosis and debugging. > > Signed-off-by: Tianjia Zhang Reviewed-by: Daniel

Re: [PATCH] fs: Fix block lists not being able to address to end of disk sometimes

2020-12-02 Thread Daniel Kiper
On Mon, Nov 23, 2020 at 03:27:42AM -0600, Glenn Washburn wrote: > When checking if a block list goes past the end of the disk, make sure > the total size of the disk is in grub native sector sizes, otherwise there > will be blocks at the end of the disk unaccessible by block lists. > > Signed-off-b

Re: [PATCH] loopback: Do not automaticaly replace existing loopback dev, error instead

2020-12-02 Thread Daniel Kiper
On Fri, Nov 27, 2020 at 02:36:24AM -0600, Glenn Washburn wrote: > If there is a loopback device with the same name as the one to be created, > instead of closing the old one and replacing it with the new one, return an > error instead. If the loopback device was created, its probably being used > b

[PATCH 1/6] grub-core/bus/usb: Parse SuperSpeed companion descriptors

2020-12-02 Thread Patrick Rudolph
Parse the SS_ENDPOINT_COMPANION descriptor, which is only present on USB 3.0 capable devices and xHCI controllers. Make the descendp an array of pointers to the endpoint descriptor as it's no longer an continous array. Signed-off-by: Patrick Rudolph --- grub-core/bus/usb/serial/common.c | 2 +-

[PATCH 4/6] grub-core/bus/usb: Add function pointer for attach/detach events

2020-12-02 Thread Patrick Rudolph
The xHCI code needs to be called for attaching or detaching a device. Introduce two functions pointers and call it from the USB hub code. Will be used in future commits, currently this doesn't change any functionality. Signed-off-by: Patrick Rudolph --- grub-core/bus/usb/ehci.c | 2 ++ grub-

[PATCH 0/6] Add xHCI USB support

2020-12-02 Thread Patrick Rudolph
Add basic support for xHCI USB controllers. The code is based on seabios implementation, but has been heavily modified to match grubs internals. Changes done in version 2: * Code cleanup * Code style fixes * Don't leak memory buffers * Compile without warnings * Add more defines * Add more h

[PATCH 2/6] usb: Add enum for xHCI

2020-12-02 Thread Patrick Rudolph
Will be used in future patches. Signed-off-by: Patrick Rudolph --- include/grub/usb.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/grub/usb.h b/include/grub/usb.h index 0527a3e2b..f65ac4f5d 100644 --- a/include/grub/usb.h +++ b/include/grub/usb.h @@ -47,7 +47,8 @

Re: [PATCH v2] disk: Move hardcoded max disk size literal to a GRUB_DISK_MAX_SECTORS in disk.h

2020-12-02 Thread Daniel Kiper
On Mon, Nov 30, 2020 at 11:16:19PM -0600, Glenn Washburn wrote: > There is a hardcoded maximum disk size that can be read or written from, > currently set at 1EiB in grub_disk_adjust_range. Move the literal into a > macro in disk.h, so our assumptions are more visible. This hard coded limit > does

[PATCH 5/6] grub-core/bus/usb/usbhub: Add new private fields for xHCI controller

2020-12-02 Thread Patrick Rudolph
Store the root port number, the route, consisting out of the port ID in each nibble, and a pointer to driver private data. Signed-off-by: Patrick Rudolph --- grub-core/bus/usb/usbhub.c | 14 ++ include/grub/usb.h | 5 + 2 files changed, 15 insertions(+), 4 deletions(-)

[PATCH 3/6] usbtrans: Set default maximum packet size

2020-12-02 Thread Patrick Rudolph
Set the maximum packet size to 512 for SuperSpeed devices. Signed-off-by: Patrick Rudolph --- grub-core/bus/usb/usbtrans.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grub-core/bus/usb/usbtrans.c b/grub-core/bus/usb/usbtrans.c index 85f081fff..5b68f17f9 100644 --- a/grub-core/bus/usb/u

[PATCH 6/6] grub-core/bus/usb: Add xhci support

2020-12-02 Thread Patrick Rudolph
Add support for xHCI USB controllers. The code is based on seabios implementation, but has been heavily modified to match grubs internals. Changes done in version 2: * Code cleanup * Code style fixes * Don't leak memory buffers * Compile without warnings * Add more defines * Add more helper functi