xref: /linux/tools/arch/x86/include/asm/disabled-features.h (revision dbae0a934f09208075ec3e73491bd0844e1397b3)
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 
13b971880fSBabu Moger #ifdef CONFIG_X86_UMIP
140b44cfb8SIngo Molnar # define DISABLE_UMIP	0
150b44cfb8SIngo Molnar #else
160b44cfb8SIngo Molnar # define DISABLE_UMIP	(1<<(X86_FEATURE_UMIP & 31))
170b44cfb8SIngo Molnar #endif
180b44cfb8SIngo Molnar 
197d7d1bf1SArnaldo Carvalho de Melo #ifdef CONFIG_X86_64
207d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_VME		(1<<(X86_FEATURE_VME & 31))
217d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_K6_MTRR	(1<<(X86_FEATURE_K6_MTRR & 31))
227d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_CYRIX_ARR	(1<<(X86_FEATURE_CYRIX_ARR & 31))
237d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_CENTAUR_MCR	(1<<(X86_FEATURE_CENTAUR_MCR & 31))
24549a3976SIngo Molnar # define DISABLE_PCID		0
257d7d1bf1SArnaldo Carvalho de Melo #else
267d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_VME		0
277d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_K6_MTRR	0
287d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_CYRIX_ARR	0
297d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_CENTAUR_MCR	0
30549a3976SIngo Molnar # define DISABLE_PCID		(1<<(X86_FEATURE_PCID & 31))
317d7d1bf1SArnaldo Carvalho de Melo #endif /* CONFIG_X86_64 */
327d7d1bf1SArnaldo Carvalho de Melo 
337d7d1bf1SArnaldo Carvalho de Melo #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
347d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_PKU		0
357d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_OSPKE		0
367d7d1bf1SArnaldo Carvalho de Melo #else
377d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_PKU		(1<<(X86_FEATURE_PKU & 31))
387d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_OSPKE		(1<<(X86_FEATURE_OSPKE & 31))
397d7d1bf1SArnaldo Carvalho de Melo #endif /* CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS */
407d7d1bf1SArnaldo Carvalho de Melo 
416e30437bSIngo Molnar #ifdef CONFIG_X86_5LEVEL
426e30437bSIngo Molnar # define DISABLE_LA57	0
436e30437bSIngo Molnar #else
446e30437bSIngo Molnar # define DISABLE_LA57	(1<<(X86_FEATURE_LA57 & 31))
456e30437bSIngo Molnar #endif
466e30437bSIngo Molnar 
475d64db29SArnaldo Carvalho de Melo #ifdef CONFIG_PAGE_TABLE_ISOLATION
485d64db29SArnaldo Carvalho de Melo # define DISABLE_PTI		0
495d64db29SArnaldo Carvalho de Melo #else
505d64db29SArnaldo Carvalho de Melo # define DISABLE_PTI		(1 << (X86_FEATURE_PTI & 31))
515d64db29SArnaldo Carvalho de Melo #endif
525d64db29SArnaldo Carvalho de Melo 
531efe4cbdSArnaldo Carvalho de Melo #ifdef CONFIG_INTEL_IOMMU_SVM
541efe4cbdSArnaldo Carvalho de Melo # define DISABLE_ENQCMD		0
551efe4cbdSArnaldo Carvalho de Melo #else
5640a6bbf5SArnaldo Carvalho de Melo # define DISABLE_ENQCMD		(1 << (X86_FEATURE_ENQCMD & 31))
571efe4cbdSArnaldo Carvalho de Melo #endif
5840a6bbf5SArnaldo Carvalho de Melo 
59f93c789aSArnaldo Carvalho de Melo #ifdef CONFIG_X86_SGX
60f93c789aSArnaldo Carvalho de Melo # define DISABLE_SGX	0
61f93c789aSArnaldo Carvalho de Melo #else
62f93c789aSArnaldo Carvalho de Melo # define DISABLE_SGX	(1 << (X86_FEATURE_SGX & 31))
63f93c789aSArnaldo Carvalho de Melo #endif
64f93c789aSArnaldo Carvalho de Melo 
657d7d1bf1SArnaldo Carvalho de Melo /*
667d7d1bf1SArnaldo Carvalho de Melo  * Make sure to add features to the correct mask
677d7d1bf1SArnaldo Carvalho de Melo  */
687d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK0	(DISABLE_VME)
697d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK1	0
707d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK2	0
717d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK3	(DISABLE_CYRIX_ARR|DISABLE_CENTAUR_MCR|DISABLE_K6_MTRR)
72549a3976SIngo Molnar #define DISABLED_MASK4	(DISABLE_PCID)
737d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK5	0
747d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK6	0
755d64db29SArnaldo Carvalho de Melo #define DISABLED_MASK7	(DISABLE_PTI)
767d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK8	0
77*dbae0a93SBorislav Petkov #define DISABLED_MASK9	(DISABLE_SGX)
787d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK10	0
797d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK11	0
807d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK12	0
817d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK13	0
827d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK14	0
837d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK15	0
8440a6bbf5SArnaldo Carvalho de Melo #define DISABLED_MASK16	(DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP| \
8540a6bbf5SArnaldo Carvalho de Melo 			 DISABLE_ENQCMD)
86840b49baSArnaldo Carvalho de Melo #define DISABLED_MASK17	0
874053717aSArnaldo Carvalho de Melo #define DISABLED_MASK18	0
88fb35d30fSSean Christopherson #define DISABLED_MASK19	0
89fb35d30fSSean Christopherson #define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 20)
907d7d1bf1SArnaldo Carvalho de Melo 
917d7d1bf1SArnaldo Carvalho de Melo #endif /* _ASM_X86_DISABLED_FEATURES_H */
92