diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2024-05-04 00:27:43 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2024-05-04 00:27:43 +0000 |
commit | 80d5633a1fdad786ac7c58cf863eddf2ede0245a (patch) | |
tree | 2c3823c22e5aef2fcd88431d6878fa8038863e20 /sys/dev | |
parent | 43f0c1e5d7c9f0263b166d342a2e7245e13d3157 (diff) |
amd64 is guaranteed to have PAT and CLFLUSH; stop testing cpu flags
for them on that arch.
ok jsg@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/drm/include/asm/cpufeature.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/include/asm/cpufeature.h b/sys/dev/pci/drm/include/asm/cpufeature.h index 621ea054fc3..66c43dfabce 100644 --- a/sys/dev/pci/drm/include/asm/cpufeature.h +++ b/sys/dev/pci/drm/include/asm/cpufeature.h @@ -16,12 +16,18 @@ static inline bool static_cpu_has(uint16_t f) { switch (f) { - case X86_FEATURE_CLFLUSH: - return curcpu()->ci_cflushsz != 0; case X86_FEATURE_XMM4_1: return (cpu_ecxfeature & CPUIDECX_SSE41) != 0; +#ifdef __amd64__ + case X86_FEATURE_CLFLUSH: + case X86_FEATURE_PAT: + return true; +#else + case X86_FEATURE_CLFLUSH: + return curcpu()->ci_cflushsz != 0; case X86_FEATURE_PAT: return (curcpu()->ci_feature_flags & CPUID_PAT) != 0; +#endif case X86_FEATURE_HYPERVISOR: return (cpu_ecxfeature & CPUIDECX_HV) != 0; default: @@ -32,7 +38,7 @@ static_cpu_has(uint16_t f) static inline bool pat_enabled(void) { - return ((curcpu()->ci_feature_flags & CPUID_PAT) != 0); + return static_cpu_has(X86_FEATURE_PAT); } #define boot_cpu_has(x) static_cpu_has(x) |