Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/vmm/vmm_dev.c
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
#include <machine/vmparam.h> | #include <machine/vmparam.h> | ||||
#include <machine/vmm.h> | #include <machine/vmm.h> | ||||
#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 "intel/intelgpu.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/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" | ||||
▲ Show 20 Lines • Show All 297 Lines • ▼ Show 20 Lines | vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, | ||||
struct vm_lapic_irq *vmirq; | struct vm_lapic_irq *vmirq; | ||||
struct vm_lapic_msi *vmmsi; | struct vm_lapic_msi *vmmsi; | ||||
struct vm_ioapic_irq *ioapic_irq; | struct vm_ioapic_irq *ioapic_irq; | ||||
struct vm_isa_irq *isa_irq; | struct vm_isa_irq *isa_irq; | ||||
struct vm_isa_irq_trigger *isa_irq_trigger; | struct vm_isa_irq_trigger *isa_irq_trigger; | ||||
struct vm_capability *vmcap; | struct vm_capability *vmcap; | ||||
struct vm_pptdev *pptdev; | struct vm_pptdev *pptdev; | ||||
struct vm_pptdev_mmio *pptmmio; | struct vm_pptdev_mmio *pptmmio; | ||||
struct vm_memory_region_info *memory_region_info; | |||||
struct vm_pptdev_msi *pptmsi; | struct vm_pptdev_msi *pptmsi; | ||||
struct vm_pptdev_msix *pptmsix; | struct vm_pptdev_msix *pptmsix; | ||||
struct vm_nmi *vmnmi; | struct vm_nmi *vmnmi; | ||||
struct vm_stats *vmstats; | struct vm_stats *vmstats; | ||||
struct vm_stat_desc *statdesc; | struct vm_stat_desc *statdesc; | ||||
struct vm_x2apic *x2apic; | struct vm_x2apic *x2apic; | ||||
struct vm_gpa_pte *gpapte; | struct vm_gpa_pte *gpapte; | ||||
struct vm_suspend *vmsuspend; | struct vm_suspend *vmsuspend; | ||||
▲ Show 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | case VM_MAP_PPTDEV_MMIO: | ||||
error = ppt_map_mmio(sc->vm, pptmmio->bus, pptmmio->slot, | error = ppt_map_mmio(sc->vm, pptmmio->bus, pptmmio->slot, | ||||
pptmmio->func, pptmmio->gpa, pptmmio->len, | pptmmio->func, pptmmio->gpa, pptmmio->len, | ||||
pptmmio->hpa); | pptmmio->hpa); | ||||
break; | break; | ||||
case VM_UNMAP_PPTDEV_MMIO: | case VM_UNMAP_PPTDEV_MMIO: | ||||
pptmmio = (struct vm_pptdev_mmio *)data; | pptmmio = (struct vm_pptdev_mmio *)data; | ||||
error = ppt_unmap_mmio(sc->vm, pptmmio->bus, pptmmio->slot, | error = ppt_unmap_mmio(sc->vm, pptmmio->bus, pptmmio->slot, | ||||
pptmmio->func, pptmmio->gpa, pptmmio->len); | pptmmio->func, pptmmio->gpa, pptmmio->len); | ||||
break; | |||||
case VM_GET_MEMORY_REGION_INFO: | |||||
memory_region_info = (struct vm_memory_region_info *)data; | |||||
switch (memory_region_info->type) { | |||||
case MEMORY_REGION_INTEL_GSM: | |||||
memory_region_info->base = intel_graphics_stolen_base; | |||||
memory_region_info->size = intel_graphics_stolen_size; | |||||
error = 0; | |||||
break; | |||||
case MEMORY_REGION_INTEL_OPREGION: | |||||
error = | |||||
vm_intelgpu_get_opregion(&memory_region_info->base, | |||||
&memory_region_info->size); | |||||
break; | |||||
default: | |||||
error = EINVAL; | |||||
break; | |||||
} | |||||
break; | break; | ||||
case VM_BIND_PPTDEV: | case VM_BIND_PPTDEV: | ||||
pptdev = (struct vm_pptdev *)data; | pptdev = (struct vm_pptdev *)data; | ||||
error = vm_assign_pptdev(sc->vm, pptdev->bus, pptdev->slot, | error = vm_assign_pptdev(sc->vm, pptdev->bus, pptdev->slot, | ||||
pptdev->func); | pptdev->func); | ||||
break; | break; | ||||
case VM_UNBIND_PPTDEV: | case VM_UNBIND_PPTDEV: | ||||
pptdev = (struct vm_pptdev *)data; | pptdev = (struct vm_pptdev *)data; | ||||
▲ Show 20 Lines • Show All 717 Lines • Show Last 20 Lines |