[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] x86/amd: Drop vestigial PBE logic in init_amd()



commit b1b35555f15d03026fbfbdd8071d95ae9a13a4d9
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Wed Nov 26 14:22:14 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Nov 27 18:22:20 2025 +0000

    x86/amd: Drop vestigial PBE logic in init_amd()
    
    The comment was adjusted by myself in commit 51bd4bbdfdba ("x86: drop
    X86_FEATURE_3DNOW_ALT"), on the presumption that the underlying logic 
existed
    for a good reason.
    
    Having done further archaeology, it turns out to be vestigial technical debt
    from the leadup to Linux 2.4 in November 2000.
    
    Prior to "Massive cleanup of CPU detection and bug handling",
    c->x86_capability was a single uint32_t containing cpuid(1).edx,
    cpuid(0x80000001).edx, or a synthesis thereof.  X86_FEATURE_AMD3D was 
defined
    as the top bit this single uint32_t.
    
    After "Massive cleanup of CPU detection and bug handling",
    c->x86_capability became an array with AMD's extended feature leaf split
    away from Intel's basic feature leaf.
    
    AMD doc #20734-G states that 3DNow is only enumerated in the extended
    feature leaf, and that other vendors where using this bit too.  i.e. AMD
    never produced a CPU which set bit 31 in the basic leaf, meaning that
    there's nothing to clear out in the first place.
    
    This logic looks like it was relevant in the pre-"Massive cleanup" world
    but ought to have been dropped when c->x86_capability was properly split.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/cpu/amd.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 0966d3b967..e9800bd7ea 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1131,13 +1131,6 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
                wrmsrl(MSR_K8_HWCR, value);
        }
 
-       /*
-        * Some AMD CPUs duplicate the 3DNow bit in base and extended CPUID
-        * leaves.  Unfortunately, this aliases PBE on Intel CPUs. Clobber the
-        * alias, leaving 3DNow in the extended leaf.
-        */
-       __clear_bit(X86_FEATURE_PBE, c->x86_capability);
-       
        if (c->x86 == 0xf && c->x86_model < 0x14
            && cpu_has(c, X86_FEATURE_LAHF_LM)) {
                /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.