Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43719 )
Change subject: arch/x86/smbios: Bump to version 3.0 ......................................................................
arch/x86/smbios: Bump to version 3.0
Fill in the new fields introduced with version 3.0 and install the new entry point structure identified by _SM3_.
Tested on Linux 5.6 using tianocore as payload: Still able to decode the tables without errors.
Change-Id: Iba7a54e9de0b315f8072e6fd2880582355132a81 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/arch/x86/smbios.c M src/include/smbios.h 2 files changed, 44 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/43719/1
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 3c5799b..2af73af 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -724,9 +724,13 @@ if (leaf_b_threads == 0) { leaf_b_threads = 1; } - t->core_count = leaf_b_cores / leaf_b_threads; + t->core_count2 = leaf_b_cores / leaf_b_threads; + t->core_count = t->core_count2 > 0xff ? 0xff : t->core_count2; + t->thread_count2 = leaf_b_threads; } else { t->core_count = (res.ebx >> 16) & 0xff; + t->core_count2 = t->core_count; + t->thread_count2 = t->core_count2; } /* Assume we enable all the cores always, capped only by MAX_CPUS */ t->core_enabled = MIN(t->core_count, CONFIG_MAX_CPUS); @@ -743,6 +747,8 @@ t->max_speed = smbios_cpu_get_max_speed_mhz(); t->current_speed = smbios_cpu_get_current_speed_mhz(); } + t->core_enabled2 = 0; /* Unknown */ + *current += len; return len; } @@ -1261,6 +1267,7 @@ unsigned long smbios_write_tables(unsigned long current) { struct smbios_entry *se; + struct smbios_entry30 *se3; unsigned long tables; int len = 0; int max_struct_size = 0; @@ -1273,6 +1280,10 @@ current += sizeof(struct smbios_entry); current = ALIGN_UP(current, 16);
+ se3 = (struct smbios_entry30 *)current; + current += sizeof(struct smbios_entry30); + current = ALIGN_UP(current, 16); + tables = current; update_max(len, max_struct_size, smbios_write_type0(¤t, handle++)); @@ -1305,11 +1316,12 @@ update_max(len, max_struct_size, smbios_write_type127(¤t, handle++));
+ /* Install SMBIOS 2.1 entry point */ memset(se, 0, sizeof(struct smbios_entry)); memcpy(se->anchor, "_SM_", 4); se->length = sizeof(struct smbios_entry); - se->major_version = 2; - se->minor_version = 8; + se->major_version = 3; + se->minor_version = 0; se->max_struct_size = max_struct_size; se->struct_count = handle; memcpy(se->intermediate_anchor_string, "_DMI_", 5); @@ -1321,5 +1333,18 @@ sizeof(struct smbios_entry) - 0x10); se->checksum = smbios_checksum((u8 *)se, sizeof(struct smbios_entry)); + + /* Install SMBIOS 3.0 entry point */ + memset(se3, 0, sizeof(struct smbios_entry30)); + memcpy(se3->anchor, "_SM3_", 5); + se3->length = sizeof(struct smbios_entry30); + se3->major_version = 3; + se3->minor_version = 0; + + se3->struct_table_address = (u64)tables; + se3->struct_table_length = len; + + se3->checksum = smbios_checksum((u8 *)se3, sizeof(struct smbios_entry30)); + return current; } diff --git a/src/include/smbios.h b/src/include/smbios.h index ed09d64..25ea897 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -247,6 +247,19 @@ u8 smbios_bcd_revision; } __packed;
+struct smbios_entry30 { + u8 anchor[5]; + u8 checksum; + u8 length; + u8 major_version; + u8 minor_version; + u8 smbios_doc_rev; + u8 entry_point_rev; + u8 reserved; + u32 struct_table_length; + u64 struct_table_address; +} __packed; + struct smbios_type0 { u8 type; u8 length; @@ -402,6 +415,9 @@ u8 thread_count; u16 processor_characteristics; u16 processor_family2; + u16 core_count2; + u16 core_enabled2; + u16 thread_count2; u8 eos[2]; } __packed;
Christian Walter has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43719 )
Change subject: arch/x86/smbios: Bump to version 3.0 ......................................................................
Patch Set 1: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/43719/1/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/c/coreboot/+/43719/1/src/arch/x86/smbios.c@750 PS1, Line 750: t->core_enabled2 = 0; /* Unknown */ Specs says that if more than 255 cores are enabled, you need to write (core_count2 & 0xff00) into that field here.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43719 )
Change subject: arch/x86/smbios: Bump to version 3.0 ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/43719/1/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/c/coreboot/+/43719/1/src/arch/x86/smbios.c@750 PS1, Line 750: t->core_enabled2 = 0; /* Unknown */
Specs says that if more than 255 cores are enabled, you need to write (core_count2 & 0xff00) into th […]
it also states that zero is always valid value.
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43719 )
Change subject: arch/x86/smbios: Bump to version 3.0 ......................................................................
Patch Set 1: Code-Review+1
Christian Walter has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43719 )
Change subject: arch/x86/smbios: Bump to version 3.0 ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/43719/1/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/c/coreboot/+/43719/1/src/arch/x86/smbios.c@750 PS1, Line 750: t->core_enabled2 = 0; /* Unknown */
it also states that zero is always valid value.
I dont see that - for me it clearly states:
For core counts of 256 or greater, the Core Countfield is set to FFh and the Core Count 2field is set to the number of cores.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43719 )
Change subject: arch/x86/smbios: Bump to version 3.0 ......................................................................
Patch Set 1: Code-Review+2
Windows 10 still boots on Asrock B85M Pro4.
Hello Philipp Deppenwiese, build bot (Jenkins), Christian Walter, Angel Pons, Marcello Sylvester Bauer, HAOUAS Elyes,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/43719
to look at the new patch set (#2).
Change subject: arch/x86/smbios: Bump to version 3.0 ......................................................................
arch/x86/smbios: Bump to version 3.0
Fill in the new fields introduced with version 3.0 and install the new entry point structure identified by _SM3_.
Tested on Linux 5.6 using tianocore as payload: Still able to decode the tables without errors.
Change-Id: Iba7a54e9de0b315f8072e6fd2880582355132a81 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/arch/x86/smbios.c M src/include/smbios.h 2 files changed, 44 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/43719/2
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43719 )
Change subject: arch/x86/smbios: Bump to version 3.0 ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/43719/1/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/c/coreboot/+/43719/1/src/arch/x86/smbios.c@750 PS1, Line 750: t->core_enabled2 = 0; /* Unknown */
I dont see that - for me it clearly states: […]
set core_enabled2 to core_count2 value. Satisfies all spec requirements.
Hello Philipp Deppenwiese, build bot (Jenkins), Christian Walter, Angel Pons, Marcello Sylvester Bauer, HAOUAS Elyes,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/43719
to look at the new patch set (#3).
Change subject: arch/x86/smbios: Bump to version 3.0 ......................................................................
arch/x86/smbios: Bump to version 3.0
Fill in the new fields introduced with version 3.0 and install the new entry point structure identified by _SM3_.
Tested on Linux 5.6 using tianocore as payload: Still able to decode the tables without errors.
Change-Id: Iba7a54e9de0b315f8072e6fd2880582355132a81 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/arch/x86/smbios.c M src/include/smbios.h 2 files changed, 43 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/43719/3
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43719 )
Change subject: arch/x86/smbios: Bump to version 3.0 ......................................................................
Patch Set 3: Code-Review+1
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43719 )
Change subject: arch/x86/smbios: Bump to version 3.0 ......................................................................
Patch Set 3: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/43719 )
Change subject: arch/x86/smbios: Bump to version 3.0 ......................................................................
arch/x86/smbios: Bump to version 3.0
Fill in the new fields introduced with version 3.0 and install the new entry point structure identified by _SM3_.
Tested on Linux 5.6 using tianocore as payload: Still able to decode the tables without errors.
Change-Id: Iba7a54e9de0b315f8072e6fd2880582355132a81 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/43719 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/arch/x86/smbios.c M src/include/smbios.h 2 files changed, 43 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 070c7ea..d7e8747 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -724,12 +724,17 @@ if (leaf_b_threads == 0) { leaf_b_threads = 1; } - t->core_count = leaf_b_cores / leaf_b_threads; + t->core_count2 = leaf_b_cores / leaf_b_threads; + t->core_count = t->core_count2 > 0xff ? 0xff : t->core_count2; + t->thread_count2 = leaf_b_threads; } else { t->core_count = (res.ebx >> 16) & 0xff; + t->core_count2 = t->core_count; + t->thread_count2 = t->core_count2; } /* Assume we enable all the cores always, capped only by MAX_CPUS */ t->core_enabled = MIN(t->core_count, CONFIG_MAX_CPUS); + t->core_enabled2 = MIN(t->core_count2, CONFIG_MAX_CPUS); t->l1_cache_handle = 0xffff; t->l2_cache_handle = 0xffff; t->l3_cache_handle = 0xffff; @@ -1313,6 +1318,7 @@ unsigned long smbios_write_tables(unsigned long current) { struct smbios_entry *se; + struct smbios_entry30 *se3; unsigned long tables; int len = 0; int max_struct_size = 0; @@ -1325,6 +1331,10 @@ current += sizeof(struct smbios_entry); current = ALIGN_UP(current, 16);
+ se3 = (struct smbios_entry30 *)current; + current += sizeof(struct smbios_entry30); + current = ALIGN_UP(current, 16); + tables = current; update_max(len, max_struct_size, smbios_write_type0(¤t, handle++)); @@ -1359,11 +1369,12 @@ update_max(len, max_struct_size, smbios_write_type127(¤t, handle++));
+ /* Install SMBIOS 2.1 entry point */ memset(se, 0, sizeof(struct smbios_entry)); memcpy(se->anchor, "_SM_", 4); se->length = sizeof(struct smbios_entry); - se->major_version = 2; - se->minor_version = 8; + se->major_version = 3; + se->minor_version = 0; se->max_struct_size = max_struct_size; se->struct_count = handle; memcpy(se->intermediate_anchor_string, "_DMI_", 5); @@ -1375,5 +1386,18 @@ sizeof(struct smbios_entry) - 0x10); se->checksum = smbios_checksum((u8 *)se, sizeof(struct smbios_entry)); + + /* Install SMBIOS 3.0 entry point */ + memset(se3, 0, sizeof(struct smbios_entry30)); + memcpy(se3->anchor, "_SM3_", 5); + se3->length = sizeof(struct smbios_entry30); + se3->major_version = 3; + se3->minor_version = 0; + + se3->struct_table_address = (u64)tables; + se3->struct_table_length = len; + + se3->checksum = smbios_checksum((u8 *)se3, sizeof(struct smbios_entry30)); + return current; } diff --git a/src/include/smbios.h b/src/include/smbios.h index 45c550a..0138161 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -247,6 +247,19 @@ u8 smbios_bcd_revision; } __packed;
+struct smbios_entry30 { + u8 anchor[5]; + u8 checksum; + u8 length; + u8 major_version; + u8 minor_version; + u8 smbios_doc_rev; + u8 entry_point_rev; + u8 reserved; + u32 struct_table_length; + u64 struct_table_address; +} __packed; + struct smbios_type0 { u8 type; u8 length; @@ -402,6 +415,9 @@ u8 thread_count; u16 processor_characteristics; u16 processor_family2; + u16 core_count2; + u16 core_enabled2; + u16 thread_count2; u8 eos[2]; } __packed;