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

sections.h (833B)


      1/* SPDX-License-Identifier: GPL-2.0-only */
      2/*
      3 * Copyright (C) 2020 Western Digital Corporation or its affiliates.
      4 */
      5#ifndef __ASM_SECTIONS_H
      6#define __ASM_SECTIONS_H
      7
      8#include <asm-generic/sections.h>
      9#include <linux/mm.h>
     10
     11extern char _start[];
     12extern char _start_kernel[];
     13extern char __init_data_begin[], __init_data_end[];
     14extern char __init_text_begin[], __init_text_end[];
     15extern char __alt_start[], __alt_end[];
     16
     17static inline bool is_va_kernel_text(uintptr_t va)
     18{
     19	uintptr_t start = (uintptr_t)_start;
     20	uintptr_t end = (uintptr_t)__init_data_begin;
     21
     22	return va >= start && va < end;
     23}
     24
     25static inline bool is_va_kernel_lm_alias_text(uintptr_t va)
     26{
     27	uintptr_t start = (uintptr_t)lm_alias(_start);
     28	uintptr_t end = (uintptr_t)lm_alias(__init_data_begin);
     29
     30	return va >= start && va < end;
     31}
     32
     33#endif /* __ASM_SECTIONS_H */