Bobby Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/64831?usp=email )

Change subject: arch-x86: Fix CPUID for most recent GLIBC
......................................................................

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 <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64831
Reviewed-by: Bobby Bruce <[email protected]>
Maintainer: Bobby Bruce <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/arch/x86/X86ISA.py
1 file changed, 47 insertions(+), 1 deletion(-)

Approvals:
  Bobby Bruce: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/arch/x86/X86ISA.py b/src/arch/x86/X86ISA.py
index 53a3cfc..2760b76 100644
--- a/src/arch/x86/X86ISA.py
+++ b/src/arch/x86/X86ISA.py
@@ -43,5 +43,5 @@
     cxx_header = "arch/x86/isa.hh"

     vendor_string = Param.String(
-        "M5 Simulator", "Vendor string for CPUID instruction"
+        "AuthenticAMD", "Vendor string for CPUID instruction"
     )

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/64831?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8eedb46f577361e749ad8d0adda4fd0753e99960
Gerrit-Change-Number: 64831
Gerrit-PatchSet: 2
Gerrit-Owner: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Bobby Bruce <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-CC: Matthew Poremba <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to