Re: [RFC PATCH] kern/dl: Add module version check

2022-12-21 Thread Zhang Boyang
Hi, On 2022/12/21 03:04, Glenn Washburn wrote: On Mon, 19 Dec 2022 23:33:29 +0800 Zhang Boyang wrote: This patch add version information to GRUB modules. Specifically, PACKAGE_VERSION is embedded as null-terminated string in .modver section. This string is checked at module loading time. That

Re: [RFC PATCH] kern/dl: Add module version check

2022-12-21 Thread Zhang Boyang
Hi, On 2022/12/21 10:43, Pete Batard via Grub-devel wrote: Hello all, On 2022.12.20 22:58, Robbie Harwood wrote: Zhang Boyang writes: This patch add version information to GRUB modules. Specifically, PACKAGE_VERSION is embedded as null-terminated string in .modver section. This string is ch

Re: [RFC PATCH] kern/dl: Add module version check

2022-12-21 Thread Thomas Schmitt
Hi, Pete Batard wrote: > > unlike what is the case for UEFI, one can not expect > > to be able to pick all the GRUB core files needed to convert a GRUB > > based ISO bootable media to a GRUB based USB bootable media [...] > > Typically, one of the > > missing files will be a 'core.img' that can wo

Re: [RFC PATCH] kern/dl: Add module version check

2022-12-21 Thread Didier Spaier
Le 21/12/2022 à 09:43, Thomas Schmitt a écrit : > I think that in any case an ISO made by grub-mkrescue should be tested. > Maybe a distro developer is here who uses it for making a full fledged > installation ISO or a live ISO. I do for making a full fledged installation ISO in this function, wit

Re: [RFC PATCH] kern/dl: Add module version check

2022-12-21 Thread Zhang Boyang
Hi, On 2022/12/21 17:43, Thomas Schmitt wrote: Hi, Pete Batard wrote: unlike what is the case for UEFI, one can not expect to be able to pick all the GRUB core files needed to convert a GRUB based ISO bootable media to a GRUB based USB bootable media [...] Typically, one of the missing files w

[RFC PATCH v2 1/1] kern/dl: Add module version check

2022-12-21 Thread Zhang Boyang
This patch add version information to GRUB modules. Specifically, PACKAGE_VERSION is embedded as null-terminated string in .modver section. This string is checked at module loading time. If GRUB is locked down, modules with mismatched version will be rejected. This is necessary for implementing ex

Re: [PATCH v2 2/3] term/serial: Add support for PCI serial devices

2022-12-21 Thread Daniel Kiper
Sorry for late reply... May I ask you to send the patches using "git send-email"? On Fri, Aug 26, 2022 at 01:01:44PM +0200, pet...@infradead.org wrote: > Loosely based on early_pci_serial_init() from Linux, allow GRUB to make > use of PCI serial devices. > > Specifically, my Alderlake NUC exposes

Re: [PATCH 3/7] ns8250: Add base support for MMIO UARTs

2022-12-21 Thread Daniel Kiper
On Fri, Dec 02, 2022 at 10:05:22AM +1100, Benjamin Herrenschmidt wrote: > From: Benjamin Herrenschmidt > > This adds the ability for the driver to access UARTs via MMIO instead > of PIO selectively at runtime, and exposes a new function to add an > MMIO port. > > Signed-off-by: Benjamin Herrenschm

Re: [PATCH 4/7] ns8250: Add configuration parameter when adding ports

2022-12-21 Thread Daniel Kiper
On Fri, Dec 02, 2022 at 10:05:23AM +1100, Benjamin Herrenschmidt wrote: > From: Benjamin Herrenschmidt > > This will allow ports to be added with a pre-set configuration > > Signed-off-by: Benjamin Herrenschmidt > --- > grub-core/term/ns8250.c | 25 +++-- > grub-core/term/ser

Re: [PATCH 5/7] ns8250: Use ACPI SPCR table when available to configure serial

2022-12-21 Thread Daniel Kiper
On Fri, Dec 02, 2022 at 10:05:24AM +1100, Benjamin Herrenschmidt wrote: > From: Benjamin Herrenschmidt > > "serial auto" is now equivalent to just "serial" and will use the > SPCR to discover the port if present, otherwise defaults to "com0" > as before. > > This allows to support MMIO ports speci

Re: [PATCH 6/7] ns8250: Support more MMIO access sizes

2022-12-21 Thread Daniel Kiper
On Fri, Dec 02, 2022 at 10:05:25AM +1100, Benjamin Herrenschmidt wrote: > From: Benjamin Herrenschmidt > > It is common for PCI based UARTs to use larger than one byte access > sizes. This adds support for this and uses the information present > in SPCR accordingly. > > Signed-off-by: Benjamin Her

Re: [PATCH 7/7] serial: Add ability to specify MMIO ports via 'serial'

2022-12-21 Thread Daniel Kiper
On Fri, Dec 02, 2022 at 10:05:26AM +1100, Benjamin Herrenschmidt wrote: > From: Benjamin Herrenschmidt > > This adds the ability to explicitely add an MMIO based serial port > via the 'serial' command. The syntax is: > > serial --port=mmio,{.b,.w,.l,.q} > > Signed-off-by: Benjamin Herrenschmidt >

Re: [RESEND PATCH 0/7] serial: Add MMIO & SPCR support

2022-12-21 Thread Daniel Kiper
On Fri, Dec 02, 2022 at 10:05:19AM +1100, Benjamin Herrenschmidt wrote: > This series adds support for MMIO serial ports and auto-configuration > via ACPI SPCR. > > This is necessary for the serial port to work on AWS EC2 "metal" x86 > systems. > > An MMIO serial port can be specified explicitely u

Re: [RFC PATCH] kern/dl: Add module version check

2022-12-21 Thread Pete Batard via Grub-devel
Hi Zhang, On 2022.12.21 11:38, Zhang Boyang wrote: Hi, On 2022/12/21 17:43, Thomas Schmitt wrote: Hi, Pete Batard wrote: unlike what is the case for UEFI, one can not expect to be able to pick all the GRUB core files needed to convert a GRUB based ISO bootable media to a GRUB based USB boota

Re: [PATCH v4 04/15] gdb: Move runtime module loading into runtime_load_module

2022-12-21 Thread Daniel Kiper
On Thu, Dec 15, 2022 at 11:29:27PM -0600, Glenn Washburn wrote: Why? Could you add that to the commit message? > Signed-off-by: Glenn Washburn > --- > grub-core/gdb_grub.in | 20 +--- > 1 file changed, 13 insertions(+), 7 deletions(-) > > diff --git a/grub-core/gdb_grub.in b/gru

Re: [PATCH v4 08/15] gdb: If enabled, print line used to load EFI kernel symbols when using gdb_grub script

2022-12-21 Thread Daniel Kiper
Adding Robbie... Please CC him next time when you post these patches. I would want to hear his opinion too. Or at least he is aware what is happening here... On Thu, Dec 15, 2022 at 11:29:31PM -0600, Glenn Washburn wrote: > If the macro PRINT_GDB_SYM_LOAD_CMD is non-zero, compile code which will

Re: [PATCH v4 12/15] gdb: Allow running user-defined commands at GRUB start

2022-12-21 Thread Daniel Kiper
On Thu, Dec 15, 2022 at 11:29:35PM -0600, Glenn Washburn wrote: > A new command, run_on_start, is created which handles some complexities > of the EFI platform when breaking on GRUB start. If GRUB start is hooked, > run "onstart" command if it is defned. > > Signed-off-by: Glenn Washburn > --- >

Re: [PATCH v4 13/15] gdb: Add extra early initialization symbols for i386-pc

2022-12-21 Thread Daniel Kiper
On Thu, Dec 15, 2022 at 11:29:36PM -0600, Glenn Washburn wrote: > Add symbols for boot.image, disk.image, and lzma_decompress.image if the > target is i386-pc. Why? > Signed-off-by: Glenn Washburn > --- > grub-core/gdb_grub.in | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/grub-

Re: [RFC PATCH v2 1/1] kern/dl: Add module version check

2022-12-21 Thread Pete Batard via Grub-devel
Hi again Zhang, I hadn't had a chance to properly look at your v2 before replying earlier, and it looks like it addresses the elements I had an issue with. On 2022.12.21 12:11, Zhang Boyang wrote: This patch add version information to GRUB modules. Specifically, PACKAGE_VERSION is embedded as

Re: [PATCH v4 15/15] docs: Add debugging chapter to development documentation

2022-12-21 Thread Daniel Kiper
On Thu, Dec 15, 2022 at 11:29:38PM -0600, Glenn Washburn wrote: > Signed-off-by: Glenn Washburn > --- > docs/grub-dev.texi | 191 + > 1 file changed, 191 insertions(+) > > diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi > index f76fc658bf..8171e91c

Re: [PATCH v2 3/3] pci: Rename GRUB_PCI_CLASS_*

2022-12-21 Thread Daniel Kiper
On Fri, Aug 26, 2022 at 01:01:45PM +0200, pet...@infradead.org wrote: > Glenn suggested to rename the existing PCI_CLASS defines to have > explicit class and subclass names. > > Suggested-by: Glenn Washburn > Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Kiper Daniel _

Re: [PATCH v2 1/2] mm: Adjust new region size to take management overhead into account

2022-12-21 Thread Zhang Boyang
Hi, On 2022/12/21 01:16, Daniel Kiper wrote: Please do not send your new sets of patches as a reply to previous discussions. If you do that then it is more difficult to find them in threaded views. OK. I will not do that in future. On Thu, Dec 15, 2022 at 07:19:23PM +0800, Zhang Boyang wrot

Re: [RFC PATCH] kern/dl: Add module version check

2022-12-21 Thread Glenn Washburn
On Wed, 21 Dec 2022 16:07:27 +0800 Zhang Boyang wrote: > Hi, > > On 2022/12/21 03:04, Glenn Washburn wrote: > > On Mon, 19 Dec 2022 23:33:29 +0800 > > Zhang Boyang wrote: > > > >> This patch add version information to GRUB modules. Specifically, > >> PACKAGE_VERSION is embedded as null-termina

Re: [PATCH v4 08/15] gdb: If enabled, print line used to load EFI kernel symbols when using gdb_grub script

2022-12-21 Thread Glenn Washburn
On Wed, 21 Dec 2022 16:20:17 +0100 Daniel Kiper wrote: > Adding Robbie... > > Please CC him next time when you post these patches. I would want to > hear his opinion too. Or at least he is aware what is happening > here... Sure, I CC'd him and Peter on the first couple of ones. But there was ne

Re: [RFC PATCH] kern/dl: Add module version check

2022-12-21 Thread Robbie Harwood
Zhang Boyang writes: > On 2022/12/21 06:58, Robbie Harwood wrote: >> Zhang Boyang writes: >> >>> This patch add version information to GRUB modules. Specifically, >>> PACKAGE_VERSION is embedded as null-terminated string in .modver >>> section. This string is checked at module loading time. Tha

Re: [PATCH v4 12/15] gdb: Allow running user-defined commands at GRUB start

2022-12-21 Thread Glenn Washburn
On Wed, 21 Dec 2022 16:27:40 +0100 Daniel Kiper wrote: > On Thu, Dec 15, 2022 at 11:29:35PM -0600, Glenn Washburn wrote: > > A new command, run_on_start, is created which handles some > > complexities of the EFI platform when breaking on GRUB start. If > > GRUB start is hooked, run "onstart" comm

Re: [PATCH v4 13/15] gdb: Add extra early initialization symbols for i386-pc

2022-12-21 Thread Glenn Washburn
On Wed, 21 Dec 2022 16:28:35 +0100 Daniel Kiper wrote: > On Thu, Dec 15, 2022 at 11:29:36PM -0600, Glenn Washburn wrote: > > Add symbols for boot.image, disk.image, and lzma_decompress.image > > if the target is i386-pc. > > Why? Why not? I'm not clear on what your objection is. This is for deb

Re: [RESEND PATCH 0/7] serial: Add MMIO & SPCR support

2022-12-21 Thread Benjamin Herrenschmidt
On Wed, 2022-12-21 at 15:15 +0100, Daniel Kiper wrote: > > First of all sorry for very late reply. I sent you my comments. There > are some important problems plus some nitpicks which have to be > fixed. > Though I like the patch set in general. Than you for doing this work. Thanks ! I'll try to

Re: [PATCH 3/7] ns8250: Add base support for MMIO UARTs

2022-12-21 Thread Benjamin Herrenschmidt
Thanks for your review ! I'll address everything. Small "nits": On Wed, 2022-12-21 at 14:25 +0100, Daniel Kiper wrote: > > + > > +char * > > +grub_serial_ns8250_add_mmio(grub_addr_t addr) > > +{ > > +  struct grub_serial_port *p; > > +  unsigned i; > > Please add en empty line here. Ack. I cop

Re: [PATCH 7/7] serial: Add ability to specify MMIO ports via 'serial'

2022-12-21 Thread Benjamin Herrenschmidt
On Wed, 2022-12-21 at 15:11 +0100, Daniel Kiper wrote: > > +  if (!port && grub_memcmp (name, "mmio,", sizeof ("mmio,") - 1) == 0 > > I think grub_strncmp() in string context would be more appropriate. > Please replace grub_memcmp() with grub_strncmp() where possible. Same comment as patch 3, thi

Re: [PATCH v4 12/15] gdb: Allow running user-defined commands at GRUB start

2022-12-21 Thread Glenn Washburn
On Wed, 21 Dec 2022 12:19:16 -0600 Glenn Washburn wrote: > On Wed, 21 Dec 2022 16:27:40 +0100 > Daniel Kiper wrote: > > > On Thu, Dec 15, 2022 at 11:29:35PM -0600, Glenn Washburn wrote: > > > A new command, run_on_start, is created which handles some > > > complexities of the EFI platform when

Re: [PATCH v4 15/15] docs: Add debugging chapter to development documentation

2022-12-21 Thread Glenn Washburn
On Wed, 21 Dec 2022 11:07:38 +0800 Jeremy Szu wrote: > On Fri, Dec 16, 2022 at 1:33 PM Glenn Washburn > wrote: > > > > Signed-off-by: Glenn Washburn > > --- > > docs/grub-dev.texi | 191 > > + 1 file changed, 191 > > insertions(+) > > > > diff --git a

[PATCH v2 0/8] serial: Add MMIO & SPCR support

2022-12-21 Thread Benjamin Herrenschmidt
This series adds support for MMIO serial ports and auto-configuration via ACPI SPCR. This is necessary for the serial port to work on AWS EC2 "metal" x86 systems. An MMIO serial port can be specified explicitely using the "mmio," prefix for the --port argument to the 'serial' command, the registe

[PATCH v2 6/8] ns8250: Use ACPI SPCR table when available to configure serial

2022-12-21 Thread Benjamin Herrenschmidt
From: Benjamin Herrenschmidt "serial auto" is now equivalent to just "serial" and will use the SPCR to discover the port if present, otherwise defaults to "com0" as before. This allows to support MMIO ports specified by ACPI which is needed on AWS EC2 "metal" instances, and will enable GRUB to p

[PATCH v2 2/8] acpi: Add SPCR and generic address definitions

2022-12-21 Thread Benjamin Herrenschmidt
This adds the definition of the two ACPI tables according to the spec. Signed-off-by: Benjamin Herrenschmidt --- include/grub/acpi.h | 51 + 1 file changed, 51 insertions(+) diff --git a/include/grub/acpi.h b/include/grub/acpi.h index 8c126b2b9..17aad

[PATCH v2 1/8] acpi: Export a generic grub_acpi_find_table

2022-12-21 Thread Benjamin Herrenschmidt
And convert grub_acpi_find_fadt to use it Signed-off-by: Benjamin Herrenschmidt --- grub-core/kern/acpi.c | 43 +-- include/grub/acpi.h | 3 +++ 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/grub-core/kern/acpi.c b/grub-core/kern/acpi

[PATCH v2 7/8] ns8250: Support more MMIO access sizes

2022-12-21 Thread Benjamin Herrenschmidt
From: Benjamin Herrenschmidt It is common for PCI based UARTs to use larger than one byte access sizes. This adds support for this and uses the information present in SPCR accordingly. Signed-off-by: Benjamin Herrenschmidt --- grub-core/term/ns8250-spcr.c | 3 +- grub-core/term/ns8250.c

[PATCH v2 3/8] ns8250: Add base support for MMIO UARTs

2022-12-21 Thread Benjamin Herrenschmidt
From: Benjamin Herrenschmidt This adds the ability for the driver to access UARTs via MMIO instead of PIO selectively at runtime, and exposes a new function to add an MMIO port. In an ideal world, MMIO accessors would be generic and have architecture specific memory barriers. However, existing d

[PATCH v2 8/8] serial: Add ability to specify MMIO ports via 'serial'

2022-12-21 Thread Benjamin Herrenschmidt
From: Benjamin Herrenschmidt This adds the ability to explicitely add an MMIO based serial port via the 'serial' command. The syntax is: serial --port=mmio,{.b,.w,.l,.q} Signed-off-by: Benjamin Herrenschmidt --- docs/grub.texi | 26 ++-- grub-core/term/serial.c | 53 +

[PATCH v2 4/8] ns8250: Move base clock definition to a header

2022-12-21 Thread Benjamin Herrenschmidt
And while at it, unify it as clock frequency in HZ, to match the value in "struct grub_serial_config" and do the division by 16 in one common place. This will simplify adding SPCR support. Signed-off-by: Benjamin Herrenschmidt --- grub-core/term/ns8250.c | 15 --- include/grub/ns825

[PATCH v2 5/8] ns8250: Add configuration parameter when adding ports

2022-12-21 Thread Benjamin Herrenschmidt
From: Benjamin Herrenschmidt This will allow ports to be added with a pre-set configuration Signed-off-by: Benjamin Herrenschmidt --- grub-core/term/ns8250.c | 27 --- grub-core/term/serial.c | 2 +- include/grub/serial.h | 4 ++-- 3 files changed, 23 insertions(+),

Re: [RFC PATCH v2 1/1] kern/dl: Add module version check

2022-12-21 Thread Glenn Washburn
On Wed, 21 Dec 2022 20:11:57 +0800 Zhang Boyang wrote: > This patch add version information to GRUB modules. Specifically, > PACKAGE_VERSION is embedded as null-terminated string in .modver > section. This string is checked at module loading time. > > If GRUB is locked down, modules with mismatc