Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39832 )
Change subject: arch/x86/tables: Move max ACPI table size to Kconfig ......................................................................
arch/x86/tables: Move max ACPI table size to Kconfig
The maximum ACPI table size is currently hardcoded to 144 KiB. When using QEMU with TPM enabled there is ~200 KiB of ACPI tables returned by the fw_cfg interface, so in order to allow this to be overridden by a mainboard move it to Kconfig.
Change-Id: Ib5baa8fe12cb9027a340875f1ccf5fef6f9460bd Signed-off-by: Duncan Laurie dlaurie@google.com --- M src/arch/x86/Kconfig M src/arch/x86/tables.c 2 files changed, 9 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/32/39832/1
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig index a4e5314..5c8c53a 100644 --- a/src/arch/x86/Kconfig +++ b/src/arch/x86/Kconfig @@ -322,4 +322,10 @@ table specifies links greater than 4, pirq_route_irqs will not function properly, unless this variable is correctly set.
+config MAX_ACPI_TABLE_SIZE_KB + int + default 144 + help + Set the maximum size of all ACPI tables. + endif diff --git a/src/arch/x86/tables.c b/src/arch/x86/tables.c index 066e635..c9c20ed 100644 --- a/src/arch/x86/tables.c +++ b/src/arch/x86/tables.c @@ -78,8 +78,7 @@ static unsigned long write_acpi_table(unsigned long rom_table_end) { unsigned long high_table_pointer; - -#define MAX_ACPI_SIZE (144 * 1024) + size_t max_acpi_size = CONFIG_MAX_ACPI_TABLE_SIZE_KB * KiB;
post_code(0x9c);
@@ -96,7 +95,7 @@ * how far we get. */ high_table_pointer = (unsigned long)cbmem_add(CBMEM_ID_ACPI, - MAX_ACPI_SIZE); + max_acpi_size); if (high_table_pointer) { unsigned long acpi_start = high_table_pointer; unsigned long new_high_table_pointer; @@ -104,7 +103,7 @@ rom_table_end = ALIGN_UP(rom_table_end, 16); new_high_table_pointer = write_acpi_tables(high_table_pointer); if (new_high_table_pointer > (high_table_pointer - + MAX_ACPI_SIZE)) + + max_acpi_size)) printk(BIOS_ERR, "ERROR: Increase ACPI size\n"); printk(BIOS_DEBUG, "ACPI tables: %ld bytes.\n", new_high_table_pointer - high_table_pointer);
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39832 )
Change subject: arch/x86/tables: Move max ACPI table size to Kconfig ......................................................................
Patch Set 1: Code-Review+2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39832 )
Change subject: arch/x86/tables: Move max ACPI table size to Kconfig ......................................................................
Patch Set 1: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/39832/1/src/arch/x86/tables.c File src/arch/x86/tables.c:
https://review.coreboot.org/c/coreboot/+/39832/1/src/arch/x86/tables.c@81 PS1, Line 81: size_t max_acpi_size = CONFIG_MAX_ACPI_TABLE_SIZE_KB * KiB; const?
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39832 )
Change subject: arch/x86/tables: Move max ACPI table size to Kconfig ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39832/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39832/1//COMMIT_MSG@13 PS1, Line 13: Please add the QEMU command line, how you tested this.
Duncan Laurie has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39832 )
Change subject: arch/x86/tables: Move max ACPI table size to Kconfig ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39832/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39832/1//COMMIT_MSG@13 PS1, Line 13:
Please add the QEMU command line, how you tested this.
Done
Hello build bot (Jenkins), Furquan Shaikh, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39832
to look at the new patch set (#2).
Change subject: arch/x86/tables: Move max ACPI table size to Kconfig ......................................................................
arch/x86/tables: Move max ACPI table size to Kconfig
The maximum ACPI table size is currently hardcoded to 144 KiB. When using QEMU with TPM enabled there is ~200 KiB of ACPI tables returned by the fw_cfg interface, so in order to allow this to be overridden by a mainboard move it to Kconfig.
This is seen when using a TPM with qemu as it will hang when processing the fw_cfg tables.
qemu-system-x86_64 \ -machine q35 -enable-kvm -vga virtio -serial stdio \ -drive 'id=hd,file=disk.bin' -bios coreboot.rom \ -chardev 'socket,id=swtpm,path=/tmp/swtpm/swtpm-sock' \ -tpmdev 'emulator,id=tpm0,chardev=swtpm' \ -device 'tpm-tis,tpmdev=tpm0'
Change-Id: Ib5baa8fe12cb9027a340875f1ccf5fef6f9460bd Signed-off-by: Duncan Laurie dlaurie@google.com --- M src/arch/x86/Kconfig M src/arch/x86/tables.c 2 files changed, 9 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/32/39832/2
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39832 )
Change subject: arch/x86/tables: Move max ACPI table size to Kconfig ......................................................................
Patch Set 2: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/39832/2/src/arch/x86/Kconfig File src/arch/x86/Kconfig:
https://review.coreboot.org/c/coreboot/+/39832/2/src/arch/x86/Kconfig@329 PS2, Line 329: tables in KiB.
Hello build bot (Jenkins), Furquan Shaikh, Angel Pons, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39832
to look at the new patch set (#3).
Change subject: arch/x86/tables: Move max ACPI table size to Kconfig ......................................................................
arch/x86/tables: Move max ACPI table size to Kconfig
The maximum ACPI table size is currently hardcoded to 144 KiB. When using QEMU with TPM enabled there is ~200 KiB of ACPI tables returned by the fw_cfg interface, so in order to allow this to be overridden by a mainboard move it to Kconfig.
This is seen when using a TPM with qemu as it will hang when processing the fw_cfg tables.
qemu-system-x86_64 \ -machine q35 -enable-kvm -vga virtio -serial stdio \ -drive 'id=hd,file=disk.bin' -bios coreboot.rom \ -chardev 'socket,id=swtpm,path=/tmp/swtpm/swtpm-sock' \ -tpmdev 'emulator,id=tpm0,chardev=swtpm' \ -device 'tpm-tis,tpmdev=tpm0'
Change-Id: Ib5baa8fe12cb9027a340875f1ccf5fef6f9460bd Signed-off-by: Duncan Laurie dlaurie@google.com --- M src/arch/x86/Kconfig M src/arch/x86/tables.c 2 files changed, 9 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/32/39832/3
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39832 )
Change subject: arch/x86/tables: Move max ACPI table size to Kconfig ......................................................................
Patch Set 3: Code-Review+2
(2 comments)
https://review.coreboot.org/c/coreboot/+/39832/2/src/arch/x86/Kconfig File src/arch/x86/Kconfig:
https://review.coreboot.org/c/coreboot/+/39832/2/src/arch/x86/Kconfig@329 PS2, Line 329: tables
in KiB.
Done
https://review.coreboot.org/c/coreboot/+/39832/1/src/arch/x86/tables.c File src/arch/x86/tables.c:
https://review.coreboot.org/c/coreboot/+/39832/1/src/arch/x86/tables.c@81 PS1, Line 81: size_t max_acpi_size = CONFIG_MAX_ACPI_TABLE_SIZE_KB * KiB;
const?
Done
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39832 )
Change subject: arch/x86/tables: Move max ACPI table size to Kconfig ......................................................................
arch/x86/tables: Move max ACPI table size to Kconfig
The maximum ACPI table size is currently hardcoded to 144 KiB. When using QEMU with TPM enabled there is ~200 KiB of ACPI tables returned by the fw_cfg interface, so in order to allow this to be overridden by a mainboard move it to Kconfig.
This is seen when using a TPM with qemu as it will hang when processing the fw_cfg tables.
qemu-system-x86_64 \ -machine q35 -enable-kvm -vga virtio -serial stdio \ -drive 'id=hd,file=disk.bin' -bios coreboot.rom \ -chardev 'socket,id=swtpm,path=/tmp/swtpm/swtpm-sock' \ -tpmdev 'emulator,id=tpm0,chardev=swtpm' \ -device 'tpm-tis,tpmdev=tpm0'
Change-Id: Ib5baa8fe12cb9027a340875f1ccf5fef6f9460bd Signed-off-by: Duncan Laurie dlaurie@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/39832 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Georgi pgeorgi@google.com --- M src/arch/x86/Kconfig M src/arch/x86/tables.c 2 files changed, 9 insertions(+), 4 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig index a4e5314..21107aa 100644 --- a/src/arch/x86/Kconfig +++ b/src/arch/x86/Kconfig @@ -322,4 +322,10 @@ table specifies links greater than 4, pirq_route_irqs will not function properly, unless this variable is correctly set.
+config MAX_ACPI_TABLE_SIZE_KB + int + default 144 + help + Set the maximum size of all ACPI tables in KiB. + endif diff --git a/src/arch/x86/tables.c b/src/arch/x86/tables.c index 066e635..7e653f7 100644 --- a/src/arch/x86/tables.c +++ b/src/arch/x86/tables.c @@ -78,8 +78,7 @@ static unsigned long write_acpi_table(unsigned long rom_table_end) { unsigned long high_table_pointer; - -#define MAX_ACPI_SIZE (144 * 1024) + const size_t max_acpi_size = CONFIG_MAX_ACPI_TABLE_SIZE_KB * KiB;
post_code(0x9c);
@@ -96,7 +95,7 @@ * how far we get. */ high_table_pointer = (unsigned long)cbmem_add(CBMEM_ID_ACPI, - MAX_ACPI_SIZE); + max_acpi_size); if (high_table_pointer) { unsigned long acpi_start = high_table_pointer; unsigned long new_high_table_pointer; @@ -104,7 +103,7 @@ rom_table_end = ALIGN_UP(rom_table_end, 16); new_high_table_pointer = write_acpi_tables(high_table_pointer); if (new_high_table_pointer > (high_table_pointer - + MAX_ACPI_SIZE)) + + max_acpi_size)) printk(BIOS_ERR, "ERROR: Increase ACPI size\n"); printk(BIOS_DEBUG, "ACPI tables: %ld bytes.\n", new_high_table_pointer - high_table_pointer);