cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

internal.h (643B)


      1/* SPDX-License-Identifier: GPL-2.0 */
      2#ifndef __X86_KERNEL_FPU_INTERNAL_H
      3#define __X86_KERNEL_FPU_INTERNAL_H
      4
      5extern struct fpstate init_fpstate;
      6
      7/* CPU feature check wrappers */
      8static __always_inline __pure bool use_xsave(void)
      9{
     10	return cpu_feature_enabled(X86_FEATURE_XSAVE);
     11}
     12
     13static __always_inline __pure bool use_fxsr(void)
     14{
     15	return cpu_feature_enabled(X86_FEATURE_FXSR);
     16}
     17
     18#ifdef CONFIG_X86_DEBUG_FPU
     19# define WARN_ON_FPU(x) WARN_ON_ONCE(x)
     20#else
     21# define WARN_ON_FPU(x) ({ (void)(x); 0; })
     22#endif
     23
     24/* Used in init.c */
     25extern void fpstate_init_user(struct fpstate *fpstate);
     26extern void fpstate_reset(struct fpu *fpu);
     27
     28#endif