18c2ecf20Sopenharmony_ci#ifndef _ASM_X86_REQUIRED_FEATURES_H 28c2ecf20Sopenharmony_ci#define _ASM_X86_REQUIRED_FEATURES_H 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci/* Define minimum CPUID feature set for kernel These bits are checked 58c2ecf20Sopenharmony_ci really early to actually display a visible error message before the 68c2ecf20Sopenharmony_ci kernel dies. Make sure to assign features to the proper mask! 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci Some requirements that are not in CPUID yet are also in the 98c2ecf20Sopenharmony_ci CONFIG_X86_MINIMUM_CPU_FAMILY which is checked too. 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci The real information is in arch/x86/Kconfig.cpu, this just converts 128c2ecf20Sopenharmony_ci the CONFIGs into a bitmask */ 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#ifndef CONFIG_MATH_EMULATION 158c2ecf20Sopenharmony_ci# define NEED_FPU (1<<(X86_FEATURE_FPU & 31)) 168c2ecf20Sopenharmony_ci#else 178c2ecf20Sopenharmony_ci# define NEED_FPU 0 188c2ecf20Sopenharmony_ci#endif 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#if defined(CONFIG_X86_PAE) || defined(CONFIG_X86_64) 218c2ecf20Sopenharmony_ci# define NEED_PAE (1<<(X86_FEATURE_PAE & 31)) 228c2ecf20Sopenharmony_ci#else 238c2ecf20Sopenharmony_ci# define NEED_PAE 0 248c2ecf20Sopenharmony_ci#endif 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci#ifdef CONFIG_X86_CMPXCHG64 278c2ecf20Sopenharmony_ci# define NEED_CX8 (1<<(X86_FEATURE_CX8 & 31)) 288c2ecf20Sopenharmony_ci#else 298c2ecf20Sopenharmony_ci# define NEED_CX8 0 308c2ecf20Sopenharmony_ci#endif 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci#if defined(CONFIG_X86_CMOV) || defined(CONFIG_X86_64) 338c2ecf20Sopenharmony_ci# define NEED_CMOV (1<<(X86_FEATURE_CMOV & 31)) 348c2ecf20Sopenharmony_ci#else 358c2ecf20Sopenharmony_ci# define NEED_CMOV 0 368c2ecf20Sopenharmony_ci#endif 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci#ifdef CONFIG_X86_USE_3DNOW 398c2ecf20Sopenharmony_ci# define NEED_3DNOW (1<<(X86_FEATURE_3DNOW & 31)) 408c2ecf20Sopenharmony_ci#else 418c2ecf20Sopenharmony_ci# define NEED_3DNOW 0 428c2ecf20Sopenharmony_ci#endif 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci#if defined(CONFIG_X86_P6_NOP) || defined(CONFIG_X86_64) 458c2ecf20Sopenharmony_ci# define NEED_NOPL (1<<(X86_FEATURE_NOPL & 31)) 468c2ecf20Sopenharmony_ci#else 478c2ecf20Sopenharmony_ci# define NEED_NOPL 0 488c2ecf20Sopenharmony_ci#endif 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci#ifdef CONFIG_MATOM 518c2ecf20Sopenharmony_ci# define NEED_MOVBE (1<<(X86_FEATURE_MOVBE & 31)) 528c2ecf20Sopenharmony_ci#else 538c2ecf20Sopenharmony_ci# define NEED_MOVBE 0 548c2ecf20Sopenharmony_ci#endif 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci#ifdef CONFIG_X86_64 578c2ecf20Sopenharmony_ci#ifdef CONFIG_PARAVIRT_XXL 588c2ecf20Sopenharmony_ci/* Paravirtualized systems may not have PSE or PGE available */ 598c2ecf20Sopenharmony_ci#define NEED_PSE 0 608c2ecf20Sopenharmony_ci#define NEED_PGE 0 618c2ecf20Sopenharmony_ci#else 628c2ecf20Sopenharmony_ci#define NEED_PSE (1<<(X86_FEATURE_PSE) & 31) 638c2ecf20Sopenharmony_ci#define NEED_PGE (1<<(X86_FEATURE_PGE) & 31) 648c2ecf20Sopenharmony_ci#endif 658c2ecf20Sopenharmony_ci#define NEED_MSR (1<<(X86_FEATURE_MSR & 31)) 668c2ecf20Sopenharmony_ci#define NEED_FXSR (1<<(X86_FEATURE_FXSR & 31)) 678c2ecf20Sopenharmony_ci#define NEED_XMM (1<<(X86_FEATURE_XMM & 31)) 688c2ecf20Sopenharmony_ci#define NEED_XMM2 (1<<(X86_FEATURE_XMM2 & 31)) 698c2ecf20Sopenharmony_ci#define NEED_LM (1<<(X86_FEATURE_LM & 31)) 708c2ecf20Sopenharmony_ci#else 718c2ecf20Sopenharmony_ci#define NEED_PSE 0 728c2ecf20Sopenharmony_ci#define NEED_MSR 0 738c2ecf20Sopenharmony_ci#define NEED_PGE 0 748c2ecf20Sopenharmony_ci#define NEED_FXSR 0 758c2ecf20Sopenharmony_ci#define NEED_XMM 0 768c2ecf20Sopenharmony_ci#define NEED_XMM2 0 778c2ecf20Sopenharmony_ci#define NEED_LM 0 788c2ecf20Sopenharmony_ci#endif 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci#define REQUIRED_MASK0 (NEED_FPU|NEED_PSE|NEED_MSR|NEED_PAE|\ 818c2ecf20Sopenharmony_ci NEED_CX8|NEED_PGE|NEED_FXSR|NEED_CMOV|\ 828c2ecf20Sopenharmony_ci NEED_XMM|NEED_XMM2) 838c2ecf20Sopenharmony_ci#define SSE_MASK (NEED_XMM|NEED_XMM2) 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci#define REQUIRED_MASK1 (NEED_LM|NEED_3DNOW) 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci#define REQUIRED_MASK2 0 888c2ecf20Sopenharmony_ci#define REQUIRED_MASK3 (NEED_NOPL) 898c2ecf20Sopenharmony_ci#define REQUIRED_MASK4 (NEED_MOVBE) 908c2ecf20Sopenharmony_ci#define REQUIRED_MASK5 0 918c2ecf20Sopenharmony_ci#define REQUIRED_MASK6 0 928c2ecf20Sopenharmony_ci#define REQUIRED_MASK7 0 938c2ecf20Sopenharmony_ci#define REQUIRED_MASK8 0 948c2ecf20Sopenharmony_ci#define REQUIRED_MASK9 0 958c2ecf20Sopenharmony_ci#define REQUIRED_MASK10 0 968c2ecf20Sopenharmony_ci#define REQUIRED_MASK11 0 978c2ecf20Sopenharmony_ci#define REQUIRED_MASK12 0 988c2ecf20Sopenharmony_ci#define REQUIRED_MASK13 0 998c2ecf20Sopenharmony_ci#define REQUIRED_MASK14 0 1008c2ecf20Sopenharmony_ci#define REQUIRED_MASK15 0 1018c2ecf20Sopenharmony_ci#define REQUIRED_MASK16 0 1028c2ecf20Sopenharmony_ci#define REQUIRED_MASK17 0 1038c2ecf20Sopenharmony_ci#define REQUIRED_MASK18 0 1048c2ecf20Sopenharmony_ci#define REQUIRED_MASK19 0 1058c2ecf20Sopenharmony_ci#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 20) 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ci#endif /* _ASM_X86_REQUIRED_FEATURES_H */ 108