MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vmmdev_ioctl

Function vmmdev_ioctl

freebsd/amd64/vmm/vmm_dev.c:349–881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349static int
350vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag,
351 struct thread *td)
352{
353 int error, vcpu, state_changed, size;
354 cpuset_t *cpuset;
355 struct vmmdev_softc *sc;
356 struct vm_register *vmreg;
357 struct vm_seg_desc *vmsegdesc;
358 struct vm_register_set *vmregset;
359 struct vm_run *vmrun;
360 struct vm_exception *vmexc;
361 struct vm_lapic_irq *vmirq;
362 struct vm_lapic_msi *vmmsi;
363 struct vm_ioapic_irq *ioapic_irq;
364 struct vm_isa_irq *isa_irq;
365 struct vm_isa_irq_trigger *isa_irq_trigger;
366 struct vm_capability *vmcap;
367 struct vm_pptdev *pptdev;
368 struct vm_pptdev_mmio *pptmmio;
369 struct vm_pptdev_msi *pptmsi;
370 struct vm_pptdev_msix *pptmsix;
371 struct vm_nmi *vmnmi;
372 struct vm_stats *vmstats;
373 struct vm_stat_desc *statdesc;
374 struct vm_x2apic *x2apic;
375 struct vm_gpa_pte *gpapte;
376 struct vm_suspend *vmsuspend;
377 struct vm_gla2gpa *gg;
378 struct vm_activate_cpu *vac;
379 struct vm_cpuset *vm_cpuset;
380 struct vm_intinfo *vmii;
381 struct vm_rtc_time *rtctime;
382 struct vm_rtc_data *rtcdata;
383 struct vm_memmap *mm;
384 struct vm_cpu_topology *topology;
385 struct vm_readwrite_kernemu_device *kernemu;
386 uint64_t *regvals;
387 int *regnums;
388#ifdef BHYVE_SNAPSHOT
389 struct vm_snapshot_meta *snapshot_meta;
390#endif
391
392 error = vmm_priv_check(curthread->td_ucred);
393 if (error)
394 return (error);
395
396 sc = vmmdev_lookup2(cdev);
397 if (sc == NULL)
398 return (ENXIO);
399
400 vcpu = -1;
401 state_changed = 0;
402
403 /*
404 * Some VMM ioctls can operate only on vcpus that are not running.
405 */
406 switch (cmd) {

Callers

nothing calls this directly

Calls 15

vmmdev_lookup2Function · 0.85
vcpu_lock_oneFunction · 0.85
vcpu_lock_allFunction · 0.85
vm_get_maxcpusFunction · 0.85
vm_reinitFunction · 0.85
vmm_stat_desc_copyFunction · 0.85
getmicrotimeFunction · 0.85
vmm_stat_copyFunction · 0.85
ppt_setup_msiFunction · 0.85
ppt_setup_msixFunction · 0.85
ppt_disable_msixFunction · 0.85
ppt_map_mmioFunction · 0.85

Tested by

no test coverage detected