From bcd247376633b0fb4f1dbfbf8c2e02d2c926adec Mon Sep 17 00:00:00 2001 From: Shuo Liu Date: Tue, 25 Jun 2024 19:04:11 +0800 Subject: acpi: Add support for DRHD size reporting VT-d spec 4.0 supports size definition for DRHD BAR to support DRHD sizes larger than 4KB. If the value in the field is N, the size of the register set is 2^N 4 KB pages. Some latest OS (e.g. Linux kernel 6.5) will have VTd driver trying to use the beyond 4KB part of the DRHD BAR if they exist. They need the DRHD size field to set up page mapping before access those registers. Re-add acpi_create_dmar_drhd with a size parameter to support the needs. TEST=Build and boot on intel/archercity CRB Change-Id: I49dd5de2eca257a5f6240e36d05755cabca96d1c Signed-off-by: Shuo Liu Signed-off-by: Gang Chen Signed-off-by: Jincheng Li Reviewed-on: https://review.coreboot.org/c/coreboot/+/82429 Reviewed-by: Nico Huber Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/include/acpi/acpi.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/include/acpi/acpi.h') diff --git a/src/include/acpi/acpi.h b/src/include/acpi/acpi.h index 469d672f41..a36e65c9d9 100644 --- a/src/include/acpi/acpi.h +++ b/src/include/acpi/acpi.h @@ -638,7 +638,7 @@ typedef struct dmar_entry { u16 type; u16 length; u8 flags; - u8 reserved; + u8 size; u16 segment; u64 bar; } __packed dmar_entry_t; @@ -1851,6 +1851,8 @@ void acpi_create_dmar(acpi_dmar_t *dmar, enum dmar_flags flags, unsigned long (*acpi_fill_dmar)(unsigned long)); unsigned long acpi_create_dmar_drhd_4k(unsigned long current, u8 flags, u16 segment, u64 bar); +unsigned long acpi_create_dmar_drhd(unsigned long current, u8 flags, + u16 segment, u64 bar, size_t size); unsigned long acpi_create_dmar_rmrr(unsigned long current, u16 segment, u64 bar, u64 limit); unsigned long acpi_create_dmar_atsr(unsigned long current, u8 flags, -- cgit v1.2.3