Re: [PATCH] acpi: Mark MADT entries as packed.
On Mon, Nov 06, 2023 at 08:43:29PM +0100, Vladimir 'phcoder' Serbinenko wrote: > Le lun. 6 nov. 2023, 18:04, Daniel Kiper a écrit : > On Tue, Oct 31, 2023 at 08:20:14PM +0100, Vladimir 'phcoder' > Serbinenko wrote: > > From 9d03ab04df3b723058fb0b7c30576e1330cbad5d Mon Sep 17 00:00:00 > 2001 > > From: Vladimir Serbinenko > > Date: Tue, 31 Oct 2023 18:27:19 +0100 > > Subject: [PATCH] acpi: Mark MADT entries as packed. > > > > No alignment is guaranteed and in fact on my ia64 sapic is aligned > > to 4 bytes instead of 8 and causes a trap. It affects only rarely > used > > lsacpi command and so went unnoticed. > > At least you missed grub_acpi_madt_entry_header struct. It should > have > packed attribute too. > Nope. It has only uint8. So no need for packed Sorry, I did not take a look at the types. Yeah, you are right. This will not change anything. Though I would add it to align struct definitions with others. Lack of packed attribute is a bit confusing at first sight. Daniel ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH] acpi: Mark MADT entries as packed.
Le lun. 6 nov. 2023, 18:04, Daniel Kiper a écrit : > On Tue, Oct 31, 2023 at 08:20:14PM +0100, Vladimir 'phcoder' Serbinenko > wrote: > > From 9d03ab04df3b723058fb0b7c30576e1330cbad5d Mon Sep 17 00:00:00 2001 > > From: Vladimir Serbinenko > > Date: Tue, 31 Oct 2023 18:27:19 +0100 > > Subject: [PATCH] acpi: Mark MADT entries as packed. > > > > No alignment is guaranteed and in fact on my ia64 sapic is aligned > > to 4 bytes instead of 8 and causes a trap. It affects only rarely used > > lsacpi command and so went unnoticed. > > At least you missed grub_acpi_madt_entry_header struct. It should have > packed attribute too. > Nope. It has only uint8. So no need for packed > > Daniel > ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH] acpi: Mark MADT entries as packed.
On Tue, Oct 31, 2023 at 08:20:14PM +0100, Vladimir 'phcoder' Serbinenko wrote: > From 9d03ab04df3b723058fb0b7c30576e1330cbad5d Mon Sep 17 00:00:00 2001 > From: Vladimir Serbinenko > Date: Tue, 31 Oct 2023 18:27:19 +0100 > Subject: [PATCH] acpi: Mark MADT entries as packed. > > No alignment is guaranteed and in fact on my ia64 sapic is aligned > to 4 bytes instead of 8 and causes a trap. It affects only rarely used > lsacpi command and so went unnoticed. At least you missed grub_acpi_madt_entry_header struct. It should have packed attribute too. Daniel ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
[PATCH] acpi: Mark MADT entries as packed.
No alignment is guaranteed and in fact on my ia64 sapic is aligned to 4 bytes instead of 8 and causes a trap. It affects only rarely used lsacpi command and so went unnoticed. -- Regards Vladimir 'phcoder' Serbinenko From 9d03ab04df3b723058fb0b7c30576e1330cbad5d Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 31 Oct 2023 18:27:19 +0100 Subject: [PATCH] acpi: Mark MADT entries as packed. No alignment is guaranteed and in fact on my ia64 sapic is aligned to 4 bytes instead of 8 and causes a trap. It affects only rarely used lsacpi command and so went unnoticed. Signed-off-by: Vladimir Serbinenko --- include/grub/acpi.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/grub/acpi.h b/include/grub/acpi.h index 17aadb802..87220e337 100644 --- a/include/grub/acpi.h +++ b/include/grub/acpi.h @@ -112,7 +112,7 @@ struct grub_acpi_madt_entry_lapic grub_uint8_t acpiid; grub_uint8_t apicid; grub_uint32_t flags; -}; +} GRUB_PACKED; struct grub_acpi_madt_entry_ioapic { @@ -121,7 +121,7 @@ struct grub_acpi_madt_entry_ioapic grub_uint8_t pad; grub_uint32_t address; grub_uint32_t global_sys_interrupt; -}; +} GRUB_PACKED; struct grub_acpi_madt_entry_interrupt_override { @@ -148,7 +148,7 @@ struct grub_acpi_madt_entry_sapic grub_uint8_t pad; grub_uint32_t global_sys_interrupt_base; grub_uint64_t addr; -}; +} GRUB_PACKED; struct grub_acpi_madt_entry_lsapic { @@ -160,7 +160,7 @@ struct grub_acpi_madt_entry_lsapic grub_uint32_t flags; grub_uint32_t cpu_uid; grub_uint8_t cpu_uid_str[0]; -}; +} GRUB_PACKED; struct grub_acpi_madt_entry_platform_int_source { @@ -172,7 +172,7 @@ struct grub_acpi_madt_entry_platform_int_source grub_uint8_t sapic_vector; grub_uint32_t global_sys_int; grub_uint32_t src_flags; -}; +} GRUB_PACKED; enum { -- 2.39.2 ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel