Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/include/vmm_dev.h
/*- | /*- | ||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD | * SPDX-License-Identifier: BSD-2-Clause-FreeBSD | ||||
* | * | ||||
* Copyright (c) 2011 NetApp, Inc. | * Copyright (c) 2011 NetApp, Inc. | ||||
* All rights reserved. | * All rights reserved. | ||||
* Copyright (c) 2022 The FreeBSD Foundation | |||||
* | * | ||||
* Portions of this software were developed by Ararat River | |||||
* Consulting, LLC under sponsorship of the FreeBSD Foundation. | |||||
* | |||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions | ||||
* are met: | * are met: | ||||
* 1. Redistributions of source code must retain the above copyright | * 1. Redistributions of source code must retain the above copyright | ||||
* notice, this list of conditions and the following disclaimer. | * notice, this list of conditions and the following disclaimer. | ||||
* 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright | ||||
* notice, this list of conditions and the following disclaimer in the | * notice, this list of conditions and the following disclaimer in the | ||||
* documentation and/or other materials provided with the distribution. | * documentation and/or other materials provided with the distribution. | ||||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | struct vm_pptdev_mmio { | ||||
int bus; | int bus; | ||||
int slot; | int slot; | ||||
int func; | int func; | ||||
vm_paddr_t gpa; | vm_paddr_t gpa; | ||||
vm_paddr_t hpa; | vm_paddr_t hpa; | ||||
size_t len; | size_t len; | ||||
}; | }; | ||||
struct vm_pptdev_mmio_bar { | |||||
int bus; | |||||
int slot; | |||||
int func; | |||||
int bar; | |||||
size_t offset; | |||||
size_t len; | |||||
vm_paddr_t gpa; | |||||
}; | |||||
struct vm_pptdev_msi { | struct vm_pptdev_msi { | ||||
int vcpu; | int vcpu; | ||||
int bus; | int bus; | ||||
int slot; | int slot; | ||||
int func; | int func; | ||||
int numvec; /* 0 means disabled */ | int numvec; /* 0 means disabled */ | ||||
uint64_t msg; | uint64_t msg; | ||||
uint64_t addr; | uint64_t addr; | ||||
▲ Show 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | enum { | ||||
IOCNUM_LAPIC_MSI = 36, | IOCNUM_LAPIC_MSI = 36, | ||||
IOCNUM_LAPIC_LOCAL_IRQ = 37, | IOCNUM_LAPIC_LOCAL_IRQ = 37, | ||||
IOCNUM_IOAPIC_PINCOUNT = 38, | IOCNUM_IOAPIC_PINCOUNT = 38, | ||||
IOCNUM_RESTART_INSTRUCTION = 39, | IOCNUM_RESTART_INSTRUCTION = 39, | ||||
/* PCI pass-thru */ | /* PCI pass-thru */ | ||||
IOCNUM_BIND_PPTDEV = 40, | IOCNUM_BIND_PPTDEV = 40, | ||||
IOCNUM_UNBIND_PPTDEV = 41, | IOCNUM_UNBIND_PPTDEV = 41, | ||||
IOCNUM_MAP_PPTDEV_MMIO = 42, | IOCNUM_MAP_PPTDEV_MMIO = 42, | ||||
corvink: Should we remove this one? | |||||
IOCNUM_PPTDEV_MSI = 43, | IOCNUM_PPTDEV_MSI = 43, | ||||
IOCNUM_PPTDEV_MSIX = 44, | IOCNUM_PPTDEV_MSIX = 44, | ||||
IOCNUM_PPTDEV_DISABLE_MSIX = 45, | IOCNUM_PPTDEV_DISABLE_MSIX = 45, | ||||
IOCNUM_UNMAP_PPTDEV_MMIO = 46, | IOCNUM_UNMAP_PPTDEV_MMIO = 46, | ||||
IOCNUM_MAP_PPTDEV_MMIO_BAR = 47, | |||||
/* statistics */ | /* statistics */ | ||||
IOCNUM_VM_STATS = 50, | IOCNUM_VM_STATS = 50, | ||||
IOCNUM_VM_STAT_DESC = 51, | IOCNUM_VM_STAT_DESC = 51, | ||||
/* kernel device state */ | /* kernel device state */ | ||||
IOCNUM_SET_X2APIC_STATE = 60, | IOCNUM_SET_X2APIC_STATE = 60, | ||||
IOCNUM_GET_X2APIC_STATE = 61, | IOCNUM_GET_X2APIC_STATE = 61, | ||||
▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | |||||
#define VM_PPTDEV_MSI \ | #define VM_PPTDEV_MSI \ | ||||
_IOW('v', IOCNUM_PPTDEV_MSI, struct vm_pptdev_msi) | _IOW('v', IOCNUM_PPTDEV_MSI, struct vm_pptdev_msi) | ||||
#define VM_PPTDEV_MSIX \ | #define VM_PPTDEV_MSIX \ | ||||
_IOW('v', IOCNUM_PPTDEV_MSIX, struct vm_pptdev_msix) | _IOW('v', IOCNUM_PPTDEV_MSIX, struct vm_pptdev_msix) | ||||
#define VM_PPTDEV_DISABLE_MSIX \ | #define VM_PPTDEV_DISABLE_MSIX \ | ||||
_IOW('v', IOCNUM_PPTDEV_DISABLE_MSIX, struct vm_pptdev) | _IOW('v', IOCNUM_PPTDEV_DISABLE_MSIX, struct vm_pptdev) | ||||
#define VM_UNMAP_PPTDEV_MMIO \ | #define VM_UNMAP_PPTDEV_MMIO \ | ||||
_IOW('v', IOCNUM_UNMAP_PPTDEV_MMIO, struct vm_pptdev_mmio) | _IOW('v', IOCNUM_UNMAP_PPTDEV_MMIO, struct vm_pptdev_mmio) | ||||
#define VM_MAP_PPTDEV_MMIO_BAR \ | |||||
_IOW('v', IOCNUM_MAP_PPTDEV_MMIO_BAR, struct vm_pptdev_mmio_bar) | |||||
#define VM_INJECT_NMI \ | #define VM_INJECT_NMI \ | ||||
_IOW('v', IOCNUM_INJECT_NMI, struct vm_nmi) | _IOW('v', IOCNUM_INJECT_NMI, struct vm_nmi) | ||||
#define VM_STATS \ | #define VM_STATS \ | ||||
_IOWR('v', IOCNUM_VM_STATS, struct vm_stats) | _IOWR('v', IOCNUM_VM_STATS, struct vm_stats) | ||||
#define VM_STAT_DESC \ | #define VM_STAT_DESC \ | ||||
_IOWR('v', IOCNUM_VM_STAT_DESC, struct vm_stat_desc) | _IOWR('v', IOCNUM_VM_STAT_DESC, struct vm_stat_desc) | ||||
#define VM_SET_X2APIC_STATE \ | #define VM_SET_X2APIC_STATE \ | ||||
_IOW('v', IOCNUM_SET_X2APIC_STATE, struct vm_x2apic) | _IOW('v', IOCNUM_SET_X2APIC_STATE, struct vm_x2apic) | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |
Should we remove this one?