diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-05-31 21:45:42 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-05-31 21:45:42 +0200 |
commit | 7fcf98db0df9cc374e8afe88aa57a19b0768d5ee (patch) | |
tree | bf645274494b63bea2af1205e2f42e73784529ad /src/compat/compat.h | |
parent | blake2s: add ssse3 to nobs (diff) | |
download | wireguard-monolithic-historical-7fcf98db0df9cc374e8afe88aa57a19b0768d5ee.tar.xz wireguard-monolithic-historical-7fcf98db0df9cc374e8afe88aa57a19b0768d5ee.zip |
compat: don't call xgetbv on cpus with no XSAVE
Diffstat (limited to 'src/compat/compat.h')
-rw-r--r-- | src/compat/compat.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h index c34f754..861601c 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -599,7 +599,7 @@ static int wg_get_device_dump_real(a, b) #include <asm/xcr.h> static inline int cpu_has_xfeatures(u64 xfeatures_needed, const char **feature_name) { - return xgetbv(XCR_XFEATURE_ENABLED_MASK) & xfeatures_needed; + return boot_cpu_has(X86_FEATURE_XSAVE) && xgetbv(XCR_XFEATURE_ENABLED_MASK) & xfeatures_needed; } #endif #ifndef XFEATURE_MASK_YMM |