Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/vmm/vmm_dev.c
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
#include <machine/vmm_dev.h> | #include <machine/vmm_dev.h> | ||||
#include <machine/vmm_instruction_emul.h> | #include <machine/vmm_instruction_emul.h> | ||||
#include <machine/vmm_snapshot.h> | #include <machine/vmm_snapshot.h> | ||||
#include <x86/apicreg.h> | #include <x86/apicreg.h> | ||||
#include "vmm_lapic.h" | #include "vmm_lapic.h" | ||||
#include "vmm_stat.h" | #include "vmm_stat.h" | ||||
#include "vmm_mem.h" | #include "vmm_mem.h" | ||||
#include "io/acpi.h" | |||||
#include "io/ppt.h" | #include "io/ppt.h" | ||||
#include "io/vatpic.h" | #include "io/vatpic.h" | ||||
#include "io/vioapic.h" | #include "io/vioapic.h" | ||||
#include "io/vhpet.h" | #include "io/vhpet.h" | ||||
#include "io/vrtc.h" | #include "io/vrtc.h" | ||||
struct devmem_softc { | struct devmem_softc { | ||||
int segid; | int segid; | ||||
▲ Show 20 Lines • Show All 311 Lines • ▼ Show 20 Lines | vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, | ||||
struct vm_activate_cpu *vac; | struct vm_activate_cpu *vac; | ||||
struct vm_cpuset *vm_cpuset; | struct vm_cpuset *vm_cpuset; | ||||
struct vm_intinfo *vmii; | struct vm_intinfo *vmii; | ||||
struct vm_rtc_time *rtctime; | struct vm_rtc_time *rtctime; | ||||
struct vm_rtc_data *rtcdata; | struct vm_rtc_data *rtcdata; | ||||
struct vm_memmap *mm; | struct vm_memmap *mm; | ||||
struct vm_munmap *mu; | struct vm_munmap *mu; | ||||
struct vm_cpu_topology *topology; | struct vm_cpu_topology *topology; | ||||
struct vm_acpi_device_info *acpi_device_info; | |||||
char acpi_device_path[NAME_MAX]; | |||||
struct vm_readwrite_kernemu_device *kernemu; | struct vm_readwrite_kernemu_device *kernemu; | ||||
uint64_t *regvals; | uint64_t *regvals; | ||||
int *regnums; | int *regnums; | ||||
#ifdef BHYVE_SNAPSHOT | #ifdef BHYVE_SNAPSHOT | ||||
struct vm_snapshot_meta *snapshot_meta; | struct vm_snapshot_meta *snapshot_meta; | ||||
#endif | #endif | ||||
error = vmm_priv_check(curthread->td_ucred); | error = vmm_priv_check(curthread->td_ucred); | ||||
▲ Show 20 Lines • Show All 463 Lines • ▼ Show 20 Lines | case VM_SET_TOPOLOGY: | ||||
error = vm_set_topology(sc->vm, topology->sockets, | error = vm_set_topology(sc->vm, topology->sockets, | ||||
topology->cores, topology->threads, topology->maxcpus); | topology->cores, topology->threads, topology->maxcpus); | ||||
break; | break; | ||||
case VM_GET_TOPOLOGY: | case VM_GET_TOPOLOGY: | ||||
topology = (struct vm_cpu_topology *)data; | topology = (struct vm_cpu_topology *)data; | ||||
vm_get_topology(sc->vm, &topology->sockets, &topology->cores, | vm_get_topology(sc->vm, &topology->sockets, &topology->cores, | ||||
&topology->threads, &topology->maxcpus); | &topology->threads, &topology->maxcpus); | ||||
error = 0; | error = 0; | ||||
break; | |||||
case VM_GET_ACPI_DEVICE_INFO: | |||||
acpi_device_info = (struct vm_acpi_device_info *)data; | |||||
/* copy device name into kernel space */ | |||||
error = copyinstr(acpi_device_info->path, acpi_device_path, | |||||
sizeof(acpi_device_path), NULL); | |||||
if (error) { | |||||
break; | |||||
} | |||||
/* handle request */ | |||||
switch (acpi_device_info->type) { | |||||
case VM_ACPI_DEVICE_INFO_CRS: | |||||
error = vmm_acpi_get_crs(acpi_device_path, | |||||
acpi_device_info->buffer, | |||||
&acpi_device_info->buffer_length); | |||||
break; | |||||
} | |||||
break; | break; | ||||
#ifdef BHYVE_SNAPSHOT | #ifdef BHYVE_SNAPSHOT | ||||
case VM_SNAPSHOT_REQ: | case VM_SNAPSHOT_REQ: | ||||
snapshot_meta = (struct vm_snapshot_meta *)data; | snapshot_meta = (struct vm_snapshot_meta *)data; | ||||
error = vm_snapshot_req(sc->vm, snapshot_meta); | error = vm_snapshot_req(sc->vm, snapshot_meta); | ||||
break; | break; | ||||
case VM_RESTORE_TIME: | case VM_RESTORE_TIME: | ||||
error = vm_restore_time(sc->vm); | error = vm_restore_time(sc->vm); | ||||
▲ Show 20 Lines • Show All 387 Lines • Show Last 20 Lines |