logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

acrn.h (18956B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * Userspace interface for /dev/acrn_hsm - ACRN Hypervisor Service Module
  4. *
  5. * This file can be used by applications that need to communicate with the HSM
  6. * via the ioctl interface.
  7. *
  8. * Copyright (C) 2021 Intel Corporation. All rights reserved.
  9. */
  10. #ifndef _ACRN_H
  11. #define _ACRN_H
  12. #include <linux/types.h>
  13. #define ACRN_IO_REQUEST_MAX 16
  14. #define ACRN_IOREQ_STATE_PENDING 0
  15. #define ACRN_IOREQ_STATE_COMPLETE 1
  16. #define ACRN_IOREQ_STATE_PROCESSING 2
  17. #define ACRN_IOREQ_STATE_FREE 3
  18. #define ACRN_IOREQ_TYPE_PORTIO 0
  19. #define ACRN_IOREQ_TYPE_MMIO 1
  20. #define ACRN_IOREQ_TYPE_PCICFG 2
  21. #define ACRN_IOREQ_DIR_READ 0
  22. #define ACRN_IOREQ_DIR_WRITE 1
  23. /**
  24. * struct acrn_mmio_request - Info of a MMIO I/O request
  25. * @direction: Access direction of this request (ACRN_IOREQ_DIR_*)
  26. * @reserved: Reserved for alignment and should be 0
  27. * @address: Access address of this MMIO I/O request
  28. * @size: Access size of this MMIO I/O request
  29. * @value: Read/write value of this MMIO I/O request
  30. */
  31. struct acrn_mmio_request {
  32. __u32 direction;
  33. __u32 reserved;
  34. __u64 address;
  35. __u64 size;
  36. __u64 value;
  37. };
  38. /**
  39. * struct acrn_pio_request - Info of a PIO I/O request
  40. * @direction: Access direction of this request (ACRN_IOREQ_DIR_*)
  41. * @reserved: Reserved for alignment and should be 0
  42. * @address: Access address of this PIO I/O request
  43. * @size: Access size of this PIO I/O request
  44. * @value: Read/write value of this PIO I/O request
  45. */
  46. struct acrn_pio_request {
  47. __u32 direction;
  48. __u32 reserved;
  49. __u64 address;
  50. __u64 size;
  51. __u32 value;
  52. };
  53. /**
  54. * struct acrn_pci_request - Info of a PCI I/O request
  55. * @direction: Access direction of this request (ACRN_IOREQ_DIR_*)
  56. * @reserved: Reserved for alignment and should be 0
  57. * @size: Access size of this PCI I/O request
  58. * @value: Read/write value of this PIO I/O request
  59. * @bus: PCI bus value of this PCI I/O request
  60. * @dev: PCI device value of this PCI I/O request
  61. * @func: PCI function value of this PCI I/O request
  62. * @reg: PCI config space offset of this PCI I/O request
  63. *
  64. * Need keep same header layout with &struct acrn_pio_request.
  65. */
  66. struct acrn_pci_request {
  67. __u32 direction;
  68. __u32 reserved[3];
  69. __u64 size;
  70. __u32 value;
  71. __u32 bus;
  72. __u32 dev;
  73. __u32 func;
  74. __u32 reg;
  75. };
  76. /**
  77. * struct acrn_io_request - 256-byte ACRN I/O request
  78. * @type: Type of this request (ACRN_IOREQ_TYPE_*).
  79. * @completion_polling: Polling flag. Hypervisor will poll completion of the
  80. * I/O request if this flag set.
  81. * @reserved0: Reserved fields.
  82. * @reqs: Union of different types of request. Byte offset: 64.
  83. * @reqs.pio_request: PIO request data of the I/O request.
  84. * @reqs.pci_request: PCI configuration space request data of the I/O request.
  85. * @reqs.mmio_request: MMIO request data of the I/O request.
  86. * @reqs.data: Raw data of the I/O request.
  87. * @reserved1: Reserved fields.
  88. * @kernel_handled: Flag indicates this request need be handled in kernel.
  89. * @processed: The status of this request (ACRN_IOREQ_STATE_*).
  90. *
  91. * The state transitions of ACRN I/O request:
  92. *
  93. * FREE -> PENDING -> PROCESSING -> COMPLETE -> FREE -> ...
  94. *
  95. * An I/O request in COMPLETE or FREE state is owned by the hypervisor. HSM and
  96. * ACRN userspace are in charge of processing the others.
  97. *
  98. * On basis of the states illustrated above, a typical lifecycle of ACRN IO
  99. * request would look like:
  100. *
  101. * Flow (assume the initial state is FREE)
  102. * |
  103. * | Service VM vCPU 0 Service VM vCPU x User vCPU y
  104. * |
  105. * | hypervisor:
  106. * | fills in type, addr, etc.
  107. * | pauses the User VM vCPU y
  108. * | sets the state to PENDING (a)
  109. * | fires an upcall to Service VM
  110. * |
  111. * | HSM:
  112. * | scans for PENDING requests
  113. * | sets the states to PROCESSING (b)
  114. * | assigns the requests to clients (c)
  115. * V
  116. * | client:
  117. * | scans for the assigned requests
  118. * | handles the requests (d)
  119. * | HSM:
  120. * | sets states to COMPLETE
  121. * | notifies the hypervisor
  122. * |
  123. * | hypervisor:
  124. * | resumes User VM vCPU y (e)
  125. * |
  126. * | hypervisor:
  127. * | post handling (f)
  128. * V sets states to FREE
  129. *
  130. * Note that the procedures (a) to (f) in the illustration above require to be
  131. * strictly processed in the order. One vCPU cannot trigger another request of
  132. * I/O emulation before completing the previous one.
  133. *
  134. * Atomic and barriers are required when HSM and hypervisor accessing the state
  135. * of &struct acrn_io_request.
  136. *
  137. */
  138. struct acrn_io_request {
  139. __u32 type;
  140. __u32 completion_polling;
  141. __u32 reserved0[14];
  142. union {
  143. struct acrn_pio_request pio_request;
  144. struct acrn_pci_request pci_request;
  145. struct acrn_mmio_request mmio_request;
  146. __u64 data[8];
  147. } reqs;
  148. __u32 reserved1;
  149. __u32 kernel_handled;
  150. __u32 processed;
  151. } __attribute__((aligned(256)));
  152. struct acrn_io_request_buffer {
  153. union {
  154. struct acrn_io_request req_slot[ACRN_IO_REQUEST_MAX];
  155. __u8 reserved[4096];
  156. };
  157. };
  158. /**
  159. * struct acrn_ioreq_notify - The structure of ioreq completion notification
  160. * @vmid: User VM ID
  161. * @reserved: Reserved and should be 0
  162. * @vcpu: vCPU ID
  163. */
  164. struct acrn_ioreq_notify {
  165. __u16 vmid;
  166. __u16 reserved;
  167. __u32 vcpu;
  168. };
  169. /**
  170. * struct acrn_vm_creation - Info to create a User VM
  171. * @vmid: User VM ID returned from the hypervisor
  172. * @reserved0: Reserved and must be 0
  173. * @vcpu_num: Number of vCPU in the VM. Return from hypervisor.
  174. * @reserved1: Reserved and must be 0
  175. * @uuid: Empty space never to be used again (used to be UUID of the VM)
  176. * @vm_flag: Flag of the VM creating. Pass to hypervisor directly.
  177. * @ioreq_buf: Service VM GPA of I/O request buffer. Pass to
  178. * hypervisor directly.
  179. * @cpu_affinity: CPU affinity of the VM. Pass to hypervisor directly.
  180. * It's a bitmap which indicates CPUs used by the VM.
  181. */
  182. struct acrn_vm_creation {
  183. __u16 vmid;
  184. __u16 reserved0;
  185. __u16 vcpu_num;
  186. __u16 reserved1;
  187. __u8 uuid[16];
  188. __u64 vm_flag;
  189. __u64 ioreq_buf;
  190. __u64 cpu_affinity;
  191. };
  192. /**
  193. * struct acrn_gp_regs - General registers of a User VM
  194. * @rax: Value of register RAX
  195. * @rcx: Value of register RCX
  196. * @rdx: Value of register RDX
  197. * @rbx: Value of register RBX
  198. * @rsp: Value of register RSP
  199. * @rbp: Value of register RBP
  200. * @rsi: Value of register RSI
  201. * @rdi: Value of register RDI
  202. * @r8: Value of register R8
  203. * @r9: Value of register R9
  204. * @r10: Value of register R10
  205. * @r11: Value of register R11
  206. * @r12: Value of register R12
  207. * @r13: Value of register R13
  208. * @r14: Value of register R14
  209. * @r15: Value of register R15
  210. */
  211. struct acrn_gp_regs {
  212. __le64 rax;
  213. __le64 rcx;
  214. __le64 rdx;
  215. __le64 rbx;
  216. __le64 rsp;
  217. __le64 rbp;
  218. __le64 rsi;
  219. __le64 rdi;
  220. __le64 r8;
  221. __le64 r9;
  222. __le64 r10;
  223. __le64 r11;
  224. __le64 r12;
  225. __le64 r13;
  226. __le64 r14;
  227. __le64 r15;
  228. };
  229. /**
  230. * struct acrn_descriptor_ptr - Segment descriptor table of a User VM.
  231. * @limit: Limit field.
  232. * @base: Base field.
  233. * @reserved: Reserved and must be 0.
  234. */
  235. struct acrn_descriptor_ptr {
  236. __le16 limit;
  237. __le64 base;
  238. __le16 reserved[3];
  239. } __attribute__ ((__packed__));
  240. /**
  241. * struct acrn_regs - Registers structure of a User VM
  242. * @gprs: General registers
  243. * @gdt: Global Descriptor Table
  244. * @idt: Interrupt Descriptor Table
  245. * @rip: Value of register RIP
  246. * @cs_base: Base of code segment selector
  247. * @cr0: Value of register CR0
  248. * @cr4: Value of register CR4
  249. * @cr3: Value of register CR3
  250. * @ia32_efer: Value of IA32_EFER MSR
  251. * @rflags: Value of regsiter RFLAGS
  252. * @reserved_64: Reserved and must be 0
  253. * @cs_ar: Attribute field of code segment selector
  254. * @cs_limit: Limit field of code segment selector
  255. * @reserved_32: Reserved and must be 0
  256. * @cs_sel: Value of code segment selector
  257. * @ss_sel: Value of stack segment selector
  258. * @ds_sel: Value of data segment selector
  259. * @es_sel: Value of extra segment selector
  260. * @fs_sel: Value of FS selector
  261. * @gs_sel: Value of GS selector
  262. * @ldt_sel: Value of LDT descriptor selector
  263. * @tr_sel: Value of TSS descriptor selector
  264. */
  265. struct acrn_regs {
  266. struct acrn_gp_regs gprs;
  267. struct acrn_descriptor_ptr gdt;
  268. struct acrn_descriptor_ptr idt;
  269. __le64 rip;
  270. __le64 cs_base;
  271. __le64 cr0;
  272. __le64 cr4;
  273. __le64 cr3;
  274. __le64 ia32_efer;
  275. __le64 rflags;
  276. __le64 reserved_64[4];
  277. __le32 cs_ar;
  278. __le32 cs_limit;
  279. __le32 reserved_32[3];
  280. __le16 cs_sel;
  281. __le16 ss_sel;
  282. __le16 ds_sel;
  283. __le16 es_sel;
  284. __le16 fs_sel;
  285. __le16 gs_sel;
  286. __le16 ldt_sel;
  287. __le16 tr_sel;
  288. };
  289. /**
  290. * struct acrn_vcpu_regs - Info of vCPU registers state
  291. * @vcpu_id: vCPU ID
  292. * @reserved: Reserved and must be 0
  293. * @vcpu_regs: vCPU registers state
  294. *
  295. * This structure will be passed to hypervisor directly.
  296. */
  297. struct acrn_vcpu_regs {
  298. __u16 vcpu_id;
  299. __u16 reserved[3];
  300. struct acrn_regs vcpu_regs;
  301. };
  302. #define ACRN_MEM_ACCESS_RIGHT_MASK 0x00000007U
  303. #define ACRN_MEM_ACCESS_READ 0x00000001U
  304. #define ACRN_MEM_ACCESS_WRITE 0x00000002U
  305. #define ACRN_MEM_ACCESS_EXEC 0x00000004U
  306. #define ACRN_MEM_ACCESS_RWX (ACRN_MEM_ACCESS_READ | \
  307. ACRN_MEM_ACCESS_WRITE | \
  308. ACRN_MEM_ACCESS_EXEC)
  309. #define ACRN_MEM_TYPE_MASK 0x000007C0U
  310. #define ACRN_MEM_TYPE_WB 0x00000040U
  311. #define ACRN_MEM_TYPE_WT 0x00000080U
  312. #define ACRN_MEM_TYPE_UC 0x00000100U
  313. #define ACRN_MEM_TYPE_WC 0x00000200U
  314. #define ACRN_MEM_TYPE_WP 0x00000400U
  315. /* Memory mapping types */
  316. #define ACRN_MEMMAP_RAM 0
  317. #define ACRN_MEMMAP_MMIO 1
  318. /**
  319. * struct acrn_vm_memmap - A EPT memory mapping info for a User VM.
  320. * @type: Type of the memory mapping (ACRM_MEMMAP_*).
  321. * Pass to hypervisor directly.
  322. * @attr: Attribute of the memory mapping.
  323. * Pass to hypervisor directly.
  324. * @user_vm_pa: Physical address of User VM.
  325. * Pass to hypervisor directly.
  326. * @service_vm_pa: Physical address of Service VM.
  327. * Pass to hypervisor directly.
  328. * @vma_base: VMA address of Service VM. Pass to hypervisor directly.
  329. * @len: Length of the memory mapping.
  330. * Pass to hypervisor directly.
  331. */
  332. struct acrn_vm_memmap {
  333. __u32 type;
  334. __u32 attr;
  335. __u64 user_vm_pa;
  336. union {
  337. __u64 service_vm_pa;
  338. __u64 vma_base;
  339. };
  340. __u64 len;
  341. };
  342. /* Type of interrupt of a passthrough device */
  343. #define ACRN_PTDEV_IRQ_INTX 0
  344. #define ACRN_PTDEV_IRQ_MSI 1
  345. #define ACRN_PTDEV_IRQ_MSIX 2
  346. /**
  347. * struct acrn_ptdev_irq - Interrupt data of a passthrough device.
  348. * @type: Type (ACRN_PTDEV_IRQ_*)
  349. * @virt_bdf: Virtual Bus/Device/Function
  350. * @phys_bdf: Physical Bus/Device/Function
  351. * @intx: Info of interrupt
  352. * @intx.virt_pin: Virtual IOAPIC pin
  353. * @intx.phys_pin: Physical IOAPIC pin
  354. * @intx.is_pic_pin: Is PIC pin or not
  355. *
  356. * This structure will be passed to hypervisor directly.
  357. */
  358. struct acrn_ptdev_irq {
  359. __u32 type;
  360. __u16 virt_bdf;
  361. __u16 phys_bdf;
  362. struct {
  363. __u32 virt_pin;
  364. __u32 phys_pin;
  365. __u32 is_pic_pin;
  366. } intx;
  367. };
  368. /* Type of PCI device assignment */
  369. #define ACRN_PTDEV_QUIRK_ASSIGN (1U << 0)
  370. #define ACRN_MMIODEV_RES_NUM 3
  371. #define ACRN_PCI_NUM_BARS 6
  372. /**
  373. * struct acrn_pcidev - Info for assigning or de-assigning a PCI device
  374. * @type: Type of the assignment
  375. * @virt_bdf: Virtual Bus/Device/Function
  376. * @phys_bdf: Physical Bus/Device/Function
  377. * @intr_line: PCI interrupt line
  378. * @intr_pin: PCI interrupt pin
  379. * @bar: PCI BARs.
  380. *
  381. * This structure will be passed to hypervisor directly.
  382. */
  383. struct acrn_pcidev {
  384. __u32 type;
  385. __u16 virt_bdf;
  386. __u16 phys_bdf;
  387. __u8 intr_line;
  388. __u8 intr_pin;
  389. __u32 bar[ACRN_PCI_NUM_BARS];
  390. };
  391. /**
  392. * struct acrn_mmiodev - Info for assigning or de-assigning a MMIO device
  393. * @name: Name of the MMIO device.
  394. * @res[].user_vm_pa: Physical address of User VM of the MMIO region
  395. * for the MMIO device.
  396. * @res[].service_vm_pa: Physical address of Service VM of the MMIO
  397. * region for the MMIO device.
  398. * @res[].size: Size of the MMIO region for the MMIO device.
  399. * @res[].mem_type: Memory type of the MMIO region for the MMIO
  400. * device.
  401. *
  402. * This structure will be passed to hypervisor directly.
  403. */
  404. struct acrn_mmiodev {
  405. __u8 name[8];
  406. struct {
  407. __u64 user_vm_pa;
  408. __u64 service_vm_pa;
  409. __u64 size;
  410. __u64 mem_type;
  411. } res[ACRN_MMIODEV_RES_NUM];
  412. };
  413. /**
  414. * struct acrn_vdev - Info for creating or destroying a virtual device
  415. * @id: Union of identifier of the virtual device
  416. * @id.value: Raw data of the identifier
  417. * @id.fields.vendor: Vendor id of the virtual PCI device
  418. * @id.fields.device: Device id of the virtual PCI device
  419. * @id.fields.legacy_id: ID of the virtual device if not a PCI device
  420. * @slot: Virtual Bus/Device/Function of the virtual
  421. * device
  422. * @io_base: IO resource base address of the virtual device
  423. * @io_size: IO resource size of the virtual device
  424. * @args: Arguments for the virtual device creation
  425. *
  426. * The created virtual device can be a PCI device or a legacy device (e.g.
  427. * a virtual UART controller) and it is emulated by the hypervisor. This
  428. * structure will be passed to hypervisor directly.
  429. */
  430. struct acrn_vdev {
  431. /*
  432. * the identifier of the device, the low 32 bits represent the vendor
  433. * id and device id of PCI device and the high 32 bits represent the
  434. * device number of the legacy device
  435. */
  436. union {
  437. __u64 value;
  438. struct {
  439. __le16 vendor;
  440. __le16 device;
  441. __le32 legacy_id;
  442. } fields;
  443. } id;
  444. __u64 slot;
  445. __u32 io_addr[ACRN_PCI_NUM_BARS];
  446. __u32 io_size[ACRN_PCI_NUM_BARS];
  447. __u8 args[128];
  448. };
  449. /**
  450. * struct acrn_msi_entry - Info for injecting a MSI interrupt to a VM
  451. * @msi_addr: MSI addr[19:12] with dest vCPU ID
  452. * @msi_data: MSI data[7:0] with vector
  453. */
  454. struct acrn_msi_entry {
  455. __u64 msi_addr;
  456. __u64 msi_data;
  457. };
  458. struct acrn_acpi_generic_address {
  459. __u8 space_id;
  460. __u8 bit_width;
  461. __u8 bit_offset;
  462. __u8 access_size;
  463. __u64 address;
  464. } __attribute__ ((__packed__));
  465. /**
  466. * struct acrn_cstate_data - A C state package defined in ACPI
  467. * @cx_reg: Register of the C state object
  468. * @type: Type of the C state object
  469. * @latency: The worst-case latency to enter and exit this C state
  470. * @power: The average power consumption when in this C state
  471. */
  472. struct acrn_cstate_data {
  473. struct acrn_acpi_generic_address cx_reg;
  474. __u8 type;
  475. __u32 latency;
  476. __u64 power;
  477. };
  478. /**
  479. * struct acrn_pstate_data - A P state package defined in ACPI
  480. * @core_frequency: CPU frequency (in MHz).
  481. * @power: Power dissipation (in milliwatts).
  482. * @transition_latency: The worst-case latency in microseconds that CPU is
  483. * unavailable during a transition from any P state to
  484. * this P state.
  485. * @bus_master_latency: The worst-case latency in microseconds that Bus Masters
  486. * are prevented from accessing memory during a transition
  487. * from any P state to this P state.
  488. * @control: The value to be written to Performance Control Register
  489. * @status: Transition status.
  490. */
  491. struct acrn_pstate_data {
  492. __u64 core_frequency;
  493. __u64 power;
  494. __u64 transition_latency;
  495. __u64 bus_master_latency;
  496. __u64 control;
  497. __u64 status;
  498. };
  499. #define PMCMD_TYPE_MASK 0x000000ff
  500. enum acrn_pm_cmd_type {
  501. ACRN_PMCMD_GET_PX_CNT,
  502. ACRN_PMCMD_GET_PX_DATA,
  503. ACRN_PMCMD_GET_CX_CNT,
  504. ACRN_PMCMD_GET_CX_DATA,
  505. };
  506. #define ACRN_IOEVENTFD_FLAG_PIO 0x01
  507. #define ACRN_IOEVENTFD_FLAG_DATAMATCH 0x02
  508. #define ACRN_IOEVENTFD_FLAG_DEASSIGN 0x04
  509. /**
  510. * struct acrn_ioeventfd - Data to operate a &struct hsm_ioeventfd
  511. * @fd: The fd of eventfd associated with a hsm_ioeventfd
  512. * @flags: Logical-OR of ACRN_IOEVENTFD_FLAG_*
  513. * @addr: The start address of IO range of ioeventfd
  514. * @len: The length of IO range of ioeventfd
  515. * @reserved: Reserved and should be 0
  516. * @data: Data for data matching
  517. *
  518. * Without flag ACRN_IOEVENTFD_FLAG_DEASSIGN, ioctl ACRN_IOCTL_IOEVENTFD
  519. * creates a &struct hsm_ioeventfd with properties originated from &struct
  520. * acrn_ioeventfd. With flag ACRN_IOEVENTFD_FLAG_DEASSIGN, ioctl
  521. * ACRN_IOCTL_IOEVENTFD destroys the &struct hsm_ioeventfd matching the fd.
  522. */
  523. struct acrn_ioeventfd {
  524. __u32 fd;
  525. __u32 flags;
  526. __u64 addr;
  527. __u32 len;
  528. __u32 reserved;
  529. __u64 data;
  530. };
  531. #define ACRN_IRQFD_FLAG_DEASSIGN 0x01
  532. /**
  533. * struct acrn_irqfd - Data to operate a &struct hsm_irqfd
  534. * @fd: The fd of eventfd associated with a hsm_irqfd
  535. * @flags: Logical-OR of ACRN_IRQFD_FLAG_*
  536. * @msi: Info of MSI associated with the irqfd
  537. */
  538. struct acrn_irqfd {
  539. __s32 fd;
  540. __u32 flags;
  541. struct acrn_msi_entry msi;
  542. };
  543. /* The ioctl type, documented in ioctl-number.rst */
  544. #define ACRN_IOCTL_TYPE 0xA2
  545. /*
  546. * Common IOCTL IDs definition for ACRN userspace
  547. */
  548. #define ACRN_IOCTL_CREATE_VM \
  549. _IOWR(ACRN_IOCTL_TYPE, 0x10, struct acrn_vm_creation)
  550. #define ACRN_IOCTL_DESTROY_VM \
  551. _IO(ACRN_IOCTL_TYPE, 0x11)
  552. #define ACRN_IOCTL_START_VM \
  553. _IO(ACRN_IOCTL_TYPE, 0x12)
  554. #define ACRN_IOCTL_PAUSE_VM \
  555. _IO(ACRN_IOCTL_TYPE, 0x13)
  556. #define ACRN_IOCTL_RESET_VM \
  557. _IO(ACRN_IOCTL_TYPE, 0x15)
  558. #define ACRN_IOCTL_SET_VCPU_REGS \
  559. _IOW(ACRN_IOCTL_TYPE, 0x16, struct acrn_vcpu_regs)
  560. #define ACRN_IOCTL_INJECT_MSI \
  561. _IOW(ACRN_IOCTL_TYPE, 0x23, struct acrn_msi_entry)
  562. #define ACRN_IOCTL_VM_INTR_MONITOR \
  563. _IOW(ACRN_IOCTL_TYPE, 0x24, unsigned long)
  564. #define ACRN_IOCTL_SET_IRQLINE \
  565. _IOW(ACRN_IOCTL_TYPE, 0x25, __u64)
  566. #define ACRN_IOCTL_NOTIFY_REQUEST_FINISH \
  567. _IOW(ACRN_IOCTL_TYPE, 0x31, struct acrn_ioreq_notify)
  568. #define ACRN_IOCTL_CREATE_IOREQ_CLIENT \
  569. _IO(ACRN_IOCTL_TYPE, 0x32)
  570. #define ACRN_IOCTL_ATTACH_IOREQ_CLIENT \
  571. _IO(ACRN_IOCTL_TYPE, 0x33)
  572. #define ACRN_IOCTL_DESTROY_IOREQ_CLIENT \
  573. _IO(ACRN_IOCTL_TYPE, 0x34)
  574. #define ACRN_IOCTL_CLEAR_VM_IOREQ \
  575. _IO(ACRN_IOCTL_TYPE, 0x35)
  576. #define ACRN_IOCTL_SET_MEMSEG \
  577. _IOW(ACRN_IOCTL_TYPE, 0x41, struct acrn_vm_memmap)
  578. #define ACRN_IOCTL_UNSET_MEMSEG \
  579. _IOW(ACRN_IOCTL_TYPE, 0x42, struct acrn_vm_memmap)
  580. #define ACRN_IOCTL_SET_PTDEV_INTR \
  581. _IOW(ACRN_IOCTL_TYPE, 0x53, struct acrn_ptdev_irq)
  582. #define ACRN_IOCTL_RESET_PTDEV_INTR \
  583. _IOW(ACRN_IOCTL_TYPE, 0x54, struct acrn_ptdev_irq)
  584. #define ACRN_IOCTL_ASSIGN_PCIDEV \
  585. _IOW(ACRN_IOCTL_TYPE, 0x55, struct acrn_pcidev)
  586. #define ACRN_IOCTL_DEASSIGN_PCIDEV \
  587. _IOW(ACRN_IOCTL_TYPE, 0x56, struct acrn_pcidev)
  588. #define ACRN_IOCTL_ASSIGN_MMIODEV \
  589. _IOW(ACRN_IOCTL_TYPE, 0x57, struct acrn_mmiodev)
  590. #define ACRN_IOCTL_DEASSIGN_MMIODEV \
  591. _IOW(ACRN_IOCTL_TYPE, 0x58, struct acrn_mmiodev)
  592. #define ACRN_IOCTL_CREATE_VDEV \
  593. _IOW(ACRN_IOCTL_TYPE, 0x59, struct acrn_vdev)
  594. #define ACRN_IOCTL_DESTROY_VDEV \
  595. _IOW(ACRN_IOCTL_TYPE, 0x5A, struct acrn_vdev)
  596. #define ACRN_IOCTL_PM_GET_CPU_STATE \
  597. _IOWR(ACRN_IOCTL_TYPE, 0x60, __u64)
  598. #define ACRN_IOCTL_IOEVENTFD \
  599. _IOW(ACRN_IOCTL_TYPE, 0x70, struct acrn_ioeventfd)
  600. #define ACRN_IOCTL_IRQFD \
  601. _IOW(ACRN_IOCTL_TYPE, 0x71, struct acrn_irqfd)
  602. #endif /* _ACRN_H */