x86/spec-ctrl: Print all AMD speculative hints/features
PATCH 1/1 x86/spec-ctrl: Print all AMD speculative hints/features
We already print Intel features that aren't yet implemented/used, so be consistent on AMD too.
Signed-off-by Andrew Cooper <[email protected]>
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>
For reference, here are the bit layouts on different generations of AMD CPUs.
Fam15, and Zen1:
(XEN) Hardware hints:
(XEN) Hardware features: IBPB
Zen2:
(XEN) Hardware hints: IBRS_FAST IBRS_SAME_MODE
(XEN) Hardware features: IBPB IBRS STIBP SSBD
Zen3:
(XEN) Hardware hints: STIBP_ALWAYS IBRS_FAST IBRS_SAME_MODE
(XEN) Hardware features: IBPB IBRS STIBP SSBD PSFD
--- xen/arch/x86/spec_ctrl.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
xen/arch/x86/spec_ctrl.c +10 -3
@@ -321,7 +321,7 @@ static void __init print_details(enum ind_thunk thunk, uint64_t caps)* Hardware read-only information, stating immunity to certain issues, or * suggestions of which mitigation to use. */ - printk(" Hardware hints:%s%s%s%s%s%s%s\n", + printk(" Hardware hints:%s%s%s%s%s%s%s%s%s%s%s\n", (caps & ARCH_CAPS_RDCL_NO) ? " RDCL_NO" : "", (caps & ARCH_CAPS_IBRS_ALL) ? " IBRS_ALL" : "", (caps & ARCH_CAPS_RSBA) ? " RSBA" : "",
@@ -329,16 +329,23 @@ static void __init print_details(enum ind_thunk thunk, uint64_t caps) (e8b &cpufeat_mask (X86_FEATURE_SSB_NO )) || (caps &ARCH_CAPS_SSB_NO ) ?" SSB_NO" :"" , (caps &ARCH_CAPS_MDS_NO ) ?" MDS_NO" :"" , - (caps & ARCH_CAPS_TAA_NO) ? " TAA_NO" : ""); + (caps &ARCH_CAPS_TAA_NO ) ?" TAA_NO" :"" , + (e8b &cpufeat_mask (X86_FEATURE_IBRS_ALWAYS )) ?" IBRS_ALWAYS" :"" , + (e8b &cpufeat_mask (X86_FEATURE_STIBP_ALWAYS )) ?" STIBP_ALWAYS" :"" , + (e8b &cpufeat_mask (X86_FEATURE_IBRS_FAST )) ?" IBRS_FAST" :"" , + (e8b & cpufeat_mask(X86_FEATURE_IBRS_SAME_MODE)) ? " IBRS_SAME_MODE" : "");/* Hardware features which need driving to mitigate issues. */ - printk(" Hardware features:%s%s%s%s%s%s%s%s%s\n", + printk(" Hardware features:%s%s%s%s%s%s%s%s%s%s\n", (e8b & cpufeat_mask(X86_FEATURE_IBPB)) || (_7d0 & cpufeat_mask(X86_FEATURE_IBRSB)) ? " IBPB" : "", + (e8b & cpufeat_mask(X86_FEATURE_IBRS)) || (_7d0 & cpufeat_mask(X86_FEATURE_IBRSB)) ? " IBRS" : "", + (e8b & cpufeat_mask(X86_FEATURE_AMD_STIBP)) || (_7d0 & cpufeat_mask(X86_FEATURE_STIBP)) ? " STIBP" : "", (e8b & cpufeat_mask(X86_FEATURE_AMD_SSBD)) || (_7d0 & cpufeat_mask(X86_FEATURE_SSBD)) ? " SSBD" : "", + (e8b & cpufeat_mask(X86_FEATURE_PSFD)) ? " PSFD" : "", (_7d0 & cpufeat_mask(X86_FEATURE_L1D_FLUSH)) ? " L1D_FLUSH" : "", (_7d0 & cpufeat_mask(X86_FEATURE_MD_CLEAR)) ? " MD_CLEAR" : "", (_7d0 & cpufeat_mask(X86_FEATURE_SRBDS_CTRL)) ? " SRBDS_CTRL" : "",
Signature · 1 line
2.11.0
Quoted 4 lines · Andrew Cooper
We already print Intel features that aren't yet implemented/used, so be consistent on AMD too.
Signed-off-by Andrew Cooper <[email protected]>
Reviewed-by Jan Beulich <[email protected]>