linux/mm/page_table_check.c

// SPDX-License-Identifier: GPL-2.0

/*
 * Copyright (c) 2021, Google LLC.
 * Pasha Tatashin <[email protected]>
 */
#include <linux/kstrtox.h>
#include <linux/mm.h>
#include <linux/page_table_check.h>
#include <linux/swap.h>
#include <linux/swapops.h>

#undef pr_fmt
#define pr_fmt(fmt)

struct page_table_check {};

static bool __page_table_check_enabled __initdata =
				IS_ENABLED();

DEFINE_STATIC_KEY_TRUE(page_table_check_disabled);
EXPORT_SYMBOL();

static int __init early_page_table_check_param(char *buf)
{}

early_param();

static bool __init need_page_table_check(void)
{}

static void __init init_page_table_check(void)
{}

struct page_ext_operations page_table_check_ops =;

static struct page_table_check *get_page_table_check(struct page_ext *page_ext)
{}

/*
 * An entry is removed from the page table, decrement the counters for that page
 * verify that it is of correct type and counters do not become negative.
 */
static void page_table_check_clear(unsigned long pfn, unsigned long pgcnt)
{}

/*
 * A new entry is added to the page table, increment the counters for that page
 * verify that it is of correct type and is not being mapped with a different
 * type to a different process.
 */
static void page_table_check_set(unsigned long pfn, unsigned long pgcnt,
				 bool rw)
{}

/*
 * page is on free list, or is being allocated, verify that counters are zeroes
 * crash if they are not.
 */
void __page_table_check_zero(struct page *page, unsigned int order)
{}

void __page_table_check_pte_clear(struct mm_struct *mm, pte_t pte)
{}
EXPORT_SYMBOL();

void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd)
{}
EXPORT_SYMBOL();

void __page_table_check_pud_clear(struct mm_struct *mm, pud_t pud)
{}
EXPORT_SYMBOL();

/* Whether the swap entry cached writable information */
static inline bool swap_cached_writable(swp_entry_t entry)
{}

static inline void page_table_check_pte_flags(pte_t pte)
{}

void __page_table_check_ptes_set(struct mm_struct *mm, pte_t *ptep, pte_t pte,
		unsigned int nr)
{}
EXPORT_SYMBOL();

static inline void page_table_check_pmd_flags(pmd_t pmd)
{}

void __page_table_check_pmd_set(struct mm_struct *mm, pmd_t *pmdp, pmd_t pmd)
{}
EXPORT_SYMBOL();

void __page_table_check_pud_set(struct mm_struct *mm, pud_t *pudp, pud_t pud)
{}
EXPORT_SYMBOL();

void __page_table_check_pte_clear_range(struct mm_struct *mm,
					unsigned long addr,
					pmd_t pmd)
{}