Deleted Added
full compact
vmm_dev.c (268889) vmm_dev.c (276428)
1/*-
2 * Copyright (c) 2011 NetApp, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2011 NetApp, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/amd64/vmm/vmm_dev.c 268889 2014-07-19 20:59:08Z neel $
26 * $FreeBSD: head/sys/amd64/vmm/vmm_dev.c 276428 2014-12-30 22:19:34Z neel $
27 */
28
29#include <sys/cdefs.h>
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/amd64/vmm/vmm_dev.c 268889 2014-07-19 20:59:08Z neel $");
30__FBSDID("$FreeBSD: head/sys/amd64/vmm/vmm_dev.c 276428 2014-12-30 22:19:34Z neel $");
31
32#include <sys/param.h>
33#include <sys/kernel.h>
34#include <sys/queue.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>
37#include <sys/malloc.h>
38#include <sys/conf.h>

--- 14 unchanged lines hidden (view full) ---

53
54#include "vmm_lapic.h"
55#include "vmm_stat.h"
56#include "vmm_mem.h"
57#include "io/ppt.h"
58#include "io/vatpic.h"
59#include "io/vioapic.h"
60#include "io/vhpet.h"
31
32#include <sys/param.h>
33#include <sys/kernel.h>
34#include <sys/queue.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>
37#include <sys/malloc.h>
38#include <sys/conf.h>

--- 14 unchanged lines hidden (view full) ---

53
54#include "vmm_lapic.h"
55#include "vmm_stat.h"
56#include "vmm_mem.h"
57#include "io/ppt.h"
58#include "io/vatpic.h"
59#include "io/vioapic.h"
60#include "io/vhpet.h"
61#include "io/vrtc.h"
61
62struct vmmdev_softc {
63 struct vm *vm; /* vm instance cookie */
64 struct cdev *cdev;
65 SLIST_ENTRY(vmmdev_softc) link;
66 int flags;
67};
68#define VSC_LINKED 0x01

--- 100 unchanged lines hidden (view full) ---

169 struct vm_stat_desc *statdesc;
170 struct vm_x2apic *x2apic;
171 struct vm_gpa_pte *gpapte;
172 struct vm_suspend *vmsuspend;
173 struct vm_gla2gpa *gg;
174 struct vm_activate_cpu *vac;
175 struct vm_cpuset *vm_cpuset;
176 struct vm_intinfo *vmii;
62
63struct vmmdev_softc {
64 struct vm *vm; /* vm instance cookie */
65 struct cdev *cdev;
66 SLIST_ENTRY(vmmdev_softc) link;
67 int flags;
68};
69#define VSC_LINKED 0x01

--- 100 unchanged lines hidden (view full) ---

170 struct vm_stat_desc *statdesc;
171 struct vm_x2apic *x2apic;
172 struct vm_gpa_pte *gpapte;
173 struct vm_suspend *vmsuspend;
174 struct vm_gla2gpa *gg;
175 struct vm_activate_cpu *vac;
176 struct vm_cpuset *vm_cpuset;
177 struct vm_intinfo *vmii;
178 struct vm_rtc_time *rtctime;
179 struct vm_rtc_data *rtcdata;
177
178 sc = vmmdev_lookup2(cdev);
179 if (sc == NULL)
180 return (ENXIO);
181
182 error = 0;
183 vcpu = -1;
184 state_changed = 0;

--- 292 unchanged lines hidden (view full) ---

477 vmii = (struct vm_intinfo *)data;
478 error = vm_exit_intinfo(sc->vm, vmii->vcpuid, vmii->info1);
479 break;
480 case VM_GET_INTINFO:
481 vmii = (struct vm_intinfo *)data;
482 error = vm_get_intinfo(sc->vm, vmii->vcpuid, &vmii->info1,
483 &vmii->info2);
484 break;
180
181 sc = vmmdev_lookup2(cdev);
182 if (sc == NULL)
183 return (ENXIO);
184
185 error = 0;
186 vcpu = -1;
187 state_changed = 0;

--- 292 unchanged lines hidden (view full) ---

480 vmii = (struct vm_intinfo *)data;
481 error = vm_exit_intinfo(sc->vm, vmii->vcpuid, vmii->info1);
482 break;
483 case VM_GET_INTINFO:
484 vmii = (struct vm_intinfo *)data;
485 error = vm_get_intinfo(sc->vm, vmii->vcpuid, &vmii->info1,
486 &vmii->info2);
487 break;
488 case VM_RTC_WRITE:
489 rtcdata = (struct vm_rtc_data *)data;
490 error = vrtc_nvram_write(sc->vm, rtcdata->offset,
491 rtcdata->value);
492 break;
493 case VM_RTC_READ:
494 rtcdata = (struct vm_rtc_data *)data;
495 error = vrtc_nvram_read(sc->vm, rtcdata->offset,
496 &rtcdata->value);
497 break;
498 case VM_RTC_SETTIME:
499 rtctime = (struct vm_rtc_time *)data;
500 error = vrtc_set_time(sc->vm, rtctime->secs);
501 break;
502 case VM_RTC_GETTIME:
503 error = 0;
504 rtctime = (struct vm_rtc_time *)data;
505 rtctime->secs = vrtc_get_time(sc->vm);
506 break;
485 default:
486 error = ENOTTY;
487 break;
488 }
489
490 if (state_changed == 1) {
491 vcpu_set_state(sc->vm, vcpu, VCPU_IDLE, false);
492 } else if (state_changed == 2) {

--- 179 unchanged lines hidden ---
507 default:
508 error = ENOTTY;
509 break;
510 }
511
512 if (state_changed == 1) {
513 vcpu_set_state(sc->vm, vcpu, VCPU_IDLE, false);
514 } else if (state_changed == 2) {

--- 179 unchanged lines hidden ---