John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32189
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
ACPI: Add RHSA and ANDD structures for DMAR table
Remapping Hardware Status Affinity (RHSA) structure is applicable for platforms supporting non-uniform memory. An ACPI Name-space Device Declaration (ANDD) structure uniquely represents an ACPI name-space enumerated device capable of issuing DMA requests in the platform. Add RHSA and ANDD structures support for DMAR table generation.
Change-Id: I042925a7c03831061870d9bca03f11bf25aeb3e7 Signed-off-by: zhaojohn john.zhao@intel.com --- M src/arch/x86/acpi.c M src/arch/x86/include/arch/acpi.h 2 files changed, 60 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/32189/1
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c index f08a401..781efac 100644 --- a/src/arch/x86/acpi.c +++ b/src/arch/x86/acpi.c @@ -568,6 +568,32 @@ return atsr->length; }
+unsigned long acpi_create_dmar_rhsa(unsigned long current, u64 base_addr, + u32 proximity_domain) +{ + dmar_rhsa_entry_t *rhsa = (dmar_rhsa_entry_t *)current; + memset(rhsa, 0, sizeof(*rhsa)); + rhsa->type = DMAR_RHSA; + rhsa->length = sizeof(*rhsa); /* will be fixed up later */ + rhsa->base_address = base_addr; + rhsa->proximity_domain = proximity_domain; + + return rhsa->length; +} + +unsigned long acpi_create_dmar_andd(unsigned long current, u8 device_number, + const char *device_name) +{ + dmar_andd_entry_t *andd = (dmar_andd_entry_t *)current; + memset(andd, 0, sizeof(*andd)); + andd->type = DMAR_ANDD; + andd->length = sizeof(*andd); /* will be fixed up later */ + andd->device_number = device_number; + memcpy(&andd->device_name, device_name, 4); + + return andd->length; +} + void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current) { dmar_entry_t *drhd = (dmar_entry_t *)base; @@ -586,6 +612,18 @@ atsr->length = current - base; }
+void acpi_dmar_rhsa_fixup(unsigned long base, unsigned long current) +{ + dmar_rhsa_entry_t *rhsa = (dmar_rhsa_entry_t *)base; + rhsa->length = current - base; +} + +void acpi_dmar_andd_fixup(unsigned long base, unsigned long current) +{ + dmar_andd_entry_t *andd = (dmar_andd_entry_t *)base; + andd->length = current - base; +} + static unsigned long acpi_create_dmar_ds(unsigned long current, enum dev_scope_type type, u8 enumeration_id, u8 bus, u8 dev, u8 fn) { diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h index f4ed744..3df0c64 100644 --- a/src/arch/x86/include/arch/acpi.h +++ b/src/arch/x86/include/arch/acpi.h @@ -366,6 +366,22 @@ u16 segment; } __packed dmar_atsr_entry_t;
+typedef struct dmar_rhsa_entry { + u16 type; + u16 length; + u32 reserved; + u64 base_address; + u32 proximity_domain; +} __packed dmar_rhsa_entry_t; + +typedef struct dmar_andd_entry { + u16 type; + u16 length; + u8 reserved[3]; + u8 device_number; + char device_name[4]; +} __packed dmar_andd_entry_t; + /* DMAR (DMA Remapping Reporting Structure) */ typedef struct acpi_dmar { struct acpi_table_header header; @@ -850,9 +866,15 @@ u64 bar, u64 limit); unsigned long acpi_create_dmar_atsr(unsigned long current, u8 flags, u16 segment); +unsigned long acpi_create_dmar_rhsa(unsigned long current, u64 base_addr, + u32 proximity_domain); +unsigned long acpi_create_dmar_andd(unsigned long current, u8 device_number, + const char *device_name); void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current); void acpi_dmar_rmrr_fixup(unsigned long base, unsigned long current); void acpi_dmar_atsr_fixup(unsigned long base, unsigned long current); +void acpi_dmar_rhsa_fixup(unsigned long base, unsigned long current); +void acpi_dmar_andd_fixup(unsigned long base, unsigned long current); unsigned long acpi_create_dmar_ds_pci_br(unsigned long current, u8 bus, u8 dev, u8 fn); unsigned long acpi_create_dmar_ds_pci(unsigned long current,
Lijian Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32189 )
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
Patch Set 1: Code-Review+1
Hello Pratikkumar V Prajapati, Shamile Khan, Lijian Zhao, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32189
to look at the new patch set (#2).
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
ACPI: Add RHSA and ANDD structures for DMAR table
Remapping Hardware Status Affinity (RHSA) structure is applicable for platforms supporting non-uniform memory. An ACPI Name-space Device Declaration (ANDD) structure uniquely represents an ACPI name-space enumerated device capable of issuing DMA requests in the platform. Add RHSA and ANDD structures support for DMAR table generation.
BUG=b:130351429 TEST=Image built and booted to kernel
Change-Id: I042925a7c03831061870d9bca03f11bf25aeb3e7 Signed-off-by: zhaojohn john.zhao@intel.com --- M src/arch/x86/acpi.c M src/arch/x86/include/arch/acpi.h 2 files changed, 60 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/32189/2
Lijian Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32189 )
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
Patch Set 2: Code-Review+2
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32189 )
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/32189/2/src/arch/x86/acpi.c File src/arch/x86/acpi.c:
https://review.coreboot.org/#/c/32189/2/src/arch/x86/acpi.c@592 PS2, Line 592: memcpy(&andd->device_name, device_name, 4); How is the call supposed to look like? Should we pad a short `device_name`?
Hello Pratikkumar V Prajapati, Shamile Khan, Lijian Zhao, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32189
to look at the new patch set (#3).
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
ACPI: Add RHSA and ANDD structures for DMAR table
Remapping Hardware Status Affinity (RHSA) structure is applicable for platforms supporting non-uniform memory. An ACPI Name-space Device Declaration (ANDD) structure uniquely represents an ACPI name-space enumerated device capable of issuing DMA requests in the platform. Add RHSA and ANDD structures support for DMAR table generation.
BUG=b:130351429 TEST=Image built and booted to kernel
Change-Id: I042925a7c03831061870d9bca03f11bf25aeb3e7 Signed-off-by: zhaojohn john.zhao@intel.com --- M src/arch/x86/acpi.c M src/arch/x86/include/arch/acpi.h 2 files changed, 61 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/32189/3
John Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32189 )
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/#/c/32189/2/src/arch/x86/acpi.c File src/arch/x86/acpi.c:
https://review.coreboot.org/#/c/32189/2/src/arch/x86/acpi.c@592 PS2, Line 592: memcpy(&andd->device_name, device_name, 4);
How is the call supposed to look like? Should we pad a short `device_name`?
Updated with variable length of acpi name-space object.
Lijian Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32189 )
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
Patch Set 3: Code-Review+2
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32189 )
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
Patch Set 3:
(2 comments)
Please be patient with the review. It's not easy to get a new API right when nobody wrote a caller, yet.
https://review.coreboot.org/#/c/32189/2/src/arch/x86/acpi.c File src/arch/x86/acpi.c:
https://review.coreboot.org/#/c/32189/2/src/arch/x86/acpi.c@592 PS2, Line 592: memcpy(&andd->device_name, device_name, 4);
Updated with variable length of acpi name-space object.
Ack, thanks
https://review.coreboot.org/#/c/32189/3/src/arch/x86/acpi.c File src/arch/x86/acpi.c:
https://review.coreboot.org/#/c/32189/3/src/arch/x86/acpi.c@616 PS3, Line 616: oid acpi_dmar_rhsa_fixup(unsigned long base, unsigned long current) : { : dmar_rhsa_entry_t *rhsa = (dmar_rhsa_entry_t *)base; : rhsa->length = current - base; : } : : void acpi_dmar_andd_fixup(unsigned long base, unsigned long current) : { : dmar_andd_entry_t *andd = (dmar_andd_entry_t *)base; : andd->length = current - base; : } These structures don't end in variable length lists, so the length set above should already be correct.
Hello Pratikkumar V Prajapati, Shamile Khan, Lijian Zhao, build bot (Jenkins), Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32189
to look at the new patch set (#4).
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
ACPI: Add RHSA and ANDD structures for DMAR table
Remapping Hardware Status Affinity (RHSA) structure is applicable for platforms supporting non-uniform memory. An ACPI Name-space Device Declaration (ANDD) structure uniquely represents an ACPI name-space enumerated device capable of issuing DMA requests in the platform. Add RHSA and ANDD structures support for DMAR table generation.
BUG=b:130351429 TEST=Image built and booted to kernel
Change-Id: I042925a7c03831061870d9bca03f11bf25aeb3e7 Signed-off-by: John Zhao john.zhao@intel.com --- M src/arch/x86/acpi.c M src/arch/x86/include/arch/acpi.h 2 files changed, 47 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/32189/4
John Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32189 )
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/#/c/32189/3/src/arch/x86/acpi.c File src/arch/x86/acpi.c:
https://review.coreboot.org/#/c/32189/3/src/arch/x86/acpi.c@616 PS3, Line 616: oid acpi_dmar_rhsa_fixup(unsigned long base, unsigned long current) : { : dmar_rhsa_entry_t *rhsa = (dmar_rhsa_entry_t *)base; : rhsa->length = current - base; : } : : void acpi_dmar_andd_fixup(unsigned long base, unsigned long current) : { : dmar_andd_entry_t *andd = (dmar_andd_entry_t *)base; : andd->length = current - base; : }
These structures don't end in variable length lists, so the length […]
Updated.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32189 )
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
Patch Set 4:
(2 comments)
close :)
https://review.coreboot.org/#/c/32189/4/src/arch/x86/acpi.c File src/arch/x86/acpi.c:
https://review.coreboot.org/#/c/32189/4/src/arch/x86/acpi.c@577 PS4, Line 577: /* will be fixed up later */ obsolete comment
https://review.coreboot.org/#/c/32189/4/src/arch/x86/acpi.c@591 PS4, Line 591: /* will be fixed up later */ obsolete comment
Hello Pratikkumar V Prajapati, Shamile Khan, build bot (Jenkins), Lijian Zhao, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32189
to look at the new patch set (#5).
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
ACPI: Add RHSA and ANDD structures for DMAR table
Remapping Hardware Status Affinity (RHSA) structure is applicable for platforms supporting non-uniform memory. An ACPI Name-space Device Declaration (ANDD) structure uniquely represents an ACPI name-space enumerated device capable of issuing DMA requests in the platform. Add RHSA and ANDD structures support for DMAR table generation.
BUG=b:130351429 TEST=Image built and booted to kernel
Change-Id: I042925a7c03831061870d9bca03f11bf25aeb3e7 Signed-off-by: John Zhao john.zhao@intel.com --- M src/arch/x86/acpi.c M src/arch/x86/include/arch/acpi.h 2 files changed, 47 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/32189/5
John Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32189 )
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
Patch Set 5:
(2 comments)
https://review.coreboot.org/#/c/32189/4/src/arch/x86/acpi.c File src/arch/x86/acpi.c:
https://review.coreboot.org/#/c/32189/4/src/arch/x86/acpi.c@577 PS4, Line 577: /* will be fixed up later */
obsolete comment
deleted.
https://review.coreboot.org/#/c/32189/4/src/arch/x86/acpi.c@591 PS4, Line 591: /* will be fixed up later */
obsolete comment
deleted.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32189 )
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
Patch Set 5: Code-Review+2
(3 comments)
Is there any user of this comming soon? or shall we go ahead and merge it just now?
https://review.coreboot.org/#/c/32189/3/src/arch/x86/acpi.c File src/arch/x86/acpi.c:
https://review.coreboot.org/#/c/32189/3/src/arch/x86/acpi.c@616 PS3, Line 616: oid acpi_dmar_rhsa_fixup(unsigned long base, unsigned long current) : { : dmar_rhsa_entry_t *rhsa = (dmar_rhsa_entry_t *)base; : rhsa->length = current - base; : } : : void acpi_dmar_andd_fixup(unsigned long base, unsigned long current) : { : dmar_andd_entry_t *andd = (dmar_andd_entry_t *)base; : andd->length = current - base; : }
Updated.
Ack
https://review.coreboot.org/#/c/32189/4/src/arch/x86/acpi.c File src/arch/x86/acpi.c:
https://review.coreboot.org/#/c/32189/4/src/arch/x86/acpi.c@577 PS4, Line 577: /* will be fixed up later */
deleted.
Ack
https://review.coreboot.org/#/c/32189/4/src/arch/x86/acpi.c@591 PS4, Line 591: /* will be fixed up later */
deleted.
Ack
John Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32189 )
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
Patch Set 5:
It seems no user is using this VT-d feature. Please consider to merge it.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32189 )
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
Patch Set 5: Code-Review+2
Nico Huber has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32189 )
Change subject: ACPI: Add RHSA and ANDD structures for DMAR table ......................................................................
ACPI: Add RHSA and ANDD structures for DMAR table
Remapping Hardware Status Affinity (RHSA) structure is applicable for platforms supporting non-uniform memory. An ACPI Name-space Device Declaration (ANDD) structure uniquely represents an ACPI name-space enumerated device capable of issuing DMA requests in the platform. Add RHSA and ANDD structures support for DMAR table generation.
BUG=b:130351429 TEST=Image built and booted to kernel
Change-Id: I042925a7c03831061870d9bca03f11bf25aeb3e7 Signed-off-by: John Zhao john.zhao@intel.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/32189 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Nico Huber nico.h@gmx.de Reviewed-by: Furquan Shaikh furquan@google.com --- M src/arch/x86/acpi.c M src/arch/x86/include/arch/acpi.h 2 files changed, 47 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Furquan Shaikh: Looks good to me, approved
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c index 8a620bb..d1dcd03 100644 --- a/src/arch/x86/acpi.c +++ b/src/arch/x86/acpi.c @@ -569,6 +569,33 @@ return atsr->length; }
+unsigned long acpi_create_dmar_rhsa(unsigned long current, u64 base_addr, + u32 proximity_domain) +{ + dmar_rhsa_entry_t *rhsa = (dmar_rhsa_entry_t *)current; + memset(rhsa, 0, sizeof(*rhsa)); + rhsa->type = DMAR_RHSA; + rhsa->length = sizeof(*rhsa); + rhsa->base_address = base_addr; + rhsa->proximity_domain = proximity_domain; + + return rhsa->length; +} + +unsigned long acpi_create_dmar_andd(unsigned long current, u8 device_number, + const char *device_name) +{ + dmar_andd_entry_t *andd = (dmar_andd_entry_t *)current; + int andd_len = sizeof(dmar_andd_entry_t) + strlen(device_name) + 1; + memset(andd, 0, andd_len); + andd->type = DMAR_ANDD; + andd->length = andd_len; + andd->device_number = device_number; + memcpy(&andd->device_name, device_name, strlen(device_name)); + + return andd->length; +} + void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current) { dmar_entry_t *drhd = (dmar_entry_t *)base; diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h index f4ed744..1b9438d 100644 --- a/src/arch/x86/include/arch/acpi.h +++ b/src/arch/x86/include/arch/acpi.h @@ -366,6 +366,22 @@ u16 segment; } __packed dmar_atsr_entry_t;
+typedef struct dmar_rhsa_entry { + u16 type; + u16 length; + u32 reserved; + u64 base_address; + u32 proximity_domain; +} __packed dmar_rhsa_entry_t; + +typedef struct dmar_andd_entry { + u16 type; + u16 length; + u8 reserved[3]; + u8 device_number; + u8 device_name[]; +} __packed dmar_andd_entry_t; + /* DMAR (DMA Remapping Reporting Structure) */ typedef struct acpi_dmar { struct acpi_table_header header; @@ -850,6 +866,10 @@ u64 bar, u64 limit); unsigned long acpi_create_dmar_atsr(unsigned long current, u8 flags, u16 segment); +unsigned long acpi_create_dmar_rhsa(unsigned long current, u64 base_addr, + u32 proximity_domain); +unsigned long acpi_create_dmar_andd(unsigned long current, u8 device_number, + const char *device_name); void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current); void acpi_dmar_rmrr_fixup(unsigned long base, unsigned long current); void acpi_dmar_atsr_fixup(unsigned long base, unsigned long current);