Tim Wawrzynczak submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Paul Menzel: Looks good to me, but someone else must approve Angel Pons: Looks good to me, but someone else must approve Tim Wawrzynczak: Looks good to me, approved
arch/x86: Skip returning default leaf value as `0`

`cpu_get_cache_info_leaf()` function is responsible to report leaf
value for CPU that have support for deterministic cache cpuid. As per
available datasheets from AMD and Intel the supported CPUID leafs are
0x8000_001d for AMD and 0x04 for Intel. Hence, this CL skips returning
default leaf value as `0`.

TEST=Verified fixes: e2b5fee3b006 (arch/x86: smbios write 7 table using
deterministic cache functions) hang issue on ASRock E350M1.

Change-Id: Iee33b39298e7821ac5280d998172b58a70c8715b
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57305
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M src/arch/x86/cpu_common.c
1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/arch/x86/cpu_common.c b/src/arch/x86/cpu_common.c
index 835cddd6..302a14e 100644
--- a/src/arch/x86/cpu_common.c
+++ b/src/arch/x86/cpu_common.c
@@ -109,14 +109,11 @@

static uint32_t cpu_get_cache_info_leaf(void)
{
- switch (cpu_check_deterministic_cache_cpuid_supported()) {
- case CPUID_TYPE_AMD:
- return DETERMINISTIC_CACHE_PARAMETERS_CPUID_AMD;
- case CPUID_TYPE_INTEL:
- return DETERMINISTIC_CACHE_PARAMETERS_CPUID_IA;
- default:
- return 0;
- }
+ uint32_t leaf = (cpu_check_deterministic_cache_cpuid_supported() == CPUID_TYPE_AMD) ?
+ DETERMINISTIC_CACHE_PARAMETERS_CPUID_AMD :
+ DETERMINISTIC_CACHE_PARAMETERS_CPUID_IA;
+
+ return leaf;
}

size_t cpu_get_cache_ways_assoc_info(const struct cpu_cache_info *info)

To view, visit change 57305. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iee33b39298e7821ac5280d998172b58a70c8715b
Gerrit-Change-Number: 57305
Gerrit-PatchSet: 4
Gerrit-Owner: Subrata Banik <subrata.banik@intel.com>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Furquan Shaikh <furquan@google.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki@gmail.com>
Gerrit-Reviewer: Paul Menzel <paulepanter@mailbox.org>
Gerrit-Reviewer: Swift Geek (Sebastian Grzywna) <swiftgeek@gmail.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak@chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged