vmx.c (266641) | vmx.c (266765) |
---|---|
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/intel/vmx.c 266641 2014-05-25 00:57:24Z neel $ | 26 * $FreeBSD: head/sys/amd64/vmm/intel/vmx.c 266765 2014-05-27 19:04:38Z jhb $ |
27 */ 28 29#include <sys/cdefs.h> | 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/amd64/vmm/intel/vmx.c 266641 2014-05-25 00:57:24Z neel $"); | 30__FBSDID("$FreeBSD: head/sys/amd64/vmm/intel/vmx.c 266765 2014-05-27 19:04:38Z jhb $"); |
31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/smp.h> 35#include <sys/kernel.h> 36#include <sys/malloc.h> 37#include <sys/pcpu.h> 38#include <sys/proc.h> --- 1336 unchanged lines hidden (view full) --- 1375 return (HANDLED); 1376 } 1377 1378 if (!(xcrval & XFEATURE_ENABLED_X87)) { 1379 vm_inject_gp(vmx->vm, vcpu); 1380 return (HANDLED); 1381 } 1382 | 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/smp.h> 35#include <sys/kernel.h> 36#include <sys/malloc.h> 37#include <sys/pcpu.h> 38#include <sys/proc.h> --- 1336 unchanged lines hidden (view full) --- 1375 return (HANDLED); 1376 } 1377 1378 if (!(xcrval & XFEATURE_ENABLED_X87)) { 1379 vm_inject_gp(vmx->vm, vcpu); 1380 return (HANDLED); 1381 } 1382 |
1383 if ((xcrval & (XFEATURE_ENABLED_AVX | XFEATURE_ENABLED_SSE)) == 1384 XFEATURE_ENABLED_AVX) { | 1383 /* AVX (YMM_Hi128) requires SSE. */ 1384 if (xcrval & XFEATURE_ENABLED_AVX && 1385 (xcrval & XFEATURE_AVX) != XFEATURE_AVX) { |
1385 vm_inject_gp(vmx->vm, vcpu); 1386 return (HANDLED); 1387 } 1388 1389 /* | 1386 vm_inject_gp(vmx->vm, vcpu); 1387 return (HANDLED); 1388 } 1389 1390 /* |
1391 * AVX512 requires base AVX (YMM_Hi128) as well as OpMask, 1392 * ZMM_Hi256, and Hi16_ZMM. 1393 */ 1394 if (xcrval & XFEATURE_AVX512 && 1395 (xcrval & (XFEATURE_AVX512 | XFEATURE_AVX)) != 1396 (XFEATURE_AVX512 | XFEATURE_AVX)) { 1397 vm_inject_gp(vmx->vm, vcpu); 1398 return (HANDLED); 1399 } 1400 1401 /* 1402 * Intel MPX requires both bound register state flags to be 1403 * set. 1404 */ 1405 if (((xcrval & XFEATURE_ENABLED_BNDREGS) != 0) != 1406 ((xcrval & XFEATURE_ENABLED_BNDCSR) != 0)) { 1407 vm_inject_gp(vmx->vm, vcpu); 1408 return (HANDLED); 1409 } 1410 1411 /* |
|
1390 * This runs "inside" vmrun() with the guest's FPU state, so 1391 * modifying xcr0 directly modifies the guest's xcr0, not the 1392 * host's. 1393 */ 1394 load_xcr(0, xcrval); 1395 return (HANDLED); 1396} 1397 --- 1605 unchanged lines hidden --- | 1412 * This runs "inside" vmrun() with the guest's FPU state, so 1413 * modifying xcr0 directly modifies the guest's xcr0, not the 1414 * host's. 1415 */ 1416 load_xcr(0, xcrval); 1417 return (HANDLED); 1418} 1419 --- 1605 unchanged lines hidden --- |