xref: /linux/tools/arch/x86/include/asm/disabled-features.h (revision 6e30437bd42c4d4e9cfc4c40efda00eb83a11cde)
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 
137d7d1bf1SArnaldo Carvalho de Melo #ifdef CONFIG_X86_INTEL_MPX
147d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_MPX	0
157d7d1bf1SArnaldo Carvalho de Melo #else
167d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_MPX	(1<<(X86_FEATURE_MPX & 31))
177d7d1bf1SArnaldo Carvalho de Melo #endif
187d7d1bf1SArnaldo Carvalho de Melo 
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))
247d7d1bf1SArnaldo Carvalho de Melo #else
257d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_VME		0
267d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_K6_MTRR	0
277d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_CYRIX_ARR	0
287d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_CENTAUR_MCR	0
297d7d1bf1SArnaldo Carvalho de Melo #endif /* CONFIG_X86_64 */
307d7d1bf1SArnaldo Carvalho de Melo 
317d7d1bf1SArnaldo Carvalho de Melo #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
327d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_PKU		0
337d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_OSPKE		0
347d7d1bf1SArnaldo Carvalho de Melo #else
357d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_PKU		(1<<(X86_FEATURE_PKU & 31))
367d7d1bf1SArnaldo Carvalho de Melo # define DISABLE_OSPKE		(1<<(X86_FEATURE_OSPKE & 31))
377d7d1bf1SArnaldo Carvalho de Melo #endif /* CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS */
387d7d1bf1SArnaldo Carvalho de Melo 
39*6e30437bSIngo Molnar #ifdef CONFIG_X86_5LEVEL
40*6e30437bSIngo Molnar # define DISABLE_LA57	0
41*6e30437bSIngo Molnar #else
42*6e30437bSIngo Molnar # define DISABLE_LA57	(1<<(X86_FEATURE_LA57 & 31))
43*6e30437bSIngo Molnar #endif
44*6e30437bSIngo Molnar 
457d7d1bf1SArnaldo Carvalho de Melo /*
467d7d1bf1SArnaldo Carvalho de Melo  * Make sure to add features to the correct mask
477d7d1bf1SArnaldo Carvalho de Melo  */
487d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK0	(DISABLE_VME)
497d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK1	0
507d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK2	0
517d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK3	(DISABLE_CYRIX_ARR|DISABLE_CENTAUR_MCR|DISABLE_K6_MTRR)
527d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK4	0
537d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK5	0
547d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK6	0
557d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK7	0
567d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK8	0
577d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK9	(DISABLE_MPX)
587d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK10	0
597d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK11	0
607d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK12	0
617d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK13	0
627d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK14	0
637d7d1bf1SArnaldo Carvalho de Melo #define DISABLED_MASK15	0
64*6e30437bSIngo Molnar #define DISABLED_MASK16	(DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57)
65840b49baSArnaldo Carvalho de Melo #define DISABLED_MASK17	0
66840b49baSArnaldo Carvalho de Melo #define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 18)
677d7d1bf1SArnaldo Carvalho de Melo 
687d7d1bf1SArnaldo Carvalho de Melo #endif /* _ASM_X86_DISABLED_FEATURES_H */
69