* [PATCH 1/1] ACPI: XSDT: struct acpi_table_xsdt must be packed
@ 2023-11-11 13:48 Heinrich Schuchardt
2023-12-06 16:30 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Heinrich Schuchardt @ 2023-11-11 13:48 UTC (permalink / raw)
To: Robert Moore, Rafael J . Wysocki
Cc: Len Brown, linux-acpi, acpica-devel, linux-kernel, Heinrich Schuchardt
According to the ACPI 6.5 specification the component Entry starts at
offset 36 in the XSDT table which is not a multiple of 8. Hence we must
mark the structure as packed.
We did not see an error due to the incorrect packing yet as in
acpi_tb_parse_root_table() we use ACPI_ADD_PTR() to find the address of
Entry.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
include/acpi/actbl.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 451f6276da49..1a37ac378765 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -148,7 +148,7 @@ struct acpi_table_rsdt {
struct acpi_table_xsdt {
struct acpi_table_header header; /* Common ACPI table header */
u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
-};
+} __packed;
#define ACPI_RSDT_ENTRY_SIZE (sizeof (u32))
#define ACPI_XSDT_ENTRY_SIZE (sizeof (u64))
--
2.40.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 1/1] ACPI: XSDT: struct acpi_table_xsdt must be packed
2023-11-11 13:48 [PATCH 1/1] ACPI: XSDT: struct acpi_table_xsdt must be packed Heinrich Schuchardt
@ 2023-12-06 16:30 ` Rafael J. Wysocki
2023-12-06 16:37 ` Heinrich Schuchardt
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2023-12-06 16:30 UTC (permalink / raw)
To: Heinrich Schuchardt
Cc: Robert Moore, Rafael J . Wysocki, Len Brown, linux-acpi,
acpica-devel, linux-kernel
On Sat, Nov 11, 2023 at 2:48 PM Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> According to the ACPI 6.5 specification the component Entry starts at
> offset 36 in the XSDT table which is not a multiple of 8. Hence we must
> mark the structure as packed.
There is #pragma pack(1) at the beginning of actbl.h. Is it not sufficient?
> We did not see an error due to the incorrect packing yet as in
> acpi_tb_parse_root_table() we use ACPI_ADD_PTR() to find the address of
> Entry.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> include/acpi/actbl.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
> index 451f6276da49..1a37ac378765 100644
> --- a/include/acpi/actbl.h
> +++ b/include/acpi/actbl.h
> @@ -148,7 +148,7 @@ struct acpi_table_rsdt {
> struct acpi_table_xsdt {
> struct acpi_table_header header; /* Common ACPI table header */
> u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
> -};
> +} __packed;
>
> #define ACPI_RSDT_ENTRY_SIZE (sizeof (u32))
> #define ACPI_XSDT_ENTRY_SIZE (sizeof (u64))
> --
> 2.40.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 1/1] ACPI: XSDT: struct acpi_table_xsdt must be packed
2023-12-06 16:30 ` Rafael J. Wysocki
@ 2023-12-06 16:37 ` Heinrich Schuchardt
0 siblings, 0 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2023-12-06 16:37 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Robert Moore, Len Brown, linux-acpi, acpica-devel, linux-kernel
On 06.12.23 17:30, Rafael J. Wysocki wrote:
> On Sat, Nov 11, 2023 at 2:48 PM Heinrich Schuchardt
> <heinrich.schuchardt@canonical.com> wrote:
>>
>> According to the ACPI 6.5 specification the component Entry starts at
>> offset 36 in the XSDT table which is not a multiple of 8. Hence we must
>> mark the structure as packed.
>
> There is #pragma pack(1) at the beginning of actbl.h. Is it not sufficient?
Sorry I missed that pragma.
>
>> We did not see an error due to the incorrect packing yet as in
>> acpi_tb_parse_root_table() we use ACPI_ADD_PTR() to find the address of
>> Entry.
>>
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>> ---
>> include/acpi/actbl.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
>> index 451f6276da49..1a37ac378765 100644
>> --- a/include/acpi/actbl.h
>> +++ b/include/acpi/actbl.h
>> @@ -148,7 +148,7 @@ struct acpi_table_rsdt {
>> struct acpi_table_xsdt {
>> struct acpi_table_header header; /* Common ACPI table header */
>> u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
>> -};
>> +} __packed;
>>
>> #define ACPI_RSDT_ENTRY_SIZE (sizeof (u32))
>> #define ACPI_XSDT_ENTRY_SIZE (sizeof (u64))
>> --
>> 2.40.1
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-06 16:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-11 13:48 [PATCH 1/1] ACPI: XSDT: struct acpi_table_xsdt must be packed Heinrich Schuchardt
2023-12-06 16:30 ` Rafael J. Wysocki
2023-12-06 16:37 ` Heinrich Schuchardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®