arch/x86/cpu_common: use cpuid_e[a,c]x
Use cpuid_eax and cpuid_ecx instead of sort-of open-coding the same functionality in cpu_check_deterministic_cache_cpuid_supported. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Ib0dc2be4f602bf63183b9096e38403ae2f45d959 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78058 Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
		| @@ -89,19 +89,15 @@ uint32_t cpu_get_feature_flags_edx(void) | |||||||
|  |  | ||||||
| enum cpu_type cpu_check_deterministic_cache_cpuid_supported(void) | enum cpu_type cpu_check_deterministic_cache_cpuid_supported(void) | ||||||
| { | { | ||||||
| 	struct cpuid_result res; |  | ||||||
|  |  | ||||||
| 	if (cpu_is_intel()) { | 	if (cpu_is_intel()) { | ||||||
| 		res = cpuid(0); | 		if (cpuid_eax(0) < 4) | ||||||
| 		if (res.eax < 4) |  | ||||||
| 			return CPUID_COMMAND_UNSUPPORTED; | 			return CPUID_COMMAND_UNSUPPORTED; | ||||||
| 		return CPUID_TYPE_INTEL; | 		return CPUID_TYPE_INTEL; | ||||||
| 	} else if (cpu_is_amd()) { | 	} else if (cpu_is_amd()) { | ||||||
| 		if (cpu_cpuid_extended_level() < 0x80000001) | 		if (cpu_cpuid_extended_level() < 0x80000001) | ||||||
| 			return CPUID_COMMAND_UNSUPPORTED; | 			return CPUID_COMMAND_UNSUPPORTED; | ||||||
|  |  | ||||||
| 		res = cpuid(0x80000001); | 		if (!(cpuid_ecx(0x80000001) & (1 << 22))) | ||||||
| 		if (!(res.ecx & (1 << 22))) |  | ||||||
| 			return CPUID_COMMAND_UNSUPPORTED; | 			return CPUID_COMMAND_UNSUPPORTED; | ||||||
|  |  | ||||||
| 		return CPUID_TYPE_AMD; | 		return CPUID_TYPE_AMD; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user