// SPDX-License-Identifier: GPL-2.0/* * This is a module to test the HMM (Heterogeneous Memory Management) * mirror and zone device private memory migration APIs of the kernel. * Userspace programs can register with the driver to mirror their own address * space and can use the device to read/write any valid virtual address. */#include<linux/init.h>#include<linux/fs.h>#include<linux/mm.h>#include<linux/module.h>#include<linux/kernel.h>#include<linux/cdev.h>#include<linux/device.h>#include<linux/memremap.h>#include<linux/mutex.h>#include<linux/rwsem.h>#include<linux/sched.h>#include<linux/slab.h>#include<linux/highmem.h>#include<linux/delay.h>#include<linux/pagemap.h>#include<linux/hmm.h>#include<linux/vmalloc.h>#include<linux/swap.h>#include<linux/swapops.h>#include<linux/sched/mm.h>#include<linux/platform_device.h>#include<linux/rmap.h>#include<linux/mmu_notifier.h>#include<linux/migrate.h>#include"test_hmm_uapi.h"#define DMIRROR_NDEVICES 4