My recent Xen patch series introduces a new HYPERVISOR_memory_op to support direct priv-mapping of certain guest resources (such as ioreq pages, used by emulators) by a tools domain, rather than having to access such resources via the guest P2M. This patch adds the necessary infrastructure to the privcmd driver and Xen MMU code to support direct resource mapping. NOTE: The adjustment in the MMU code is partially cosmetic. Xen will now allow a PV tools domain to map guest pages either by GFN or MFN, thus the term 'mfn' has been swapped for 'pfn' in the lower layers of the remap code.
Showing the changes to include/uapi (1 of 7 files). Show all
Unified · Split
| @@ -89,6 +89,15 @@ struct privcmd_dm_op { · 88 unmodified lines | ||
| 89 | 89 | const struct privcmd_dm_op_buf __user *ubufs; |
| 90 | 90 | }; |
| 91 | 91 | |
| 92 | +struct privcmd_mmap_resource { | |
| 93 | + domid_t dom; | |
| 94 | + __u32 type; | |
| 95 | + __u32 id; | |
| 96 | + __u32 idx; | |
| 97 | + __u64 num; | |
| 98 | + __u64 addr; | |
| 99 | +}; | |
| 100 | + | |
| 92 | 101 | /* |
| 93 | 102 | * @cmd: IOCTL_PRIVCMD_HYPERCALL |
| 94 | 103 | * @arg: &privcmd_hypercall_t |
| @@ -114,5 +123,7 @@ struct privcmd_dm_op { · 19 unmodified lines | ||
| 114 | 123 | _IOC(_IOC_NONE, 'P', 5, sizeof(struct privcmd_dm_op)) |
| 115 | 124 | #define IOCTL_PRIVCMD_RESTRICT \ |
| 116 | 125 | _IOC(_IOC_NONE, 'P', 6, sizeof(domid_t)) |
| 126 | +#define IOCTL_PRIVCMD_MMAP_RESOURCE \ | |
| 127 | + _IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource)) | |
| 117 | 128 | |
| 118 | 129 | #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */ |