cpum.h revision 7481bcc52798a04f39bb360635624df5658d2791
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * CPUM - CPU Monitor(/ Manager).
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * Copyright (C) 2006-2013 Oracle Corporation
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * This file is part of VirtualBox Open Source Edition (OSE), as
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * available from http://www.virtualbox.org. This file is free software;
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * you can redistribute it and/or modify it under the terms of the GNU
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * General Public License (GPL) as published by the Free Software
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * Foundation, in version 2 as it comes in the "COPYING" file of the
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * The contents of this file may alternatively be used under the terms
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * of the Common Development and Distribution License Version 1.0
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * VirtualBox OSE distribution, in which case the provisions of the
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * CDDL are applicable instead of those of the GPL.
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * You may elect to license modified versions of this file under the
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * terms and conditions of either the GPL or the CDDL or both.
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos/** @defgroup grp_cpum The CPU Monitor / Manager API
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * CPUID feature to set or clear.
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos /** The APIC feature bit. (Std+Ext) */
ba237d49c6ea085e3a01e2103494425558d042f6Alin Brici /** The sysenter/sysexit feature bit. (Std) */
ba237d49c6ea085e3a01e2103494425558d042f6Alin Brici /** The SYSCALL/SYSEXIT feature bit (64 bits mode only for Intel CPUs). (Ext) */
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos /** The PAE feature bit. (Std+Ext) */
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos /** The NX feature bit. (Ext) */
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos /** The LAHF/SAHF feature bit (64 bits mode only). (Ext) */
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos /** The LONG MODE feature bit. (Ext) */
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos /** The PAT feature bit. (Std+Ext) */
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos /** The x2APIC feature bit. (Std) */
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos /** The RDTSCP feature bit. (Ext) */
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos /** The Hypervisor Present bit. (Std) */
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos /** 32bit hackishness. */
ebea1fb75b85aba5e3d6dd10e1949046a71e4a72Alin Brici * CPU Vendor.
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos /** 32bit hackishness. */
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * X86 and AMD64 CPU microarchitectures and in processor generations.
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * @remarks The separation here is sometimes a little bit too finely grained,
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos * and the differences is more like processor generation than micro
963cc96f97623aac2218f625e558cff1ddaea8c1Laszlo Hordos * arch. This can be useful, so we'll provide functions for getting at
a1d206a2a22b5cde9b00633ea4472ae0b144d695Brendan Mmiller * more coarse grained info.
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos kCpumMicroarch_Intel_8086 = kCpumMicroarch_Intel_First,
752de95b3096f209954edc85d0507259f156eabdLaszlo Hordos kCpumMicroarch_Intel_P6 = kCpumMicroarch_Intel_P6_Core_Atom_First,
kCpumMicroarch_Intel_NB_Gallatin, /**< 90nm Xeon, Pentium 4 Extreme Edition ("Emergency Edition"). */
kCpumMicroarch_AMD_K8_130nm = kCpumMicroarch_AMD_K8_First, /**< 130nm Clawhammer, Sledgehammer, Newcastle, Paris, Odessa, Dublin */
((a_enmMicroarch) >= kCpumMicroarch_Intel_NB_First && (a_enmMicroarch) <= kCpumMicroarch_Intel_NB_End)
((a_enmMicroarch) >= kCpumMicroarch_Intel_Core7_First && (a_enmMicroarch) <= kCpumMicroarch_Intel_Core7_End)
#define CPUMMICROARCH_IS_AMD_FAM_11H(a_enmMicroarch) ((a_enmMicroarch) == kCpumMicroarch_AMD_K10_Lion)
#define CPUMMICROARCH_IS_AMD_FAM_12H(a_enmMicroarch) ((a_enmMicroarch) == kCpumMicroarch_AMD_K10_Llano)
#define CPUMMICROARCH_IS_AMD_FAM_14H(a_enmMicroarch) ((a_enmMicroarch) == kCpumMicroarch_AMD_Bobcat)
((a_enmMicroarch) >= kCpumMicroarch_AMD_15h_First && (a_enmMicroarch) <= kCpumMicroarch_AMD_15h_End)
((a_enmMicroarch) >= kCpumMicroarch_AMD_16h_First && (a_enmMicroarch) <= kCpumMicroarch_AMD_16h_End)
typedef struct CPUMCPUIDLEAF
typedef enum CPUMUKNOWNCPUID
typedef struct CPUMMSRRANGE
#ifdef VBOX_WITH_STATISTICS
} CPUMMSRRANGE;
#ifdef VBOX_WITH_STATISTICS
VMMDECL(void) CPUMGetGuestCpuId(PVMCPU pVCpu, uint32_t iLeaf, uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx);
#ifndef VBOX_WITHOUT_UNNAMED_UNIONS
|| pCtx->eflags.Bits.u1VM; /* Cannot be set in long mode. Intel spec 2.3.1 "System Flags and Fields in IA-32e Mode". */
/* Intel mentions EFER.LMA and EFER.LME in different parts of their spec. We shall use EFER.LMA rather
VMM_INT_DECL(void) CPUMSetHyperState(PVMCPU pVCpu, uint32_t u32EIP, uint32_t u32ESP, uint32_t u32EAX, uint32_t u32EDX);
| CPUM_CHANGED_CR0 \
| CPUM_CHANGED_CR4 \
| CPUM_CHANGED_CR3 \
| CPUM_CHANGED_TR \
#ifdef IN_RING3
VMMR3DECL(int) CPUMR3CpuIdDetectUnknownLeafMethod(PCPUMUKNOWNCPUID penmUnknownMethod, PCPUMCPUID pDefUnknown);
VMMR3DECL(CPUMCPUVENDOR) CPUMR3CpuIdDetectVendorEx(uint32_t uEAX, uint32_t uEBX, uint32_t uECX, uint32_t uEDX);
#ifdef IN_RC
#ifdef VBOX_WITH_RAW_RING1
#ifdef IN_RING0