17d7d1bf1SArnaldo Carvalho de Melo #ifndef _ASM_X86_REQUIRED_FEATURES_H 27d7d1bf1SArnaldo Carvalho de Melo #define _ASM_X86_REQUIRED_FEATURES_H 37d7d1bf1SArnaldo Carvalho de Melo 47d7d1bf1SArnaldo Carvalho de Melo /* Define minimum CPUID feature set for kernel These bits are checked 57d7d1bf1SArnaldo Carvalho de Melo really early to actually display a visible error message before the 67d7d1bf1SArnaldo Carvalho de Melo kernel dies. Make sure to assign features to the proper mask! 77d7d1bf1SArnaldo Carvalho de Melo 87d7d1bf1SArnaldo Carvalho de Melo Some requirements that are not in CPUID yet are also in the 97d7d1bf1SArnaldo Carvalho de Melo CONFIG_X86_MINIMUM_CPU_FAMILY which is checked too. 107d7d1bf1SArnaldo Carvalho de Melo 117d7d1bf1SArnaldo Carvalho de Melo The real information is in arch/x86/Kconfig.cpu, this just converts 127d7d1bf1SArnaldo Carvalho de Melo the CONFIGs into a bitmask */ 137d7d1bf1SArnaldo Carvalho de Melo 147d7d1bf1SArnaldo Carvalho de Melo #ifndef CONFIG_MATH_EMULATION 157d7d1bf1SArnaldo Carvalho de Melo # define NEED_FPU (1<<(X86_FEATURE_FPU & 31)) 167d7d1bf1SArnaldo Carvalho de Melo #else 177d7d1bf1SArnaldo Carvalho de Melo # define NEED_FPU 0 187d7d1bf1SArnaldo Carvalho de Melo #endif 197d7d1bf1SArnaldo Carvalho de Melo 207d7d1bf1SArnaldo Carvalho de Melo #if defined(CONFIG_X86_PAE) || defined(CONFIG_X86_64) 217d7d1bf1SArnaldo Carvalho de Melo # define NEED_PAE (1<<(X86_FEATURE_PAE & 31)) 227d7d1bf1SArnaldo Carvalho de Melo #else 237d7d1bf1SArnaldo Carvalho de Melo # define NEED_PAE 0 247d7d1bf1SArnaldo Carvalho de Melo #endif 257d7d1bf1SArnaldo Carvalho de Melo 267d7d1bf1SArnaldo Carvalho de Melo #ifdef CONFIG_X86_CMPXCHG64 277d7d1bf1SArnaldo Carvalho de Melo # define NEED_CX8 (1<<(X86_FEATURE_CX8 & 31)) 287d7d1bf1SArnaldo Carvalho de Melo #else 297d7d1bf1SArnaldo Carvalho de Melo # define NEED_CX8 0 307d7d1bf1SArnaldo Carvalho de Melo #endif 317d7d1bf1SArnaldo Carvalho de Melo 327d7d1bf1SArnaldo Carvalho de Melo #if defined(CONFIG_X86_CMOV) || defined(CONFIG_X86_64) 337d7d1bf1SArnaldo Carvalho de Melo # define NEED_CMOV (1<<(X86_FEATURE_CMOV & 31)) 347d7d1bf1SArnaldo Carvalho de Melo #else 357d7d1bf1SArnaldo Carvalho de Melo # define NEED_CMOV 0 367d7d1bf1SArnaldo Carvalho de Melo #endif 377d7d1bf1SArnaldo Carvalho de Melo 387d7d1bf1SArnaldo Carvalho de Melo # define NEED_3DNOW 0 397d7d1bf1SArnaldo Carvalho de Melo 407d7d1bf1SArnaldo Carvalho de Melo #if defined(CONFIG_X86_P6_NOP) || defined(CONFIG_X86_64) 417d7d1bf1SArnaldo Carvalho de Melo # define NEED_NOPL (1<<(X86_FEATURE_NOPL & 31)) 427d7d1bf1SArnaldo Carvalho de Melo #else 437d7d1bf1SArnaldo Carvalho de Melo # define NEED_NOPL 0 447d7d1bf1SArnaldo Carvalho de Melo #endif 457d7d1bf1SArnaldo Carvalho de Melo 467d7d1bf1SArnaldo Carvalho de Melo #ifdef CONFIG_MATOM 477d7d1bf1SArnaldo Carvalho de Melo # define NEED_MOVBE (1<<(X86_FEATURE_MOVBE & 31)) 487d7d1bf1SArnaldo Carvalho de Melo #else 497d7d1bf1SArnaldo Carvalho de Melo # define NEED_MOVBE 0 507d7d1bf1SArnaldo Carvalho de Melo #endif 517d7d1bf1SArnaldo Carvalho de Melo 527d7d1bf1SArnaldo Carvalho de Melo #ifdef CONFIG_X86_64 538b2fc25aSArnaldo Carvalho de Melo #ifdef CONFIG_PARAVIRT_XXL 547d7d1bf1SArnaldo Carvalho de Melo /* Paravirtualized systems may not have PSE or PGE available */ 557d7d1bf1SArnaldo Carvalho de Melo #define NEED_PSE 0 567d7d1bf1SArnaldo Carvalho de Melo #define NEED_PGE 0 577d7d1bf1SArnaldo Carvalho de Melo #else 587d7d1bf1SArnaldo Carvalho de Melo #define NEED_PSE (1<<(X86_FEATURE_PSE) & 31) 597d7d1bf1SArnaldo Carvalho de Melo #define NEED_PGE (1<<(X86_FEATURE_PGE) & 31) 607d7d1bf1SArnaldo Carvalho de Melo #endif 617d7d1bf1SArnaldo Carvalho de Melo #define NEED_MSR (1<<(X86_FEATURE_MSR & 31)) 627d7d1bf1SArnaldo Carvalho de Melo #define NEED_FXSR (1<<(X86_FEATURE_FXSR & 31)) 637d7d1bf1SArnaldo Carvalho de Melo #define NEED_XMM (1<<(X86_FEATURE_XMM & 31)) 647d7d1bf1SArnaldo Carvalho de Melo #define NEED_XMM2 (1<<(X86_FEATURE_XMM2 & 31)) 657d7d1bf1SArnaldo Carvalho de Melo #define NEED_LM (1<<(X86_FEATURE_LM & 31)) 667d7d1bf1SArnaldo Carvalho de Melo #else 677d7d1bf1SArnaldo Carvalho de Melo #define NEED_PSE 0 687d7d1bf1SArnaldo Carvalho de Melo #define NEED_MSR 0 697d7d1bf1SArnaldo Carvalho de Melo #define NEED_PGE 0 707d7d1bf1SArnaldo Carvalho de Melo #define NEED_FXSR 0 717d7d1bf1SArnaldo Carvalho de Melo #define NEED_XMM 0 727d7d1bf1SArnaldo Carvalho de Melo #define NEED_XMM2 0 737d7d1bf1SArnaldo Carvalho de Melo #define NEED_LM 0 747d7d1bf1SArnaldo Carvalho de Melo #endif 757d7d1bf1SArnaldo Carvalho de Melo 767d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK0 (NEED_FPU|NEED_PSE|NEED_MSR|NEED_PAE|\ 777d7d1bf1SArnaldo Carvalho de Melo NEED_CX8|NEED_PGE|NEED_FXSR|NEED_CMOV|\ 787d7d1bf1SArnaldo Carvalho de Melo NEED_XMM|NEED_XMM2) 797d7d1bf1SArnaldo Carvalho de Melo #define SSE_MASK (NEED_XMM|NEED_XMM2) 807d7d1bf1SArnaldo Carvalho de Melo 817d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK1 (NEED_LM|NEED_3DNOW) 827d7d1bf1SArnaldo Carvalho de Melo 837d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK2 0 847d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK3 (NEED_NOPL) 857d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK4 (NEED_MOVBE) 867d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK5 0 877d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK6 0 887d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK7 0 897d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK8 0 907d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK9 0 917d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK10 0 927d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK11 0 937d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK12 0 947d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK13 0 957d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK14 0 967d7d1bf1SArnaldo Carvalho de Melo #define REQUIRED_MASK15 0 97e2f73a18SIngo Molnar #define REQUIRED_MASK16 0 98840b49baSArnaldo Carvalho de Melo #define REQUIRED_MASK17 0 994053717aSArnaldo Carvalho de Melo #define REQUIRED_MASK18 0 100fb35d30fSSean Christopherson #define REQUIRED_MASK19 0 101*7d093064SArnaldo Carvalho de Melo #define REQUIRED_MASK20 0 102*7d093064SArnaldo Carvalho de Melo #define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 21) 1037d7d1bf1SArnaldo Carvalho de Melo 1047d7d1bf1SArnaldo Carvalho de Melo #endif /* _ASM_X86_REQUIRED_FEATURES_H */ 105