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

page_reporting.h (895B)


      1/* SPDX-License-Identifier: GPL-2.0 */
      2#ifndef _LINUX_PAGE_REPORTING_H
      3#define _LINUX_PAGE_REPORTING_H
      4
      5#include <linux/mmzone.h>
      6#include <linux/scatterlist.h>
      7
      8/* This value should always be a power of 2, see page_reporting_cycle() */
      9#define PAGE_REPORTING_CAPACITY		32
     10
     11struct page_reporting_dev_info {
     12	/* function that alters pages to make them "reported" */
     13	int (*report)(struct page_reporting_dev_info *prdev,
     14		      struct scatterlist *sg, unsigned int nents);
     15
     16	/* work struct for processing reports */
     17	struct delayed_work work;
     18
     19	/* Current state of page reporting */
     20	atomic_t state;
     21
     22	/* Minimal order of page reporting */
     23	unsigned int order;
     24};
     25
     26/* Tear-down and bring-up for page reporting devices */
     27void page_reporting_unregister(struct page_reporting_dev_info *prdev);
     28int page_reporting_register(struct page_reporting_dev_info *prdev);
     29#endif /*_LINUX_PAGE_REPORTING_H */