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

processor.h (448B)


      1/* SPDX-License-Identifier: GPL-2.0-only */
      2/*
      3 * Copyright (C) 2020 ARM Ltd.
      4 */
      5#ifndef __ASM_VDSO_PROCESSOR_H
      6#define __ASM_VDSO_PROCESSOR_H
      7
      8#ifndef __ASSEMBLY__
      9
     10/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
     11static __always_inline void rep_nop(void)
     12{
     13	asm volatile("rep; nop" ::: "memory");
     14}
     15
     16static __always_inline void cpu_relax(void)
     17{
     18	rep_nop();
     19}
     20
     21#endif /* __ASSEMBLY__ */
     22
     23#endif /* __ASM_VDSO_PROCESSOR_H */