On Sun, Jul 27, 2025 at 2:57 AM Alec Brown via Grub-devel
wrote:
>
> Add the functions grub_strtok() and grub_strtok_r() to help parse strings into
> tokens separated by characters in the 'delim' parameter. These functions are
> present in gnulib but calling them directly from the gnulib code is q
On Fri, Jul 25, 2025 at 1:56 PM Daniel Kiper wrote:
>
> Next time when you post Xen patches please CC Xen-devel too.
>
> On Mon, Jul 21, 2025 at 05:25:57PM +0100, Frediano Ziglio via Grub-devel
> wrote:
> > "cmdline_size" already account for NUL terminator, you
"cmdline_size" already account for NUL terminator, you can see
this in "xen_boot_binary_load".
The same property is set correctly for Xen command line.
Signed-off-by: Frediano Ziglio
---
grub-core/loader/arm64/xen_boot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-co
From UEFI specifications 2.10, section 13.2.2,
"EFI_LOAD_FILE2_PROTOCOL.LoadFile" (see
https://uefi.org/specs/UEFI/2.10/13_Protocols_Media_Access.html),
for BufferSize:
On input the size of Buffer in bytes. On output with a return code
of EFI_SUCCESS, the amount of data transferred to Buff
On Tue, Jul 15, 2025 at 1:37 PM Daniel Kiper wrote:
>
> On Mon, Jul 14, 2025 at 09:08:48AM +0100, Frediano Ziglio via Grub-devel
> wrote:
> > From UEFI specifications 2.10, section 13.2.2,
> > "EFI_LOAD_FILE2_PROTOCOL.LoadFile" (see
>
From UEFI specifications 2.10, section 13.2.2,
"EFI_LOAD_FILE2_PROTOCOL.LoadFile" (see
https://uefi.org/specs/UEFI/2.10/13_Protocols_Media_Access.html),
for BufferSize:
On input the size of Buffer in bytes. On output with a return code
of EFI_SUCCESS, the amount of data transferred to Buff
From UEFI specifications 2.10, section 13.2.2,
"EFI_LOAD_FILE2_PROTOCOL.LoadFile" (see
https://uefi.org/specs/UEFI/2.10/13_Protocols_Media_Access.html),
for BufferSize:
On input the size of Buffer in bytes. On output with a return code
of EFI_SUCCESS, the amount of data transferred to Buff
According to specifications, for BufferSize:
On output with a return code of EFI_SUCCESS, the amount of data
transferred to Buffer.
so set *buffer_size correctly.
Signed-off-by: Frediano Ziglio
---
grub-core/loader/efi/linux.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/grub-co
On Wed, Jul 9, 2025 at 2:08 PM Ross Lagerwall wrote:
>
> On Tue, Jul 8, 2025 at 9:02 PM Frediano Ziglio via Grub-devel
> wrote:
> >
> > Allows to load modules using LoadFile2 protocol.
> > Add and use a new GUID for kernel media device.
> > This will allow Xen to
On Wed, Jul 9, 2025 at 11:30 AM Ross Lagerwall
wrote:
>
> On Tue, Jul 8, 2025 at 9:02 PM Frediano Ziglio via Grub-devel
> wrote:
> >
> > Allows to load modules using LoadFile2 protocol.
> > Add and use a new GUID for kernel media device.
> > This will allow
On Wed, Jul 9, 2025 at 10:54 AM Ross Lagerwall
wrote:
>
> On Wed, Jul 9, 2025 at 10:35 AM Frediano Ziglio via Grub-devel
> wrote:
> >
> > On Tue, Jul 8, 2025 at 11:43 AM Frediano Ziglio
> > wrote:
> > >
> > > Compile for x86_64 EFI architecture.
&
On Wed, Jul 9, 2025 at 11:47 AM Ross Lagerwall
wrote:
>
> On Tue, Jul 8, 2025 at 8:26 PM Frediano Ziglio via Grub-devel
> wrote:
> >
> > For ARM64 command lines are passed using device tree, for
> > x86_64 we need to use LoadOptions putting both Xen and kernel
>
On Tue, Jul 8, 2025 at 11:43 AM Frediano Ziglio
wrote:
>
> Compile for x86_64 EFI architecture.
> Do not fill device tree, not present for this architecture.
>
> Signed-off-by: Frediano Ziglio
> ---
> grub-core/Makefile.core.def | 2 ++
> grub-core/loader/arm64/xen_boot.c | 13 +++
Compile for x86_64 EFI architecture.
Do not fill device tree, not present for this architecture.
Signed-off-by: Frediano Ziglio
---
grub-core/Makefile.core.def | 2 ++
grub-core/loader/arm64/xen_boot.c | 13 +
2 files changed, 15 insertions(+)
diff --git a/grub-core/Makefile.
Add an element at the end of a list.
Signed-off-by: Frediano Ziglio
---
grub-core/kern/list.c | 10 ++
include/grub/list.h | 1 +
2 files changed, 11 insertions(+)
diff --git a/grub-core/kern/list.c b/grub-core/kern/list.c
index 09761b0e5..c5bdaf94b 100644
--- a/grub-core/kern/list.c
Counts elements in a list.
Signed-off-by: Frediano Ziglio
---
grub-core/kern/list.c | 12
include/grub/list.h | 2 ++
2 files changed, 14 insertions(+)
diff --git a/grub-core/kern/list.c b/grub-core/kern/list.c
index a256bb3f8..09761b0e5 100644
--- a/grub-core/kern/list.c
+++ b/
Currently xen_hypervisor and xen_module commands are available only for
ARM64 EFI.
For x86_64 if the Xen format is portable executable there's no way to
pass multiple modules (the feature is available using multiboot2 but
only for ELF files).
So instead on adding new GRUB commands reuse the already
Allows to load modules using LoadFile2 protocol.
Add and use a new GUID for kernel media device.
This will allow Xen to pick up additional modules using
EFI interface instead of using multiboot2 interface (not
available on x86_64).
Signed-off-by: Frediano Ziglio
---
grub-core/loader/arm64/xen_bo
For ARM64 command lines are passed using device tree, for
x86_64 we need to use LoadOptions putting both Xen and kernel
arguments.
On x86_64 the LoadOptions is composed by 2 parts, EFI options
and Xen options. The Xen options is composed by Xen options and,
optionally, kernel options.
In order to h
The Xen image is loaded alignment, not always at "start".
Signed-off-by: Frediano Ziglio
---
Changes since v1:
- indentation changes
---
grub-core/loader/arm64/xen_boot.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/grub-core/loader/arm64/xen_boot.c
b/grub-core/lo
On Fri, Jul 4, 2025 at 4:20 PM Sudhakar Kuppusamy
wrote:
>
>
>
> > On 4 Jul 2025, at 7:36 PM, Frediano Ziglio via Grub-devel
> > wrote:
> >
> > The Xen image is loaded alignment, not always at "start".
> >
> > Signed-off-by: Frediano Zig
On Fri, Jul 4, 2025 at 4:13 PM Sudhakar Kuppusamy
wrote:
>
>
>
> > On 4 Jul 2025, at 7:35 PM, Frediano Ziglio via Grub-devel
> > wrote:
> >
> > More readable, could consume less space.
> >
> > Signed-off-by: Frediano Ziglio
>
More readable, could consume less space.
Signed-off-by: Frediano Ziglio
---
grub-core/loader/arm64/xen_boot.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/grub-core/loader/arm64/xen_boot.c
b/grub-core/loader/arm64/xen_boot.c
index 731f1913a..8db1d9db0 10064
The Xen image is loaded alignment, not always at "start".
Signed-off-by: Frediano Ziglio
---
grub-core/loader/arm64/xen_boot.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/grub-core/loader/arm64/xen_boot.c
b/grub-core/loader/arm64/xen_boot.c
index 8db1d9db0..26
We need to use FOR_LIST_ELEMENTS_SAFE instead of FOR_LIST_ELEMENTS
as single_binary_unload, called during the loop, is changing
the list using grub_list_remove.
Given the environment probably the old code simply deleted only the
first module on the list not freeing all the others.
Signed-off-by: F
This is more consistent with the above code using
sizeof (grub_efi_char16_t).
Signed-off-by: Frediano Ziglio
---
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
index 3b5c4ed17..9df49
If the following allocation fails this would leave "load_options"
NULL while "load_options_size" not valid.
If the allocation succeed "load_options_size" is overwritten.
Signed-off-by: Frediano Ziglio
Reviewed-by: Daniel Kiper
---
grub-core/loader/efi/linux.c | 3 +--
1 file changed, 1 insertio
The size passed to grub_utf8_to_utf16 for the source string is
used as a limit for the string if NUL character is not encountered
however len, which is strlen(src)*2+2 is surely greater than
strlen(src).
Pass the exact correct length.
Signed-off-by: Frediano Ziglio
---
Changes since v3:
- pass ex
This is more consistent with the above code using
sizeof (grub_efi_char16_t).
Signed-off-by: Frediano Ziglio
Reviewed-by: Daniel Kiper
---
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/lin
The series started from the issue that LoadOptions, if providing just
command line arguments should be NUL-terminated.
But this carried some updates to adjust the code properly.
Changes since v3:
- use proper length converting args string;
- added Reviewed-by comments.
Frediano Ziglio (6):
load
Although the length should not exceed 2^31 grub_size_t is more
suitable for that variable. "len" is used to compute the size
of buffers which in C is a size_t, not a int. It is used
for GRUB_EFI_BYTES_TO_PAGES which expects unsigned values.
It is assigned to load_options_size which is unsigned, not
(grub_size_t) -1 is never returned, the function always return
a not negative values. This is important for overflows considerations.
Signed-off-by: Frediano Ziglio
Reviewed-by: Daniel Kiper
---
include/grub/charset.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include
If a simple string for arguments are passed it should be NUL
terminated. This is true for other code but not for "linux"
command.
Signed-off-by: Frediano Ziglio
---
Changes since v1
- remove useless assignment.
Changes since v2
- split changes;
- correct spacing.
---
grub-core/loader/efi/linux.
On Wed, Jun 25, 2025 at 1:41 PM Daniel Kiper wrote:
>
> In general patches #1, #2, #4 and #5 make sense for me. So, you can add
> my RB there...
>
> On Wed, Jun 25, 2025 at 07:42:27AM +0100, Frediano Ziglio via Grub-devel
> wrote:
> > If a simple string for arguments are
On Wed, Jun 25, 2025 at 1:27 PM Daniel Kiper wrote:
>
> On Wed, Jun 25, 2025 at 07:42:24AM +0100, Frediano Ziglio via Grub-devel
> wrote:
> > The size passed to grub_utf8_to_utf16 for the source string is
> > used as a limit for the string if NUL character is not encoun
On Tue, Jun 24, 2025 at 4:48 PM Daniel Kiper wrote:
>
> On Tue, Jun 24, 2025 at 09:01:14AM +0100, Frediano Ziglio via Grub-devel
> wrote:
> > If a simple string for arguments are passed it should be NUL
> > terminated. This is true for other code but not for "linux&qu
If a simple string for arguments are passed it should be NUL
terminated. This is true for other code but not for "linux"
command.
Signed-off-by: Frediano Ziglio
---
Changes since v1
- remove useless assignment.
Changes since v2
- split changes;
- correct spacing.
---
grub-core/loader/efi/linux.
The size passed to grub_utf8_to_utf16 for the source string is
used as a limit for the string if NUL character is not encountered
however len, which is strlen(src)*2+2 is surely greater than
strlen(src).
Pass (grub_size_t) -1 to consider only NUL terminator.
Signed-off-by: Frediano Ziglio
---
gr
If the following allocation fails this would leave "load_options"
NULL while "load_options_size" not valid.
If the allocation succeed "load_options_size" is overwritten.
Signed-off-by: Frediano Ziglio
---
grub-core/loader/efi/linux.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff
Although the length should not exceed 2^31 grub_size_t is more
suitable for that variable. "len" is used to compute the size
of buffers which in C is a size_t, not a int. It is used
for GRUB_EFI_BYTES_TO_PAGES which expects unsigned values.
It is assigned to load_options_size which is unsigned, not
(grub_size_t) -1 is never returned, the function always return
a not negative values. This is important for overflows considerations.
Signed-off-by: Frediano Ziglio
---
include/grub/charset.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/grub/charset.h b/include/g
If a simple string for arguments are passed it should be NUL
terminated. This is true for other code but not for "linux"
command.
Signed-off-by: Frediano Ziglio
---
Changes since v1
- remove useless assignment.
---
grub-core/loader/efi/linux.c | 13 +++--
1 file changed, 7 insertions(+),
On Mon, Jun 23, 2025 at 2:46 PM Ross Lagerwall
wrote:
>
> On Mon, Jun 23, 2025 at 12:33 PM Frediano Ziglio via Grub-devel
> wrote:
> >
> > If a simple string for arguments are passed it should be NUL
> > terminated. This is true for other code but not for "linux&
If a simple string for arguments are passed it should be NUL
terminated. This is true for other code but not for "linux"
command.
Signed-off-by: Frediano Ziglio
---
grub-core/loader/efi/linux.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/grub-core/loader/efi/linu
On Thu, Sep 19, 2024 at 5:33 PM Mate Kukri wrote:
>
> Signed-off-by: Mate Kukri
> ---
> grub-core/kern/efi/sb.c | 28
> grub-core/loader/efi/linux.c | 12 +++-
> include/grub/efi/api.h | 2 ++
> include/grub/efi/sb.h| 2 ++
> 4 files chan
On Thu, Sep 19, 2024 at 11:03 PM Sergii Dmytruk
wrote:
>
> From: Krystian Hebel
>
> Subsequent patches will use those macros and constant.
>
Minor, but "Define GRUB_PAGE_MASK constant and GRUB_PAGE_{UP, DOWN}
macros" subject sounds a bit confusing to me. I mean, at the end they
are all defined a
Signed-off-by: Frediano Ziglio
---
grub-core/loader/efi/linux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
Changes since v1:
- split pointer reset.
diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
index 803d2541d..cbb480b34 100644
--- a/grub-core/loader
Avoid dangling pointer.
Code should not be reached but better safe than sorry.
Signed-off-by: Frediano Ziglio
---
grub-core/loader/efi/linux.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
index cbb480b34..1ffbcf9ce 100644
--- a/g
The instruction uses a 64 bit immediate.
Signed-off-by: Frediano Ziglio
---
grub-core/lib/x86_64/relocator_asm.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/lib/x86_64/relocator_asm.S
b/grub-core/lib/x86_64/relocator_asm.S
index 2ab6d8cb7..fd9b2b44e 100644
---
Signed-off-by: Frediano Ziglio
---
grub-core/loader/efi/linux.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
index 803d2541d..1ffbcf9ce 100644
--- a/grub-core/loader/efi/linux.c
+++ b/grub-core/loader/efi/linu
The function called is grub_utf8_to_utf16.
Signed-off-by: Frediano Ziglio
---
grub-core/loader/efi/linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
index bfbd95aee..803d2541d 100644
--- a/grub-core/loader/efi/
Used also in other assembly files.
They are single 64-bit values.
Signed-off-by: Frediano Ziglio
---
grub-core/lib/x86_64/relocator_asm.S | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/grub-core/lib/x86_64/relocator_asm.S
b/grub-core/lib/x86_64/relocator_asm.S
52 matches
Mail list logo