21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD$
29 */
30 /*
31 * This file and its contents are supplied under the terms of the
32 * Common Development and Distribution License ("CDDL"), version 1.0.
33 * You may only use this file in accordance with the terms of version
34 * 1.0 of the CDDL.
35 *
36 * A full copy of the text of the CDDL should have accompanied this
37 * source. A copy of the CDDL is also available via the Internet at
38 * http://www.illumos.org/license/CDDL.
39 *
40 * Copyright 2015 Pluribus Networks Inc.
41 * Copyright 2020 Joyent, Inc.
42 */
43
44 #ifndef _VMM_DEV_H_
45 #define _VMM_DEV_H_
46
47 #include <machine/vmm.h>
48
49 struct vm_memmap {
50 vm_paddr_t gpa;
51 int segid; /* memory segment */
52 vm_ooffset_t segoff; /* offset into memory segment */
53 size_t len; /* mmap length */
54 int prot; /* RWX */
55 int flags;
56 };
57 #define VM_MEMMAP_F_WIRED 0x01
58 #define VM_MEMMAP_F_IOMMU 0x02
59
60 struct vm_munmap {
61 vm_paddr_t gpa;
355 #define VM_RTC_GETTIME (VMM_IOC_BASE | 0x11)
356
357 #define VM_SUSPEND (VMM_IOC_BASE | 0x12)
358
359 #define VM_IOAPIC_PINCOUNT (VMM_IOC_BASE | 0x13)
360 #define VM_GET_PPTDEV_LIMITS (VMM_IOC_BASE | 0x14)
361 #define VM_GET_HPET_CAPABILITIES (VMM_IOC_BASE | 0x15)
362
363 #define VM_STATS_IOC (VMM_IOC_BASE | 0x16)
364 #define VM_STAT_DESC (VMM_IOC_BASE | 0x17)
365
366 #define VM_INJECT_NMI (VMM_IOC_BASE | 0x18)
367 #define VM_GET_X2APIC_STATE (VMM_IOC_BASE | 0x19)
368 #define VM_SET_TOPOLOGY (VMM_IOC_BASE | 0x1a)
369 #define VM_GET_TOPOLOGY (VMM_IOC_BASE | 0x1b)
370 #define VM_GET_CPUS (VMM_IOC_BASE | 0x1c)
371 #define VM_SUSPEND_CPU (VMM_IOC_BASE | 0x1d)
372 #define VM_RESUME_CPU (VMM_IOC_BASE | 0x1e)
373
374 #define VM_PPTDEV_DISABLE_MSIX (VMM_IOC_BASE | 0x1f)
375 #define VM_ARC_RESV (VMM_IOC_BASE | 0xfe)
376
377 #define VM_DEVMEM_GETOFFSET (VMM_IOC_BASE | 0xff)
378
379 #define VMM_CTL_DEV "/dev/vmmctl"
380
381 #endif
|
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD$
29 */
30 /*
31 * This file and its contents are supplied under the terms of the
32 * Common Development and Distribution License ("CDDL"), version 1.0.
33 * You may only use this file in accordance with the terms of version
34 * 1.0 of the CDDL.
35 *
36 * A full copy of the text of the CDDL should have accompanied this
37 * source. A copy of the CDDL is also available via the Internet at
38 * http://www.illumos.org/license/CDDL.
39 *
40 * Copyright 2015 Pluribus Networks Inc.
41 * Copyright 2019 Joyent, Inc.
42 */
43
44 #ifndef _VMM_DEV_H_
45 #define _VMM_DEV_H_
46
47 #include <machine/vmm.h>
48
49 struct vm_memmap {
50 vm_paddr_t gpa;
51 int segid; /* memory segment */
52 vm_ooffset_t segoff; /* offset into memory segment */
53 size_t len; /* mmap length */
54 int prot; /* RWX */
55 int flags;
56 };
57 #define VM_MEMMAP_F_WIRED 0x01
58 #define VM_MEMMAP_F_IOMMU 0x02
59
60 struct vm_munmap {
61 vm_paddr_t gpa;
355 #define VM_RTC_GETTIME (VMM_IOC_BASE | 0x11)
356
357 #define VM_SUSPEND (VMM_IOC_BASE | 0x12)
358
359 #define VM_IOAPIC_PINCOUNT (VMM_IOC_BASE | 0x13)
360 #define VM_GET_PPTDEV_LIMITS (VMM_IOC_BASE | 0x14)
361 #define VM_GET_HPET_CAPABILITIES (VMM_IOC_BASE | 0x15)
362
363 #define VM_STATS_IOC (VMM_IOC_BASE | 0x16)
364 #define VM_STAT_DESC (VMM_IOC_BASE | 0x17)
365
366 #define VM_INJECT_NMI (VMM_IOC_BASE | 0x18)
367 #define VM_GET_X2APIC_STATE (VMM_IOC_BASE | 0x19)
368 #define VM_SET_TOPOLOGY (VMM_IOC_BASE | 0x1a)
369 #define VM_GET_TOPOLOGY (VMM_IOC_BASE | 0x1b)
370 #define VM_GET_CPUS (VMM_IOC_BASE | 0x1c)
371 #define VM_SUSPEND_CPU (VMM_IOC_BASE | 0x1d)
372 #define VM_RESUME_CPU (VMM_IOC_BASE | 0x1e)
373
374 #define VM_PPTDEV_DISABLE_MSIX (VMM_IOC_BASE | 0x1f)
375
376 #define VM_DEVMEM_GETOFFSET (VMM_IOC_BASE | 0xff)
377
378 #define VMM_CTL_DEV "/dev/vmmctl"
379
380 #endif
|