17d7d1bf1SArnaldo Carvalho de Melo #ifndef _ASM_X86_DISABLED_FEATURES_H 27d7d1bf1SArnaldo Carvalho de Melo #define _ASM_X86_DISABLED_FEATURES_H 37d7d1bf1SArnaldo Carvalho de Melo 47d7d1bf1SArnaldo Carvalho de Melo /* These features, although they might be available in a CPU 57d7d1bf1SArnaldo Carvalho de Melo * will not be used because the compile options to support 67d7d1bf1SArnaldo Carvalho de Melo * them are not present. 77d7d1bf1SArnaldo Carvalho de Melo * 87d7d1bf1SArnaldo Carvalho de Melo * This code allows them to be checked and disabled at 97d7d1bf1SArnaldo Carvalho de Melo * compile time without an explicit #ifdef. Use 107d7d1bf1SArnaldo Carvalho de Melo * cpu_feature_enabled(). 117d7d1bf1SArnaldo Carvalho de Melo */ 127d7d1bf1SArnaldo Carvalho de Melo 1394f45df8SArnaldo Carvalho de Melo #ifdef CONFIG_X86_SMAP 1494f45df8SArnaldo Carvalho de Melo # define DISABLE_SMAP 0 1594f45df8SArnaldo Carvalho de Melo #else 1694f45df8SArnaldo Carvalho de Melo # define DISABLE_SMAP (1<<(X86_FEATURE_SMAP & 31)) 1794f45df8SArnaldo Carvalho de Melo #endif 1894f45df8SArnaldo Carvalho de Melo 19b971880fSBabu Moger #ifdef CONFIG_X86_UMIP 200b44cfb8SIngo Molnar # define DISABLE_UMIP 0 210b44cfb8SIngo Molnar #else 220b44cfb8SIngo Molnar # define DISABLE_UMIP (1<<(X86_FEATURE_UMIP & 31)) 230b44cfb8SIngo Molnar #endif 240b44cfb8SIngo Molnar 257d7d1bf1SArnaldo Carvalho de Melo #ifdef CONFIG_X86_64 267d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_VME (1<<(X86_FEATURE_VME & 31)) 277d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_K6_MTRR (1<<(X86_FEATURE_K6_MTRR & 31)) 287d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_CYRIX_ARR (1<<(X86_FEATURE_CYRIX_ARR & 31)) 297d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_CENTAUR_MCR (1<<(X86_FEATURE_CENTAUR_MCR & 31)) 30549a3976SIngo Molnar # define DISABLE_PCID 0 317d7d1bf1SArnaldo Carvalho de Melo #else 327d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_VME 0 337d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_K6_MTRR 0 347d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_CYRIX_ARR 0 357d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_CENTAUR_MCR 0 36549a3976SIngo Molnar # define DISABLE_PCID (1<<(X86_FEATURE_PCID & 31)) 377d7d1bf1SArnaldo Carvalho de Melo #endif /* CONFIG_X86_64 */ 387d7d1bf1SArnaldo Carvalho de Melo 397d7d1bf1SArnaldo Carvalho de Melo #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS 407d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_PKU 0 417d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_OSPKE 0 427d7d1bf1SArnaldo Carvalho de Melo #else 437d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_PKU (1<<(X86_FEATURE_PKU & 31)) 447d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_OSPKE (1<<(X86_FEATURE_OSPKE & 31)) 457d7d1bf1SArnaldo Carvalho de Melo #endif /* CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS */ 467d7d1bf1SArnaldo Carvalho de Melo 476e30437bSIngo Molnar #ifdef CONFIG_X86_5LEVEL 486e30437bSIngo Molnar # define DISABLE_LA57 0 496e30437bSIngo Molnar #else 506e30437bSIngo Molnar # define DISABLE_LA57 (1<<(X86_FEATURE_LA57 & 31)) 516e30437bSIngo Molnar #endif 526e30437bSIngo Molnar 535d64db29SArnaldo Carvalho de Melo #ifdef CONFIG_PAGE_TABLE_ISOLATION 545d64db29SArnaldo Carvalho de Melo # define DISABLE_PTI 0 555d64db29SArnaldo Carvalho de Melo #else 565d64db29SArnaldo Carvalho de Melo # define DISABLE_PTI (1 << (X86_FEATURE_PTI & 31)) 575d64db29SArnaldo Carvalho de Melo #endif 585d64db29SArnaldo Carvalho de Melo 59*1efe4cbdSArnaldo Carvalho de Melo #ifdef CONFIG_INTEL_IOMMU_SVM 60*1efe4cbdSArnaldo Carvalho de Melo # define DISABLE_ENQCMD 0 61*1efe4cbdSArnaldo Carvalho de Melo #else 6240a6bbf5SArnaldo Carvalho de Melo # define DISABLE_ENQCMD (1 << (X86_FEATURE_ENQCMD & 31)) 63*1efe4cbdSArnaldo Carvalho de Melo #endif 6440a6bbf5SArnaldo Carvalho de Melo 65f93c789aSArnaldo Carvalho de Melo #ifdef CONFIG_X86_SGX 66f93c789aSArnaldo Carvalho de Melo # define DISABLE_SGX 0 67f93c789aSArnaldo Carvalho de Melo #else 68f93c789aSArnaldo Carvalho de Melo # define DISABLE_SGX (1 << (X86_FEATURE_SGX & 31)) 69f93c789aSArnaldo Carvalho de Melo #endif 70f93c789aSArnaldo Carvalho de Melo 717d7d1bf1SArnaldo Carvalho de Melo /* 727d7d1bf1SArnaldo Carvalho de Melo * Make sure to add features to the correct mask 737d7d1bf1SArnaldo Carvalho de Melo */ 747d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK0 (DISABLE_VME) 757d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK1 0 767d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK2 0 777d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK3 (DISABLE_CYRIX_ARR|DISABLE_CENTAUR_MCR|DISABLE_K6_MTRR) 78549a3976SIngo Molnar #define DISABLED_MASK4 (DISABLE_PCID) 797d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK5 0 807d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK6 0 815d64db29SArnaldo Carvalho de Melo #define DISABLED_MASK7 (DISABLE_PTI) 827d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK8 0 83f93c789aSArnaldo Carvalho de Melo #define DISABLED_MASK9 (DISABLE_SMAP|DISABLE_SGX) 847d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK10 0 857d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK11 0 867d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK12 0 877d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK13 0 887d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK14 0 897d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK15 0 9040a6bbf5SArnaldo Carvalho de Melo #define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP| \ 9140a6bbf5SArnaldo Carvalho de Melo DISABLE_ENQCMD) 92840b49baSArnaldo Carvalho de Melo #define DISABLED_MASK17 0 934053717aSArnaldo Carvalho de Melo #define DISABLED_MASK18 0 94fb35d30fSSean Christopherson #define DISABLED_MASK19 0 95fb35d30fSSean Christopherson #define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 20) 967d7d1bf1SArnaldo Carvalho de Melo 977d7d1bf1SArnaldo Carvalho de Melo #endif /* _ASM_X86_DISABLED_FEATURES_H */ 98