From 042d1433b97f01976a3ae5da1deaffbd9bb10e18 Mon Sep 17 00:00:00 2001 From: Jason Lowe-Power Date: Wed, 19 Oct 2022 11:31:20 -0700 Subject: [PATCH] arch-x86: Fix CPUID for most recent GLIBC This change makes the default vendor string AuthenticAMD. GLIBC now is much more strict about checking for the current system's supported features. In Ubuntu 22.04, when trying to load a dynamically linked file, the CPUID is checked for the required features. If they are not there, an error saying ISA level too low is returned and the program crashes. The underlying issue is that GLIBC does not check and populate the cpu_feature data structure if it does not detect a *known* CPU model. The options are hardcoded. See the following file for the glibc code. glibc/sysdeps/x86/cpu-features.c Note that the cpu_features is not populated with the COMMON_CPUID_INDEX_1 unless there is a known family, which is only set if the vendor string matches a known vendor. This change uses AuthenticAMD instead of the alternatives because the checks in glibc are most simple (no special cases) for AuthenticAMD in the init_cpu_features functions. GLIBC has been unable to populate the cpu_features datastructure correctly with gem5 for a long time. However, this has just now become a problem for us because the library now is more strict on not allowing code to execute unless the processor meets certain minimum requirements. I believe the commit for GLIBC which caused this breakage is ecce11aa0752735c4fd730da6e7c9e0b98e12fb8 See https://sourceware.org/pipermail/binutils/2020-October/113593.html for more details on that commit. Change-Id: I8eedb46f577361e749ad8d0adda4fd0753e99960 Signed-off-by: Jason Lowe-Power Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64831 Reviewed-by: Bobby Bruce Maintainer: Bobby Bruce Tested-by: kokoro --- src/arch/x86/X86ISA.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/x86/X86ISA.py b/src/arch/x86/X86ISA.py index 53a3cfc08c..2760b7672d 100644 --- a/src/arch/x86/X86ISA.py +++ b/src/arch/x86/X86ISA.py @@ -43,5 +43,5 @@ class X86ISA(BaseISA): cxx_header = "arch/x86/isa.hh" vendor_string = Param.String( - "M5 Simulator", "Vendor string for CPUID instruction" + "AuthenticAMD", "Vendor string for CPUID instruction" )