~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/lib/test_hmm_uapi.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2 /*
  3  * This is a module to test the HMM (Heterogeneous Memory Management) API
  4  * of the kernel. It allows a userspace program to expose its entire address
  5  * space through the HMM test module device file.
  6  */
  7 #ifndef _LIB_TEST_HMM_UAPI_H
  8 #define _LIB_TEST_HMM_UAPI_H
  9 
 10 #include <linux/types.h>
 11 #include <linux/ioctl.h>
 12 
 13 /*
 14  * Structure to pass to the HMM test driver to mimic a device accessing
 15  * system memory and ZONE_DEVICE private memory through device page tables.
 16  *
 17  * @addr: (in) user address the device will read/write
 18  * @ptr: (in) user address where device data is copied to/from
 19  * @npages: (in) number of pages to read/write
 20  * @cpages: (out) number of pages copied
 21  * @faults: (out) number of device page faults seen
 22  */
 23 struct hmm_dmirror_cmd {
 24         __u64           addr;
 25         __u64           ptr;
 26         __u64           npages;
 27         __u64           cpages;
 28         __u64           faults;
 29 };
 30 
 31 /* Expose the address space of the calling process through hmm device file */
 32 #define HMM_DMIRROR_READ                _IOWR('H', 0x00, struct hmm_dmirror_cmd)
 33 #define HMM_DMIRROR_WRITE               _IOWR('H', 0x01, struct hmm_dmirror_cmd)
 34 #define HMM_DMIRROR_MIGRATE_TO_DEV      _IOWR('H', 0x02, struct hmm_dmirror_cmd)
 35 #define HMM_DMIRROR_MIGRATE_TO_SYS      _IOWR('H', 0x03, struct hmm_dmirror_cmd)
 36 #define HMM_DMIRROR_SNAPSHOT            _IOWR('H', 0x04, struct hmm_dmirror_cmd)
 37 #define HMM_DMIRROR_EXCLUSIVE           _IOWR('H', 0x05, struct hmm_dmirror_cmd)
 38 #define HMM_DMIRROR_CHECK_EXCLUSIVE     _IOWR('H', 0x06, struct hmm_dmirror_cmd)
 39 #define HMM_DMIRROR_RELEASE             _IOWR('H', 0x07, struct hmm_dmirror_cmd)
 40 
 41 /*
 42  * Values returned in hmm_dmirror_cmd.ptr for HMM_DMIRROR_SNAPSHOT.
 43  * HMM_DMIRROR_PROT_ERROR: no valid mirror PTE for this page
 44  * HMM_DMIRROR_PROT_NONE: unpopulated PTE or PTE with no access
 45  * HMM_DMIRROR_PROT_READ: read-only PTE
 46  * HMM_DMIRROR_PROT_WRITE: read/write PTE
 47  * HMM_DMIRROR_PROT_PMD: PMD sized page is fully mapped by same permissions
 48  * HMM_DMIRROR_PROT_PUD: PUD sized page is fully mapped by same permissions
 49  * HMM_DMIRROR_PROT_ZERO: special read-only zero page
 50  * HMM_DMIRROR_PROT_DEV_PRIVATE_LOCAL: Migrated device private page on the
 51  *                                      device the ioctl() is made
 52  * HMM_DMIRROR_PROT_DEV_PRIVATE_REMOTE: Migrated device private page on some
 53  *                                      other device
 54  * HMM_DMIRROR_PROT_DEV_COHERENT: Migrate device coherent page on the device
 55  *                                the ioctl() is made
 56  */
 57 enum {
 58         HMM_DMIRROR_PROT_ERROR                  = 0xFF,
 59         HMM_DMIRROR_PROT_NONE                   = 0x00,
 60         HMM_DMIRROR_PROT_READ                   = 0x01,
 61         HMM_DMIRROR_PROT_WRITE                  = 0x02,
 62         HMM_DMIRROR_PROT_PMD                    = 0x04,
 63         HMM_DMIRROR_PROT_PUD                    = 0x08,
 64         HMM_DMIRROR_PROT_ZERO                   = 0x10,
 65         HMM_DMIRROR_PROT_DEV_PRIVATE_LOCAL      = 0x20,
 66         HMM_DMIRROR_PROT_DEV_PRIVATE_REMOTE     = 0x30,
 67         HMM_DMIRROR_PROT_DEV_COHERENT_LOCAL     = 0x40,
 68         HMM_DMIRROR_PROT_DEV_COHERENT_REMOTE    = 0x50,
 69 };
 70 
 71 enum {
 72         /* 0 is reserved to catch uninitialized type fields */
 73         HMM_DMIRROR_MEMORY_DEVICE_PRIVATE = 1,
 74         HMM_DMIRROR_MEMORY_DEVICE_COHERENT,
 75 };
 76 
 77 #endif /* _LIB_TEST_HMM_UAPI_H */
 78 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php