Deleted Added
full compact
vmm_dev.c (239700) vmm_dev.c (240922)
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

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

158 struct vm_capability *vmcap;
159 struct vm_pptdev *pptdev;
160 struct vm_pptdev_mmio *pptmmio;
161 struct vm_pptdev_msi *pptmsi;
162 struct vm_pptdev_msix *pptmsix;
163 struct vm_nmi *vmnmi;
164 struct vm_stats *vmstats;
165 struct vm_stat_desc *statdesc;
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

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

158 struct vm_capability *vmcap;
159 struct vm_pptdev *pptdev;
160 struct vm_pptdev_mmio *pptmmio;
161 struct vm_pptdev_msi *pptmsi;
162 struct vm_pptdev_msix *pptmsix;
163 struct vm_nmi *vmnmi;
164 struct vm_stats *vmstats;
165 struct vm_stat_desc *statdesc;
166 struct vm_x2apic *x2apic;
166
167 mtx_lock(&vmmdev_mtx);
168 sc = vmmdev_lookup2(cdev);
169 if (sc == NULL) {
170 mtx_unlock(&vmmdev_mtx);
171 return (ENXIO);
172 }
173

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

180 case VM_GET_REGISTER:
181 case VM_SET_REGISTER:
182 case VM_GET_SEGMENT_DESCRIPTOR:
183 case VM_SET_SEGMENT_DESCRIPTOR:
184 case VM_INJECT_EVENT:
185 case VM_GET_CAPABILITY:
186 case VM_SET_CAPABILITY:
187 case VM_PPTDEV_MSI:
167
168 mtx_lock(&vmmdev_mtx);
169 sc = vmmdev_lookup2(cdev);
170 if (sc == NULL) {
171 mtx_unlock(&vmmdev_mtx);
172 return (ENXIO);
173 }
174

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

181 case VM_GET_REGISTER:
182 case VM_SET_REGISTER:
183 case VM_GET_SEGMENT_DESCRIPTOR:
184 case VM_SET_SEGMENT_DESCRIPTOR:
185 case VM_INJECT_EVENT:
186 case VM_GET_CAPABILITY:
187 case VM_SET_CAPABILITY:
188 case VM_PPTDEV_MSI:
189 case VM_SET_X2APIC_STATE:
188 /*
189 * XXX fragile, handle with care
190 * Assumes that the first field of the ioctl data is the vcpu.
191 */
192 vcpu = *(int *)data;
193 if (vcpu < 0 || vcpu >= VM_MAXCPU) {
194 error = EINVAL;
195 goto done;

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

330 &vmcap->capval);
331 break;
332 case VM_SET_CAPABILITY:
333 vmcap = (struct vm_capability *)data;
334 error = vm_set_capability(sc->vm, vmcap->cpuid,
335 vmcap->captype,
336 vmcap->capval);
337 break;
190 /*
191 * XXX fragile, handle with care
192 * Assumes that the first field of the ioctl data is the vcpu.
193 */
194 vcpu = *(int *)data;
195 if (vcpu < 0 || vcpu >= VM_MAXCPU) {
196 error = EINVAL;
197 goto done;

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

332 &vmcap->capval);
333 break;
334 case VM_SET_CAPABILITY:
335 vmcap = (struct vm_capability *)data;
336 error = vm_set_capability(sc->vm, vmcap->cpuid,
337 vmcap->captype,
338 vmcap->capval);
339 break;
340 case VM_SET_X2APIC_STATE:
341 x2apic = (struct vm_x2apic *)data;
342 error = vm_set_x2apic_state(sc->vm,
343 x2apic->cpuid, x2apic->state);
344 break;
345 case VM_GET_X2APIC_STATE:
346 x2apic = (struct vm_x2apic *)data;
347 error = vm_get_x2apic_state(sc->vm,
348 x2apic->cpuid, &x2apic->state);
349 break;
338 default:
339 error = ENOTTY;
340 break;
341 }
342done:
343 mtx_unlock(&vmmdev_mtx);
344
345 return (error);

--- 152 unchanged lines hidden ---
350 default:
351 error = ENOTTY;
352 break;
353 }
354done:
355 mtx_unlock(&vmmdev_mtx);
356
357 return (error);

--- 152 unchanged lines hidden ---