cpum.h revision 682342827b0e80c493c820603508e79e76c42658
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * CPUM - CPU Monitor(/ Manager).
a5f17f2682f4e8ed08ffca84a036028533ea8f16vboxsync * Copyright (C) 2006-2012 Oracle Corporation
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * available from http://www.virtualbox.org. This file is free software;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * you can redistribute it and/or modify it under the terms of the GNU
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * General Public License (GPL) as published by the Free Software
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * The contents of this file may alternatively be used under the terms
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * of the Common Development and Distribution License Version 1.0
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * VirtualBox OSE distribution, in which case the provisions of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * CDDL are applicable instead of those of the GPL.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * You may elect to license modified versions of this file under the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * terms and conditions of either the GPL or the CDDL or both.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @defgroup grp_cpum The CPU Monitor / Manager API
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * CPUID feature to set or clear.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The APIC feature bit. (Std+Ext) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The sysenter/sysexit feature bit. (Std) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The SYSCALL/SYSEXIT feature bit (64 bits mode only for Intel CPUs). (Ext) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The PAE feature bit. (Std+Ext) */
24986763e9e9e6633a4a54479be945d577fdfd34vboxsync /** The NX feature bit. (Ext) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The LAHF/SAHF feature bit (64 bits mode only). (Ext) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The LONG MODE feature bit. (Ext) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The PAT feature bit. (Std+Ext) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The x2APIC feature bit. (Std) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The RDTSCP feature bit. (Ext) */
99fc25fde31ac60ee18ac48eab7027dea4272a0bvboxsync /** The Hypervisor Present bit. (Std) */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** 32bit hackishness. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * CPU Vendor.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** 32bit hackishness. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @name Guest Register Getters.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMGetGuestGDTR(PVMCPU pVCpu, PVBOXGDTR pGDTR);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(RTGCPTR) CPUMGetGuestIDTR(PVMCPU pVCpu, uint16_t *pcbLimit);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(RTSEL) CPUMGetGuestTR(PVMCPU pVCpu, PCPUMSELREGHID pHidden);
d9e8985b936caa8e72f58c48045478fc2776dc5evboxsyncVMMDECL(RTSEL) CPUMGetGuestLdtrEx(PVMCPU pVCpu, uint64_t *pGCPtrBase, uint32_t *pcbLimit);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMGetGuestCRx(PVMCPU pVCpu, unsigned iReg, uint64_t *pValue);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMGetGuestDRx(PVMCPU pVCpu, uint32_t iReg, uint64_t *pValue);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMGetGuestCpuId(PVMCPU pVCpu, uint32_t iLeaf, uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(uint32_t) CPUMGetGuestCpuIdCentaurMax(PVM pVM);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMQueryGuestMsr(PVMCPU pVCpu, uint32_t idMsr, uint64_t *puValue);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestMsr(PVMCPU pVCpu, uint32_t idMsr, uint64_t uValue);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(CPUMCPUVENDOR) CPUMGetGuestCpuVendor(PVM pVM);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(CPUMCPUVENDOR) CPUMGetHostCpuVendor(PVM pVM);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @name Guest Register Setters.
eb30b3bfcb8b0e55f5498ba7a84e55a536debcd7vboxsyncVMMDECL(int) CPUMSetGuestGDTR(PVMCPU pVCpu, uint64_t GCPtrBase, uint16_t cbLimit);
eb30b3bfcb8b0e55f5498ba7a84e55a536debcd7vboxsyncVMMDECL(int) CPUMSetGuestIDTR(PVMCPU pVCpu, uint64_t GCPtrBase, uint16_t cbLimit);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestTR(PVMCPU pVCpu, uint16_t tr);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestLDTR(PVMCPU pVCpu, uint16_t ldtr);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestCR0(PVMCPU pVCpu, uint64_t cr0);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestCR2(PVMCPU pVCpu, uint64_t cr2);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestCR3(PVMCPU pVCpu, uint64_t cr3);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestCR4(PVMCPU pVCpu, uint64_t cr4);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestDR0(PVMCPU pVCpu, uint64_t uDr0);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestDR1(PVMCPU pVCpu, uint64_t uDr1);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestDR2(PVMCPU pVCpu, uint64_t uDr2);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestDR3(PVMCPU pVCpu, uint64_t uDr3);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestDR6(PVMCPU pVCpu, uint64_t uDr6);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestDR7(PVMCPU pVCpu, uint64_t uDr7);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestDRx(PVMCPU pVCpu, uint32_t iReg, uint64_t Value);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestEFlags(PVMCPU pVCpu, uint32_t eflags);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestEIP(PVMCPU pVCpu, uint32_t eip);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestEAX(PVMCPU pVCpu, uint32_t eax);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestEBX(PVMCPU pVCpu, uint32_t ebx);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestECX(PVMCPU pVCpu, uint32_t ecx);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestEDX(PVMCPU pVCpu, uint32_t edx);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestESI(PVMCPU pVCpu, uint32_t esi);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestEDI(PVMCPU pVCpu, uint32_t edi);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestESP(PVMCPU pVCpu, uint32_t esp);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestEBP(PVMCPU pVCpu, uint32_t ebp);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestCS(PVMCPU pVCpu, uint16_t cs);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestDS(PVMCPU pVCpu, uint16_t ds);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestES(PVMCPU pVCpu, uint16_t es);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestFS(PVMCPU pVCpu, uint16_t fs);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestGS(PVMCPU pVCpu, uint16_t gs);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetGuestSS(PVMCPU pVCpu, uint16_t ss);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetGuestEFER(PVMCPU pVCpu, uint64_t val);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetGuestCpuIdFeature(PVM pVM, CPUMCPUIDFEATURE enmFeature);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMClearGuestCpuIdFeature(PVM pVM, CPUMCPUIDFEATURE enmFeature);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(bool) CPUMGetGuestCpuIdFeature(PVM pVM, CPUMCPUIDFEATURE enmFeature);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetGuestCtx(PVMCPU pVCpu, const PCPUMCTX pCtx);
559419830ee63b8481ade36d8994f235932aae49vboxsyncVMM_INT_DECL(void) CPUMGuestLazyLoadHiddenCsAndSs(PVMCPU pVCpu);
559419830ee63b8481ade36d8994f235932aae49vboxsyncVMM_INT_DECL(void) CPUMGuestLazyLoadHiddenSelectorReg(PVMCPU pVCpu, PCPUMSELREG pSReg);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @name Misc Guest Predicate Functions.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(bool) CPUMIsGuestPageSizeExtEnabled(PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(bool) CPUMIsGuestPagingEnabled(PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(bool) CPUMIsGuestR0WriteProtEnabled(PVMCPU pVCpu);
e69378448f919940b0b999796d40a23df2a7aa39vboxsyncVMMDECL(bool) CPUMIsGuestInRealOrV86Mode(PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(bool) CPUMIsGuestInProtectedMode(PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(bool) CPUMIsGuestInPagedProtectedMode(PVMCPU pVCpu);
26f38400c03761b1934b05fa93a64188e88e9904vboxsyncVMM_INT_DECL(bool) CPUMIsGuestInRawMode(PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Tests if the guest is running in real mode or not.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns true if in real mode, otherwise false.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pCtx Current CPU context
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncDECLINLINE(bool) CPUMIsGuestInRealModeEx(PCPUMCTX pCtx)
e69378448f919940b0b999796d40a23df2a7aa39vboxsync * Tests if the guest is running in real or virtual 8086 mode.
e69378448f919940b0b999796d40a23df2a7aa39vboxsync * @returns @c true if it is, @c false if not.
e69378448f919940b0b999796d40a23df2a7aa39vboxsync * @param pCtx Current CPU context
56fa1b550cbdeec7ef620d566155a388c04ca796vboxsyncDECLINLINE(bool) CPUMIsGuestInRealOrV86ModeEx(PCPUMCTX pCtx)
acf97addaaed7b946d412cfcff46547ba7cb33bfvboxsync || pCtx->eflags.Bits.u1VM; /* Cannot be set in long mode. Intel spec 2.3.1 "System Flags and Fields in IA-32e Mode". */
b40ca073ac6b445a7a49aa6b15fca3c2a26f97a9vboxsync * Tests if the guest is running in virtual 8086 mode.
b40ca073ac6b445a7a49aa6b15fca3c2a26f97a9vboxsync * @returns @c true if it is, @c false if not.
b40ca073ac6b445a7a49aa6b15fca3c2a26f97a9vboxsync * @param pCtx Current CPU context
b40ca073ac6b445a7a49aa6b15fca3c2a26f97a9vboxsyncDECLINLINE(bool) CPUMIsGuestInV86ModeEx(PCPUMCTX pCtx)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Tests if the guest is running in paged protected or not.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns true if in paged protected mode, otherwise false.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pVM The VM handle.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncDECLINLINE(bool) CPUMIsGuestInPagedProtectedModeEx(PCPUMCTX pCtx)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync return (pCtx->cr0 & (X86_CR0_PE | X86_CR0_PG)) == (X86_CR0_PE | X86_CR0_PG);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Tests if the guest is running in long mode or not.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns true if in long mode, otherwise false.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pCtx Current CPU context
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncDECLINLINE(bool) CPUMIsGuestInLongModeEx(PCPUMCTX pCtx)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync return (pCtx->msrEFER & MSR_K6_EFER_LMA) == MSR_K6_EFER_LMA;
559419830ee63b8481ade36d8994f235932aae49vboxsyncVMM_INT_DECL(bool) CPUMIsGuestIn64BitCodeSlow(PCPUMCTX pCtx);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Tests if the guest is running in 64 bits mode or not.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns true if in 64 bits protected mode, otherwise false.
559419830ee63b8481ade36d8994f235932aae49vboxsync * @param pVCpu The current virtual CPU.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pCtx Current CPU context
559419830ee63b8481ade36d8994f235932aae49vboxsyncDECLINLINE(bool) CPUMIsGuestIn64BitCodeEx(PCPUMCTX pCtx)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync return false;
26f38400c03761b1934b05fa93a64188e88e9904vboxsync if (!CPUMSELREG_ARE_HIDDEN_PARTS_VALID(NULL, &pCtx->cs))
886d0ed1f0aa2e75c92140ca240345679d617e4cvboxsync * Tests if the guest has paging enabled or not.
886d0ed1f0aa2e75c92140ca240345679d617e4cvboxsync * @returns true if paging is enabled, otherwise false.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pCtx Current CPU context
886d0ed1f0aa2e75c92140ca240345679d617e4cvboxsyncDECLINLINE(bool) CPUMIsGuestPagingEnabledEx(PCPUMCTX pCtx)
886d0ed1f0aa2e75c92140ca240345679d617e4cvboxsync * Tests if the guest is running in PAE mode or not.
886d0ed1f0aa2e75c92140ca240345679d617e4cvboxsync * @returns true if in PAE mode, otherwise false.
f3fd5f0cfee6865de86bef793a549083d37edd4fvboxsync * @param pCtx Current CPU context
886d0ed1f0aa2e75c92140ca240345679d617e4cvboxsyncDECLINLINE(bool) CPUMIsGuestInPAEModeEx(PCPUMCTX pCtx)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif /* VBOX_WITHOUT_UNNAMED_UNIONS */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @name Hypervisor Register Getters.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#if 0 /* these are not correct. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** This register is only saved on fatal traps. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** This register is only saved on fatal traps. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** This register is only saved on fatal traps. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(uint32_t) CPUMGetHyperIDTR(PVMCPU pVCpu, uint16_t *pcbLimit);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(uint32_t) CPUMGetHyperGDTR(PVMCPU pVCpu, uint16_t *pcbLimit);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMGetHyperCtx(PVMCPU pVCpu, PCPUMCTX pCtx);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @name Hypervisor Register Setters.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperGDTR(PVMCPU pVCpu, uint32_t addr, uint16_t limit);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperLDTR(PVMCPU pVCpu, RTSEL SelLDTR);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperIDTR(PVMCPU pVCpu, uint32_t addr, uint16_t limit);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperCR3(PVMCPU pVCpu, uint32_t cr3);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperTR(PVMCPU pVCpu, RTSEL SelTR);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperCS(PVMCPU pVCpu, RTSEL SelCS);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperDS(PVMCPU pVCpu, RTSEL SelDS);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperES(PVMCPU pVCpu, RTSEL SelDS);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperFS(PVMCPU pVCpu, RTSEL SelDS);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperGS(PVMCPU pVCpu, RTSEL SelDS);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperSS(PVMCPU pVCpu, RTSEL SelSS);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperESP(PVMCPU pVCpu, uint32_t u32ESP);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMSetHyperEFlags(PVMCPU pVCpu, uint32_t Efl);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperEIP(PVMCPU pVCpu, uint32_t u32EIP);
3942acfaf590eaef4740d7b8a5311bb91e2bed0dvboxsyncVMM_INT_DECL(void) CPUMSetHyperState(PVMCPU pVCpu, uint32_t u32EIP, uint32_t u32ESP, uint32_t u32EAX, uint32_t u32EDX);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperDR0(PVMCPU pVCpu, RTGCUINTREG uDr0);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperDR1(PVMCPU pVCpu, RTGCUINTREG uDr1);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperDR2(PVMCPU pVCpu, RTGCUINTREG uDr2);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperDR3(PVMCPU pVCpu, RTGCUINTREG uDr3);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperDR6(PVMCPU pVCpu, RTGCUINTREG uDr6);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperDR7(PVMCPU pVCpu, RTGCUINTREG uDr7);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetHyperCtx(PVMCPU pVCpu, const PCPUMCTX pCtx);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMPushHyper(PVMCPU pVCpu, uint32_t u32);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) CPUMQueryHyperCtxPtr(PVMCPU pVCpu, PCPUMCTX *ppCtx);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(PCCPUMCTXCORE) CPUMGetHyperCtxCore(PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(PCPUMCTX) CPUMQueryGuestCtxPtr(PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(PCCPUMCTXCORE) CPUMGetGuestCtxCore(PVMCPU pVCpu);
682342827b0e80c493c820603508e79e76c42658vboxsyncVMM_INT_DECL(int) CPUMRawEnter(PVMCPU pVCpu, PCPUMCTXCORE pCtxCore);
682342827b0e80c493c820603508e79e76c42658vboxsyncVMM_INT_DECL(int) CPUMRawLeave(PVMCPU pVCpu, PCPUMCTXCORE pCtxCore, int rc);
8cb8cf7eeafbf2ad5b23866ca19f257bd3aaf9e7vboxsyncVMMDECL(void) CPUMRawSetEFlags(PVMCPU pVCpu, uint32_t fEfl);
53799e1f1f6601cd3d6be95ff1aa8d3648712618vboxsync/** @name Changed flags.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * These flags are used to keep track of which important register that
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * have been changed since last they were reset. The only one allowed
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * to clear them is REM!
53799e1f1f6601cd3d6be95ff1aa8d3648712618vboxsync#define CPUM_CHANGED_TR RT_BIT(8) /**@< Currently unused. */
53799e1f1f6601cd3d6be95ff1aa8d3648712618vboxsync#define CPUM_CHANGED_HIDDEN_SEL_REGS RT_BIT(10) /**@< Currently unused. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMSetChangedFlags(PVMCPU pVCpu, uint32_t fChangedFlags);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR3DECL(uint32_t) CPUMR3RemEnter(PVMCPU pVCpu, uint32_t *puCpl);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR3DECL(void) CPUMR3RemLeave(PVMCPU pVCpu, bool fNoOutOfSyncSels);
79883babb0e5b9c7397c304d576bfc29282542afvboxsyncVMMDECL(bool) CPUMIsGuestFPUStateActive(PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMDeactivateGuestFPUState(PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(bool) CPUMIsGuestDebugStateActive(PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMDeactivateGuestDebugState(PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(bool) CPUMIsHyperDebugStateActive(PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(void) CPUMDeactivateHyperDebugState(PVMCPU pVCpu);
681380880d4131019871e8f22cb3349b757168cavboxsyncVMMDECL(uint32_t) CPUMGetGuestCodeBits(PVMCPU pVCpu);
681380880d4131019871e8f22cb3349b757168cavboxsyncVMMDECL(DISCPUMODE) CPUMGetGuestDisMode(PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @defgroup grp_cpum_r3 The CPU Monitor(/Manager) API
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @ingroup grp_cpum
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR3DECL(void) CPUMR3SetHWVirtEx(PVM pVM, bool fHWVirtExEnabled);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR3DECL(int) CPUMR3SetCR4Feature(PVM pVM, RTHCUINTREG fOr, RTHCUINTREG fAnd);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR3DECL(RCPTRTYPE(PCCPUMCPUID)) CPUMR3GetGuestCpuIdStdRCPtr(PVM pVM);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR3DECL(RCPTRTYPE(PCCPUMCPUID)) CPUMR3GetGuestCpuIdExtRCPtr(PVM pVM);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR3DECL(RCPTRTYPE(PCCPUMCPUID)) CPUMR3GetGuestCpuIdCentaurRCPtr(PVM pVM);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR3DECL(RCPTRTYPE(PCCPUMCPUID)) CPUMR3GetGuestCpuIdDefRCPtr(PVM pVM);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif /* IN_RING3 */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @defgroup grp_cpum_gc The CPU Monitor(/Manager) API
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @ingroup grp_cpum
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Calls a guest trap/interrupt handler directly
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Assumes a trap stack frame has already been setup on the guest's stack!
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This function does not return!
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pRegFrame Original trap/interrupt context
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param selCS Code selector of handler
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pHandler GC virtual address of handler
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param eflags Callee's EFLAGS
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param selSS Stack selector for handler
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pEsp Stack address for handler
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncDECLASM(void) CPUMGCCallGuestTrapHandler(PCPUMCTXCORE pRegFrame, uint32_t selCS, RTRCPTR pHandler,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Call guest V86 code directly.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This function does not return!
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pRegFrame Original trap/interrupt context
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncDECLASM(void) CPUMGCCallV86Code(PCPUMCTXCORE pRegFrame);
7ce6e7e8fb0eddb176361a49f53fa1bd15eaab4evboxsyncVMMDECL(uint32_t) CPUMRCGetGuestCPL(PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
7847c123aebebc6d3d5c1406619cfba1ab6457c1vboxsyncVMMDECL(void) CPUMRCRecheckRawState(PVMCPU pVCpu, PCPUMCTXCORE pCtxCore);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif /* IN_RC */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @defgroup grp_cpum_r0 The CPU Monitor(/Manager) API
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @ingroup grp_cpum
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR0DECL(int) CPUMR0LoadGuestFPU(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR0DECL(int) CPUMR0SaveGuestFPU(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR0DECL(int) CPUMR0SaveGuestDebugState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, bool fDR6);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR0DECL(int) CPUMR0LoadGuestDebugState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, bool fDR6);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR0DECL(int) CPUMR0LoadHostDebugState(PVM pVM, PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR0DECL(int) CPUMR0SaveHostDebugState(PVM pVM, PVMCPU pVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR0DECL(int) CPUMR0LoadHyperDebugState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, bool fDR6);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR0DECL(void) CPUMR0SetLApic(PVM pVM, RTCPUID idHostCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif /* IN_RING0 */