Bug 2203186

Summary: glibc: Fix cache size detection for hypervisors or older AMD hardware
Product: Red Hat Enterprise Linux 9 Reporter: Carlos O'Donell <codonell>
Component: glibcAssignee: Florian Weimer <fweimer>
Status: CLOSED ERRATA QA Contact: Sergey Kolosov <skolosov>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 9.3CC: ashankar, codonell, dj, fweimer, mcermak, pfrankli, sipoyare
Target Milestone: rcKeywords: Bugfix, Regression, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glibc-2.34-80.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:37:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2166709, 2166710    

Description Carlos O'Donell 2023-05-11 13:10:10 UTC
The current -67 glibc build uses the upstream cache size detection code which is incorrect under certain hypervisors and older AMD hardware.

We need to do one of two things:
- Revert the current cache size detection code.
- Backport an upstream correction that supports the old cpuid mechanism and the new cpuid mechanism.

Comment 5 Carlos O'Donell 2023-07-14 21:26:05 UTC
We will be reverting the current AMD cacheline changes until we have a solution that works for old and new CPUs.

Comment 10 Carlos O'Donell 2023-08-14 14:28:26 UTC
Upstream commit:

commit dcad5c8578130dec7f35fd5b0885304b59f9f543
Author: Sajan Karumanchi <sajan.karumanchi>
Date:   Tue Aug 1 15:20:55 2023 +0000

    x86: Fix for cache computation on AMD legacy cpus.
    
    Some legacy AMD CPUs and hypervisors have the _cpuid_ '0x8000_001D'
    set to Zero, thus resulting in zeroed-out computed cache values.
    This patch reintroduces the old way of cache computation as a
    fail-safe option to handle these exceptions.
    Fixed 'level4_cache_size' value through handle_amd().
    
    Reviewed-by: Premachandra Mallappa <premachandra.mallappa>
    Tested-by: Florian Weimer <fweimer>

Committed to c9s:

commit 3a04eb2e1826da207b64a254af3d17e30a27db11
Author: Florian Weimer <fweimer>
Date:   Fri Aug 11 17:54:52 2023 +0200

    Fix AMD cache size computation for hypervisors, old CPUs (#2166710)
    
    Missing spec file update.
    
    Related: #2166710

Comment 15 errata-xmlrpc 2023-11-07 08:37:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (glibc bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6582