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