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

test_global_func17.c (248B)


      1// SPDX-License-Identifier: GPL-2.0-only
      2#include <vmlinux.h>
      3#include <bpf/bpf_helpers.h>
      4
      5__noinline int foo(int *p)
      6{
      7	return p ? (*p = 42) : 0;
      8}
      9
     10const volatile int i;
     11
     12SEC("tc")
     13int test_cls(struct __sk_buff *skb)
     14{
     15	return foo((int *)&i);
     16}