162306a36Sopenharmony_ci#ifndef _ASM_X86_REQUIRED_FEATURES_H 262306a36Sopenharmony_ci#define _ASM_X86_REQUIRED_FEATURES_H 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci/* Define minimum CPUID feature set for kernel These bits are checked 562306a36Sopenharmony_ci really early to actually display a visible error message before the 662306a36Sopenharmony_ci kernel dies. Make sure to assign features to the proper mask! 762306a36Sopenharmony_ci 862306a36Sopenharmony_ci Some requirements that are not in CPUID yet are also in the 962306a36Sopenharmony_ci CONFIG_X86_MINIMUM_CPU_FAMILY which is checked too. 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci The real information is in arch/x86/Kconfig.cpu, this just converts 1262306a36Sopenharmony_ci the CONFIGs into a bitmask */ 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci#ifndef CONFIG_MATH_EMULATION 1562306a36Sopenharmony_ci# define NEED_FPU (1<<(X86_FEATURE_FPU & 31)) 1662306a36Sopenharmony_ci#else 1762306a36Sopenharmony_ci# define NEED_FPU 0 1862306a36Sopenharmony_ci#endif 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci#if defined(CONFIG_X86_PAE) || defined(CONFIG_X86_64) 2162306a36Sopenharmony_ci# define NEED_PAE (1<<(X86_FEATURE_PAE & 31)) 2262306a36Sopenharmony_ci#else 2362306a36Sopenharmony_ci# define NEED_PAE 0 2462306a36Sopenharmony_ci#endif 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci#ifdef CONFIG_X86_CMPXCHG64 2762306a36Sopenharmony_ci# define NEED_CX8 (1<<(X86_FEATURE_CX8 & 31)) 2862306a36Sopenharmony_ci#else 2962306a36Sopenharmony_ci# define NEED_CX8 0 3062306a36Sopenharmony_ci#endif 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci#if defined(CONFIG_X86_CMOV) || defined(CONFIG_X86_64) 3362306a36Sopenharmony_ci# define NEED_CMOV (1<<(X86_FEATURE_CMOV & 31)) 3462306a36Sopenharmony_ci#else 3562306a36Sopenharmony_ci# define NEED_CMOV 0 3662306a36Sopenharmony_ci#endif 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ci# define NEED_3DNOW 0 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci#if defined(CONFIG_X86_P6_NOP) || defined(CONFIG_X86_64) 4162306a36Sopenharmony_ci# define NEED_NOPL (1<<(X86_FEATURE_NOPL & 31)) 4262306a36Sopenharmony_ci#else 4362306a36Sopenharmony_ci# define NEED_NOPL 0 4462306a36Sopenharmony_ci#endif 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_ci#ifdef CONFIG_MATOM 4762306a36Sopenharmony_ci# define NEED_MOVBE (1<<(X86_FEATURE_MOVBE & 31)) 4862306a36Sopenharmony_ci#else 4962306a36Sopenharmony_ci# define NEED_MOVBE 0 5062306a36Sopenharmony_ci#endif 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ci#ifdef CONFIG_X86_64 5362306a36Sopenharmony_ci#ifdef CONFIG_PARAVIRT_XXL 5462306a36Sopenharmony_ci/* Paravirtualized systems may not have PSE or PGE available */ 5562306a36Sopenharmony_ci#define NEED_PSE 0 5662306a36Sopenharmony_ci#define NEED_PGE 0 5762306a36Sopenharmony_ci#else 5862306a36Sopenharmony_ci#define NEED_PSE (1<<(X86_FEATURE_PSE) & 31) 5962306a36Sopenharmony_ci#define NEED_PGE (1<<(X86_FEATURE_PGE) & 31) 6062306a36Sopenharmony_ci#endif 6162306a36Sopenharmony_ci#define NEED_MSR (1<<(X86_FEATURE_MSR & 31)) 6262306a36Sopenharmony_ci#define NEED_FXSR (1<<(X86_FEATURE_FXSR & 31)) 6362306a36Sopenharmony_ci#define NEED_XMM (1<<(X86_FEATURE_XMM & 31)) 6462306a36Sopenharmony_ci#define NEED_XMM2 (1<<(X86_FEATURE_XMM2 & 31)) 6562306a36Sopenharmony_ci#define NEED_LM (1<<(X86_FEATURE_LM & 31)) 6662306a36Sopenharmony_ci#else 6762306a36Sopenharmony_ci#define NEED_PSE 0 6862306a36Sopenharmony_ci#define NEED_MSR 0 6962306a36Sopenharmony_ci#define NEED_PGE 0 7062306a36Sopenharmony_ci#define NEED_FXSR 0 7162306a36Sopenharmony_ci#define NEED_XMM 0 7262306a36Sopenharmony_ci#define NEED_XMM2 0 7362306a36Sopenharmony_ci#define NEED_LM 0 7462306a36Sopenharmony_ci#endif 7562306a36Sopenharmony_ci 7662306a36Sopenharmony_ci#define REQUIRED_MASK0 (NEED_FPU|NEED_PSE|NEED_MSR|NEED_PAE|\ 7762306a36Sopenharmony_ci NEED_CX8|NEED_PGE|NEED_FXSR|NEED_CMOV|\ 7862306a36Sopenharmony_ci NEED_XMM|NEED_XMM2) 7962306a36Sopenharmony_ci#define SSE_MASK (NEED_XMM|NEED_XMM2) 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ci#define REQUIRED_MASK1 (NEED_LM|NEED_3DNOW) 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_ci#define REQUIRED_MASK2 0 8462306a36Sopenharmony_ci#define REQUIRED_MASK3 (NEED_NOPL) 8562306a36Sopenharmony_ci#define REQUIRED_MASK4 (NEED_MOVBE) 8662306a36Sopenharmony_ci#define REQUIRED_MASK5 0 8762306a36Sopenharmony_ci#define REQUIRED_MASK6 0 8862306a36Sopenharmony_ci#define REQUIRED_MASK7 0 8962306a36Sopenharmony_ci#define REQUIRED_MASK8 0 9062306a36Sopenharmony_ci#define REQUIRED_MASK9 0 9162306a36Sopenharmony_ci#define REQUIRED_MASK10 0 9262306a36Sopenharmony_ci#define REQUIRED_MASK11 0 9362306a36Sopenharmony_ci#define REQUIRED_MASK12 0 9462306a36Sopenharmony_ci#define REQUIRED_MASK13 0 9562306a36Sopenharmony_ci#define REQUIRED_MASK14 0 9662306a36Sopenharmony_ci#define REQUIRED_MASK15 0 9762306a36Sopenharmony_ci#define REQUIRED_MASK16 0 9862306a36Sopenharmony_ci#define REQUIRED_MASK17 0 9962306a36Sopenharmony_ci#define REQUIRED_MASK18 0 10062306a36Sopenharmony_ci#define REQUIRED_MASK19 0 10162306a36Sopenharmony_ci#define REQUIRED_MASK20 0 10262306a36Sopenharmony_ci#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 21) 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci#endif /* _ASM_X86_REQUIRED_FEATURES_H */ 105