summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2012-04-28 16:28:00 +0000
committergrehan <grehan@FreeBSD.org>2012-04-28 16:28:00 +0000
commit9f0c999f8126597eb572b80056df88335dbd0070 (patch)
treee25fe0456b877e9c40defdc19a863563208d18de /sys/amd64/include
parent94d2b7f64912987093f1a98573737a32e4e5d8d1 (diff)
downloadFreeBSD-src-9f0c999f8126597eb572b80056df88335dbd0070.zip
FreeBSD-src-9f0c999f8126597eb572b80056df88335dbd0070.tar.gz
MSI-x interrupt support for PCI pass-thru devices.
Includes instruction emulation for memory r/w access. This opens the door for io-apic, local apic, hpet timer, and legacy device emulation. Submitted by: ryan dot berryhill at sandvine dot com Reviewed by: grehan Obtained from: Sandvine
Diffstat (limited to 'sys/amd64/include')
-rw-r--r--sys/amd64/include/vmm.h6
-rw-r--r--sys/amd64/include/vmm_dev.h14
2 files changed, 19 insertions, 1 deletions
diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h
index 26646fb..1ad01c6 100644
--- a/sys/amd64/include/vmm.h
+++ b/sys/amd64/include/vmm.h
@@ -227,7 +227,8 @@ enum vm_exitcode {
VM_EXITCODE_HLT,
VM_EXITCODE_MTRAP,
VM_EXITCODE_PAUSE,
- VM_EXITCODE_MAX,
+ VM_EXITCODE_PAGING,
+ VM_EXITCODE_MAX
};
struct vm_exit {
@@ -243,6 +244,9 @@ struct vm_exit {
uint16_t port;
uint32_t eax; /* valid for out */
} inout;
+ struct {
+ uint64_t cr3;
+ } paging;
/*
* VMX specific payload. Used when there is no "better"
* exitcode to represent the VM-exit.
diff --git a/sys/amd64/include/vmm_dev.h b/sys/amd64/include/vmm_dev.h
index 1b143b5..d1a50d6 100644
--- a/sys/amd64/include/vmm_dev.h
+++ b/sys/amd64/include/vmm_dev.h
@@ -108,6 +108,17 @@ struct vm_pptdev_msi {
int destcpu;
};
+struct vm_pptdev_msix {
+ int vcpu;
+ int bus;
+ int slot;
+ int func;
+ int idx;
+ uint32_t msg;
+ uint32_t vector_control;
+ uint64_t addr;
+};
+
struct vm_nmi {
int cpuid;
};
@@ -143,6 +154,7 @@ enum {
IOCNUM_UNBIND_PPTDEV,
IOCNUM_MAP_PPTDEV_MMIO,
IOCNUM_PPTDEV_MSI,
+ IOCNUM_PPTDEV_MSIX,
IOCNUM_INJECT_NMI,
IOCNUM_VM_STATS,
IOCNUM_VM_STAT_DESC,
@@ -182,6 +194,8 @@ enum {
_IOW('v', IOCNUM_MAP_PPTDEV_MMIO, struct vm_pptdev_mmio)
#define VM_PPTDEV_MSI \
_IOW('v', IOCNUM_PPTDEV_MSI, struct vm_pptdev_msi)
+#define VM_PPTDEV_MSIX \
+ _IOW('v', IOCNUM_PPTDEV_MSIX, struct vm_pptdev_msix)
#define VM_INJECT_NMI \
_IOW('v', IOCNUM_INJECT_NMI, struct vm_nmi)
#define VM_STATS \
OpenPOWER on IntegriCloud