acrn.h 19 KB

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