vm.h revision c0bb001383d15182924df1961f9877f848796392
0b87790df72dd730ef361a1ce1a8d40ed4d15e10vboxsync * VM - The Virtual Machine, data.
772269936494ffaddd0750ba9e28e805ba81398cvboxsync * Copyright (C) 2006-2007 innotek GmbH
0b87790df72dd730ef361a1ce1a8d40ed4d15e10vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
0b87790df72dd730ef361a1ce1a8d40ed4d15e10vboxsync * available from http://www.virtualbox.org. This file is free software;
0b87790df72dd730ef361a1ce1a8d40ed4d15e10vboxsync * you can redistribute it and/or modify it under the terms of the GNU
0b87790df72dd730ef361a1ce1a8d40ed4d15e10vboxsync * General Public License (GPL) as published by the Free Software
0b87790df72dd730ef361a1ce1a8d40ed4d15e10vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
0b87790df72dd730ef361a1ce1a8d40ed4d15e10vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
0b87790df72dd730ef361a1ce1a8d40ed4d15e10vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
0b87790df72dd730ef361a1ce1a8d40ed4d15e10vboxsync * The contents of this file may alternatively be used under the terms
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * of the Common Development and Distribution License Version 1.0
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * VirtualBox OSE distribution, in which case the provisions of the
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync * CDDL are applicable instead of those of the GPL.
4acc8b08449be3ee3745e66d85e79f474098870bvboxsync * You may elect to license modified versions of this file under the
4acc8b08449be3ee3745e66d85e79f474098870bvboxsync * terms and conditions of either the GPL or the CDDL or both.
20fc4a350a4a8e56ffaac6cf57dcd677a7ac36c5vboxsync/** @defgroup grp_vm The Virtual Machine
38ce01f0174eaa361f03608d5576e517a615a9dbvboxsync/** The name of the Guest Context VMM Core module. */
a24a5c1de771bb93e5b0fe0adb3e16dc6d835838vboxsync/** The name of the Ring 0 Context VMM Core module. */
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync/** VM Forced Action Flags.
0e1eea910a209a7a8edeed71c9be066a02f59202vboxsync * Use the VM_FF_SET() and VM_FF_CLEAR() macros to change the force
0e1eea910a209a7a8edeed71c9be066a02f59202vboxsync * action mask of a VM.
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync/** This action forces the VM to service check and pending interrups on the APIC. */
6418539e7e63a36f6c1f2e6170e4e881a3693947vboxsync/** This action forces the VM to service check and pending interrups on the PIC. */
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync/** This action forces the VM to schedule and run pending timer (TM). */
2ac7f49e11a553a348be2be368bed8fd942820c4vboxsync/** PDM Queues are pending. */
2ac7f49e11a553a348be2be368bed8fd942820c4vboxsync/** PDM DMA transfers are pending. */
2ac7f49e11a553a348be2be368bed8fd942820c4vboxsync/** PDM critical section unlocking is pending, process promptly upon return to R3. */
a218a3f92594b5f2beb9c8298c6fe6e3a8e502f8vboxsync/** This action forces the VM to call DBGF so DBGF can service debugger
f0c792e78a8bf77c28c7814441e514bea7c5362bvboxsync * requests in the emulation thread.
a218a3f92594b5f2beb9c8298c6fe6e3a8e502f8vboxsync * This action flag stays asserted till DBGF clears it.*/
a218a3f92594b5f2beb9c8298c6fe6e3a8e502f8vboxsync/** This action forces the VM to service pending requests from other
2d5c2f8b7f8e7cfeb5eb272b1242e4258dcd64bevboxsync * thread or requests which must be executed in another context. */
a218a3f92594b5f2beb9c8298c6fe6e3a8e502f8vboxsync/** Terminate the VM immediately. */
a218a3f92594b5f2beb9c8298c6fe6e3a8e502f8vboxsync/** Reset the VM. (postponed) */
9f8403c919ff34010f07a4e697c619fbfe832555vboxsync/** This action forces the VM to resync the page tables before going
9f8403c919ff34010f07a4e697c619fbfe832555vboxsync * back to execute guest code. (GLOBAL FLUSH) */
9f8403c919ff34010f07a4e697c619fbfe832555vboxsync/** Same as VM_FF_PGM_SYNC_CR3 except that global pages can be skipped.
9f8403c919ff34010f07a4e697c619fbfe832555vboxsync * (NON-GLOBAL FLUSH) */
9f8403c919ff34010f07a4e697c619fbfe832555vboxsync/** PGM needs to allocate handy pages. */
c12ea5636f55fa8c4d8de7d0ccb870c5f8bcc231vboxsync/** Check the interupt and trap gates */
c12ea5636f55fa8c4d8de7d0ccb870c5f8bcc231vboxsync/** Check Guest's TSS ring 0 stack */
c12ea5636f55fa8c4d8de7d0ccb870c5f8bcc231vboxsync/** Check Guest's GDT table */
c12ea5636f55fa8c4d8de7d0ccb870c5f8bcc231vboxsync/** Check Guest's LDT table */
a218a3f92594b5f2beb9c8298c6fe6e3a8e502f8vboxsync/** Inhibit interrupts pending. See EMGetInhibitInterruptsPC(). */
a218a3f92594b5f2beb9c8298c6fe6e3a8e502f8vboxsync/** CSAM needs to scan the page that's being executed */
a218a3f92594b5f2beb9c8298c6fe6e3a8e502f8vboxsync/** CSAM needs to do some homework. */
a218a3f92594b5f2beb9c8298c6fe6e3a8e502f8vboxsync/** Force return to Ring-3. */
a3d9dd392ec76233e30f01423ed5755e6187618evboxsync/** Suspend the VM - debug only. */
772269936494ffaddd0750ba9e28e805ba81398cvboxsync/** Externally forced actions. Used to quit the idle/wait loop. */
#define VM_FF_EXTERNAL_HALTED_MASK (VM_FF_TERMINATE | VM_FF_DBGF | VM_FF_TIMER | VM_FF_INTERRUPT_APIC | VM_FF_INTERRUPT_PIC | VM_FF_REQUEST | VM_FF_PDM_QUEUES | VM_FF_PDM_DMA)
#define VM_FF_HIGH_PRIORITY_PRE_MASK (VM_FF_TERMINATE | VM_FF_DBGF | VM_FF_INTERRUPT_APIC | VM_FF_INTERRUPT_PIC | VM_FF_TIMER | VM_FF_DEBUG_SUSPEND \
| VM_FF_PGM_SYNC_CR3 | VM_FF_PGM_SYNC_CR3_NON_GLOBAL | VM_FF_SELM_SYNC_TSS | VM_FF_TRPM_SYNC_IDT | VM_FF_SELM_SYNC_GDT | VM_FF_SELM_SYNC_LDT | VM_FF_PGM_NEED_HANDY_PAGES)
#define VM_FF_HIGH_PRIORITY_PRE_RAW_MASK (VM_FF_PGM_SYNC_CR3 | VM_FF_PGM_SYNC_CR3_NON_GLOBAL | VM_FF_SELM_SYNC_TSS | VM_FF_TRPM_SYNC_IDT | VM_FF_SELM_SYNC_GDT | VM_FF_SELM_SYNC_LDT | VM_FF_PGM_NEED_HANDY_PAGES \
#define VM_FF_NORMAL_PRIORITY_POST_MASK (VM_FF_TERMINATE | VM_FF_DBGF | VM_FF_RESET | VM_FF_CSAM_SCAN_PAGE)
#define VM_FF_ALL_MASK (~0U)
#define VM_FF_ALL_BUT_RAW_MASK (~(VM_FF_HIGH_PRIORITY_PRE_RAW_MASK | VM_FF_CSAM_PENDING_ACTION | VM_FF_PDM_CRITSECT))
RTLogPrintf("VM_FF_SET : %08x %s - %s(%d) %s\n", (pVM)->fForcedActions, #fFlag, __FILE__, __LINE__, __FUNCTION__); \
RTLogPrintf("VM_FF_CLEAR: %08x %s - %s(%d) %s\n", (pVM)->fForcedActions, #fFlag, __FILE__, __LINE__, __FUNCTION__); \
#ifdef IN_GC
#ifdef IN_GC
("Not emulation thread! Thread=%RTnthrd ThreadEMT=%RTnthrd\n", RTThreadNativeSelf(), pVM->NativeThreadEMT))
#ifdef IN_GC
("Not emulation thread! Thread=%RTnthrd ThreadEMT=%RTnthrd\n", RTThreadNativeSelf(), pVM->NativeThreadEMT), \
(rc))
(rc))
typedef struct VM
bool fRawR3Enabled;
bool fRawR0Enabled;
bool fPATMEnabled;
bool fCSAMEnabled;
bool fHWACCMEnabled;
#ifdef ___CPUMInternal_h
struct CPUM s;
} cpum;
#ifdef ___VMMInternal_h
struct VMM s;
} vmm;
#ifdef ___PGMInternal_h
struct PGM s;
} pgm;
#ifdef ___HWACCMInternal_h
struct HWACCM s;
} hwaccm;
#ifdef ___TRPMInternal_h
struct TRPM s;
} trpm;
#ifdef ___SELMInternal_h
struct SELM s;
} selm;
#ifdef ___MMInternal_h
struct MM s;
} mm;
#ifdef ___CFGMInternal_h
struct CFGM s;
} cfgm;
#ifdef ___PDMInternal_h
struct PDM s;
} pdm;
#ifdef ___IOMInternal_h
struct IOM s;
} iom;
#ifdef ___PATMInternal_h
struct PATM s;
} patm;
#ifdef ___CSAMInternal_h
struct CSAM s;
} csam;
#ifdef ___EMInternal_h
struct EM s;
} em;
#ifdef ___TMInternal_h
struct TM s;
} tm;
#ifdef ___DBGFInternal_h
struct DBGF s;
} dbgf;
#ifdef ___SSMInternal_h
struct SSM s;
} ssm;
#ifdef ___VMInternal_h
struct VMINT s;
} vm;
#ifdef ___REMInternal_h
struct REM s;
} rem;
} VM;
#ifndef ___VBox_types_h
#ifdef IN_GC