x86/oprofile: Fix bogus GCC-8 warning in nmi_setup()
[cris-mirror.git] / arch / x86 / boot / compressed / pgtable_64.c
blobb4469a37e9a16ff758c92e6159922c9dbb1b7228
1 #include <asm/processor.h>
3 /*
4 * __force_order is used by special_insns.h asm code to force instruction
5 * serialization.
7 * It is not referenced from the code, but GCC < 5 with -fPIE would fail
8 * due to an undefined symbol. Define it to make these ancient GCCs work.
9 */
10 unsigned long __force_order;
12 int l5_paging_required(void)
14 /* Check if leaf 7 is supported. */
16 if (native_cpuid_eax(0) < 7)
17 return 0;
19 /* Check if la57 is supported. */
20 if (!(native_cpuid_ecx(7) & (1 << (X86_FEATURE_LA57 & 31))))
21 return 0;
23 /* Check if 5-level paging has already been enabled. */
24 if (native_read_cr4() & X86_CR4_LA57)
25 return 0;
27 return 1;