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

[xen stable-4.20] x86/CPU: extend is_forced_cpu_cap()'s "reach"



commit 2e5aae39cde3170141c6cd79a3ef0c4553fa8adf
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Jan 29 13:44:30 2026 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Jan 29 13:44:30 2026 +0100

    x86/CPU: extend is_forced_cpu_cap()'s "reach"
    
    "cpuid=no-rdrand" cannot actually be used to suppress the respective
    boot warning on certain AMD hardware. That's because cleared_caps[] are
    only applied after the ->c_init() hooks ran, i.e. cpu_has() still
    returns true in init_amd().
    
    Fixes: 93401e28a84b ("x86: clear RDRAND CPUID bit on AMD family 15h/16h")
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: f09f2e28a9ec5e2a867f212177e4d4c458dc3d85
    master date: 2026-01-22 09:10:10 +0100
---
 xen/arch/x86/cpu/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 168cd3a9ee..eb8f4ef8fe 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -103,7 +103,7 @@ void __init setup_force_cpu_cap(unsigned int cap)
 
 bool __init is_forced_cpu_cap(unsigned int cap)
 {
-       return test_bit(cap, forced_caps);
+       return test_bit(cap, forced_caps) || test_bit(cap, cleared_caps);
 }
 
 static void cf_check default_init(struct cpuinfo_x86 * c)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20



 


Rackspace

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