disabled-features.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef _ASM_X86_DISABLED_FEATURES_H
  2. #define _ASM_X86_DISABLED_FEATURES_H
  3. /* These features, although they might be available in a CPU
  4. * will not be used because the compile options to support
  5. * them are not present.
  6. *
  7. * This code allows them to be checked and disabled at
  8. * compile time without an explicit #ifdef. Use
  9. * cpu_feature_enabled().
  10. */
  11. #ifdef CONFIG_X86_INTEL_MPX
  12. # define DISABLE_MPX 0
  13. #else
  14. # define DISABLE_MPX (1<<(X86_FEATURE_MPX & 31))
  15. #endif
  16. #ifdef CONFIG_X86_64
  17. # define DISABLE_VME (1<<(X86_FEATURE_VME & 31))
  18. # define DISABLE_K6_MTRR (1<<(X86_FEATURE_K6_MTRR & 31))
  19. # define DISABLE_CYRIX_ARR (1<<(X86_FEATURE_CYRIX_ARR & 31))
  20. # define DISABLE_CENTAUR_MCR (1<<(X86_FEATURE_CENTAUR_MCR & 31))
  21. #else
  22. # define DISABLE_VME 0
  23. # define DISABLE_K6_MTRR 0
  24. # define DISABLE_CYRIX_ARR 0
  25. # define DISABLE_CENTAUR_MCR 0
  26. #endif /* CONFIG_X86_64 */
  27. #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
  28. # define DISABLE_PKU 0
  29. # define DISABLE_OSPKE 0
  30. #else
  31. # define DISABLE_PKU (1<<(X86_FEATURE_PKU & 31))
  32. # define DISABLE_OSPKE (1<<(X86_FEATURE_OSPKE & 31))
  33. #endif /* CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS */
  34. /*
  35. * Make sure to add features to the correct mask
  36. */
  37. #define DISABLED_MASK0 (DISABLE_VME)
  38. #define DISABLED_MASK1 0
  39. #define DISABLED_MASK2 0
  40. #define DISABLED_MASK3 (DISABLE_CYRIX_ARR|DISABLE_CENTAUR_MCR|DISABLE_K6_MTRR)
  41. #define DISABLED_MASK4 0
  42. #define DISABLED_MASK5 0
  43. #define DISABLED_MASK6 0
  44. #define DISABLED_MASK7 0
  45. #define DISABLED_MASK8 0
  46. #define DISABLED_MASK9 (DISABLE_MPX)
  47. #define DISABLED_MASK10 0
  48. #define DISABLED_MASK11 0
  49. #define DISABLED_MASK12 0
  50. #define DISABLED_MASK13 0
  51. #define DISABLED_MASK14 0
  52. #define DISABLED_MASK15 0
  53. #define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE)
  54. #define DISABLED_MASK17 0
  55. #define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 18)
  56. #endif /* _ASM_X86_DISABLED_FEATURES_H */