x86.h revision 255287
1218912Slstewart/*- 2218912Slstewart * Copyright (c) 2011 NetApp, Inc. 3218912Slstewart * All rights reserved. 4218912Slstewart * 5218912Slstewart * Redistribution and use in source and binary forms, with or without 6218912Slstewart * modification, are permitted provided that the following conditions 7220560Slstewart * are met: 8220560Slstewart * 1. Redistributions of source code must retain the above copyright 9218912Slstewart * notice, this list of conditions and the following disclaimer. 10218912Slstewart * 2. Redistributions in binary form must reproduce the above copyright 11218912Slstewart * notice, this list of conditions and the following disclaimer in the 12218912Slstewart * documentation and/or other materials provided with the distribution. 13218912Slstewart * 14218912Slstewart * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND 15218912Slstewart * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16218912Slstewart * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17218912Slstewart * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE 18218912Slstewart * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19218912Slstewart * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20218912Slstewart * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21218912Slstewart * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22218912Slstewart * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23218912Slstewart * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24218912Slstewart * SUCH DAMAGE. 25218912Slstewart * 26218912Slstewart * $FreeBSD: head/sys/amd64/vmm/x86.h 255287 2013-09-06 05:16:10Z grehan $ 27218912Slstewart */ 28218912Slstewart 29218912Slstewart#ifndef _X86_H_ 30218912Slstewart#define _X86_H_ 31218912Slstewart 32218912Slstewart#define CPUID_0000_0000 (0x0) 33225583Slstewart#define CPUID_0000_0001 (0x1) 34218912Slstewart#define CPUID_0000_0002 (0x2) 35218912Slstewart#define CPUID_0000_0003 (0x3) 36218912Slstewart#define CPUID_0000_0004 (0x4) 37218912Slstewart#define CPUID_0000_0006 (0x6) 38218912Slstewart#define CPUID_0000_0007 (0x7) 39218912Slstewart#define CPUID_0000_000A (0xA) 40218912Slstewart#define CPUID_0000_000B (0xB) 41218912Slstewart#define CPUID_0000_000D (0xD) 42218912Slstewart#define CPUID_8000_0000 (0x80000000) 43218912Slstewart#define CPUID_8000_0001 (0x80000001) 44218912Slstewart#define CPUID_8000_0002 (0x80000002) 45218912Slstewart#define CPUID_8000_0003 (0x80000003) 46218912Slstewart#define CPUID_8000_0004 (0x80000004) 47218912Slstewart#define CPUID_8000_0006 (0x80000006) 48218912Slstewart#define CPUID_8000_0007 (0x80000007) 49218912Slstewart#define CPUID_8000_0008 (0x80000008) 50225583Slstewart 51218912Slstewart/* 52225583Slstewart * CPUID instruction Fn0000_0001: 53218912Slstewart */ 54218912Slstewart#define CPUID_0000_0001_APICID_MASK (0xff<<24) 55218912Slstewart#define CPUID_0000_0001_APICID_SHIFT 24 56218912Slstewart 57218912Slstewart/* 58218912Slstewart * CPUID instruction Fn0000_0001 ECX 59218912Slstewart */ 60218912Slstewart#define CPUID_0000_0001_FEAT0_VMX (1<<5) 61218912Slstewart 62218912Slstewartint x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint32_t *eax, uint32_t *ebx, 63218912Slstewart uint32_t *ecx, uint32_t *edx); 64220560Slstewart 65220560Slstewart#endif 66220560Slstewart