CPUMR0.cpp revision d8a23af9e839b76190777c3be93a8517751d4c0c
0f70ed40798198e1d9099c6ae3bdb239d2b8cf0dvboxsync * CPUM - Host Context Ring 0.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * Copyright (C) 2006-2011 Oracle Corporation
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
82bcaaf8077ba892f39afb721dca149353c63d2cvboxsync * available from http://www.virtualbox.org. This file is free software;
82bcaaf8077ba892f39afb721dca149353c63d2cvboxsync * you can redistribute it and/or modify it under the terms of the GNU
82bcaaf8077ba892f39afb721dca149353c63d2cvboxsync * General Public License (GPL) as published by the Free Software
82bcaaf8077ba892f39afb721dca149353c63d2cvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
82bcaaf8077ba892f39afb721dca149353c63d2cvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
82bcaaf8077ba892f39afb721dca149353c63d2cvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync/*******************************************************************************
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync* Header Files *
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync*******************************************************************************/
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync/*******************************************************************************
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync* Structures and Typedefs *
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync*******************************************************************************/
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * Local APIC mappings.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync /** Indicates that the entry is in use and have valid data. */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync /** Has APIC_REG_LVT_THMR. Not used. */
500aaaf3dc1d98456808e7618db3fb2e7c8fb8e0vboxsync /** The physical address of the APIC registers. */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync /** The memory object entering the physical address. */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync /** The mapping object for hMemObj. */
2e2dec6e64c09dd7e3fe4ad0ee8bb5cf7d63762evboxsync /** The mapping address APIC registers.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * @remarks Different CPUs may use the same physical address to map their
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * APICs, so this pointer is only valid when on the CPU owning the
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync/*******************************************************************************
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync* Global Variables *
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync*******************************************************************************/
2e2dec6e64c09dd7e3fe4ad0ee8bb5cf7d63762evboxsync/*******************************************************************************
2e2dec6e64c09dd7e3fe4ad0ee8bb5cf7d63762evboxsync* Internal Functions *
2e2dec6e64c09dd7e3fe4ad0ee8bb5cf7d63762evboxsync*******************************************************************************/
e2843ed205192b88e54eef60ad541d00bbbc932avboxsyncstatic int cpumR0MapLocalApics(void);
e2843ed205192b88e54eef60ad541d00bbbc932avboxsyncstatic void cpumR0UnmapLocalApics(void);
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync * Does the Ring-0 CPU initialization once during module load.
77da7a074c86956d36759983037056c00cb87535vboxsync * XXX Host-CPU hot-plugging?
2e2dec6e64c09dd7e3fe4ad0ee8bb5cf7d63762evboxsync * Terminate the module.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * Does Ring-0 CPUM initialization.
2e2dec6e64c09dd7e3fe4ad0ee8bb5cf7d63762evboxsync * This is mainly to check that the Host CPU mode is compatible
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * with VBox.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * @returns VBox status code.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * @param pVM The VM to operate on.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * Check CR0 & CR4 flags.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync if ((u32CR0 & (X86_CR0_PE | X86_CR0_PG)) != (X86_CR0_PE | X86_CR0_PG)) /* a bit paranoid perhaps.. */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync Log(("CPUMR0Init: PE or PG not set. cr0=%#x\n", u32CR0));
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * Check for sysenter and syscall usage.
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync * Intel docs claim you should test both the flag and family, model &
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync * stepping because some Pentium Pro CPUs have the SEP cpuid flag set,
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync * but don't support it. AMD CPUs may support this feature in legacy
2e2dec6e64c09dd7e3fe4ad0ee8bb5cf7d63762evboxsync * mode, they've banned it from long mode. Since we switch to 32-bit
2e2dec6e64c09dd7e3fe4ad0ee8bb5cf7d63762evboxsync * mode when entering raw-mode context the feature would become
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * accessible again on AMD CPUs, so we have to check regardless of
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * host bitness.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync ASMCpuId(1, &u32CpuVersion, &u32Dummy, &u32Dummy, &fFeatures);
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync * Read the MSR and see if it's in use or not.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync Log(("CPUMR0Init: host uses sysenter cs=%08x%08x\n", ASMRdMsr_High(MSR_IA32_SYSENTER_CS), u32));
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * This feature is indicated by the SEP bit returned in EDX by CPUID
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * function 0x80000001. Intel CPUs only supports this feature in
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * long mode. Since we're not running 64-bit guests in raw-mode there
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * are no issues with 32-bit intel hosts.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync ASMCpuId(0x80000000, &cExt, &u32Dummy, &u32Dummy, &u32Dummy);
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync uint32_t fExtFeaturesEDX = ASMCpuId_EDX(0x80000001);
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync if (fExtFeaturesEDX & X86_CPUID_AMD_FEATURE_EDX_SEP)
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync if (fExtFeaturesEDX & X86_CPUID_AMD_FEATURE_EDX_LONG_MODE)
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * Check if debug registers are armed.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * This ASSUMES that DR7.GD is not set, or that it's handled transparently!
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync pVM->aCpus[i].cpum.s.fUseFlags |= CPUM_USE_DEBUG_REGS_HOST;
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync Log(("CPUMR0Init: host uses debug registers (dr7=%x)\n", u32DR7));
2e2dec6e64c09dd7e3fe4ad0ee8bb5cf7d63762evboxsync * Lazily sync in the FPU/XMM state
7f67048412d241d45c0835b9c403a5bb1c879030vboxsync * @returns VBox status code.
7f67048412d241d45c0835b9c403a5bb1c879030vboxsync * @param pVM VM handle.
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync * @param pVCpu VMCPU handle.
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync * @param pCtx CPU context
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsyncVMMR0DECL(int) CPUMR0LoadGuestFPU(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync /* If the FPU state has already been loaded, then it's a guest trap. */
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync Assert( ((pCtx->cr0 & (X86_CR0_MP | X86_CR0_EM | X86_CR0_TS)) == (X86_CR0_MP | X86_CR0_EM | X86_CR0_TS))
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync || ((pCtx->cr0 & (X86_CR0_MP | X86_CR0_EM | X86_CR0_TS)) == (X86_CR0_MP | X86_CR0_TS)));
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * There are two basic actions:
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * 1. Save host fpu and restore guest fpu.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * 2. Generate guest trap.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * When entering the hypervisor we'll always enable MP (for proper wait
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * trapping) and TS (for intercepting all fpu/mmx/sse stuff). The EM flag
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * is taken from the guest OS in order to get proper SSE handling.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * Actions taken depending on the guest CR0 flags:
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * TS | EM | MP | FPUInstr | WAIT :: VMM Action
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * ------------------------------------------------------------------------
8a8d7629deae8875b70c6899e8b0f683b2a543e1vboxsync * 0 | 0 | 0 | Exec | Exec :: Clear TS & MP, Save HC, Load GC.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * 0 | 0 | 1 | Exec | Exec :: Clear TS, Save HC, Load GC.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * 0 | 1 | 0 | #NM | Exec :: Clear TS & MP, Save HC, Load GC.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * 0 | 1 | 1 | #NM | Exec :: Clear TS, Save HC, Load GC.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * 1 | 0 | 0 | #NM | Exec :: Clear MP, Save HC, Load GC. (EM is already cleared.)
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * 1 | 0 | 1 | #NM | #NM :: Go to guest taking trap there.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * 1 | 1 | 0 | #NM | Exec :: Clear MP, Save HC, Load GC. (EM is already set.)
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * 1 | 1 | 1 | #NM | #NM :: Go to guest taking trap there.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync switch (pCtx->cr0 & (X86_CR0_MP | X86_CR0_EM | X86_CR0_TS))
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_SYNC_FPU_STATE));
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync /* Save the host state and record the fact (CPUM_USED_FPU | CPUM_USED_FPU_SINCE_REM). */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync /* Restore the state on entry as we need to be in 64 bits mode to access the full state. */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync# if defined(VBOX_WITH_HYBRID_32BIT_KERNEL) || defined(VBOX_WITH_KERNEL_USING_XMM) /** @todo remove the #else here and move cpumHandleLazyFPUAsm back to VMMGC after branching out 3.0!!. */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_MANUAL_XMM_RESTORE));
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync /** @todo Move the FFXR handling down into
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * cpumR0SaveHostRestoreguestFPUState to optimize the
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * VBOX_WITH_KERNEL_USING_XMM handling. */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync /* Clear MSR_K6_EFER_FFXSR or else we'll be unable to save/restore the XMM state with fxsave/fxrstor. */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync if (pVM->cpum.s.CPUFeaturesExt.edx & X86_CPUID_AMD_FEATURE_EDX_FFXSR)
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync ASMWrMsr(MSR_K6_EFER, SavedEFER & ~MSR_K6_EFER_FFXSR);
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync pVCpu->cpum.s.fUseFlags |= CPUM_MANUAL_XMM_RESTORE;
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync /* Do the job and record that we've switched FPU state. */
150e55a1de2d8702b09de9dd08e488cc9da197d9vboxsync cpumR0SaveHostRestoreGuestFPUState(&pVCpu->cpum.s);
9a12ad9a1028187595f21d9264898220c1ea565fvboxsync /* Restore EFER. */
9a12ad9a1028187595f21d9264898220c1ea565fvboxsync if (pVCpu->cpum.s.fUseFlags & CPUM_MANUAL_XMM_RESTORE)
9a12ad9a1028187595f21d9264898220c1ea565fvboxsync /* Clear MSR_K6_EFER_FFXSR or else we'll be unable to save/restore the XMM state with fxsave/fxrstor. */
8a8d7629deae8875b70c6899e8b0f683b2a543e1vboxsync if (pVM->cpum.s.CPUFeaturesExt.edx & X86_CPUID_AMD_FEATURE_EDX_FFXSR)
9a12ad9a1028187595f21d9264898220c1ea565fvboxsync /** @todo Do we really need to read this every time?? The host could change this on the fly though.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * bird: what about starting by skipping the ASMWrMsr below if we didn't
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * change anything? Ditto for the stuff in CPUMR0SaveGuestFPU. */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync ASMWrMsr(MSR_K6_EFER, oldMsrEFERHost & ~MSR_K6_EFER_FFXSR);
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync pVCpu->cpum.s.fUseFlags |= CPUM_MANUAL_XMM_RESTORE;
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync /* If we sync the FPU/XMM state on-demand, then we can continue execution as if nothing has happened. */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync /* Restore EFER MSR */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync if (pVCpu->cpum.s.fUseFlags & CPUM_MANUAL_XMM_RESTORE)
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync /* CPUMHandleLazyFPU could have changed CR0; restore it. */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync#else /* CPUM_CAN_HANDLE_NM_TRAPS_IN_KERNEL_MODE */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * Save the FPU control word and MXCSR, so we can restore the state properly afterwards.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * We don't want the guest to be able to trigger floating point/SSE exceptions on the host.
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync * The MSR_K6_EFER_FFXSR feature is AMD only so far, but check the cpuid just in case Intel adds it in the future.
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync * MSR_K6_EFER_FFXSR changes the behaviour of fxsave and fxrstore: the XMM state isn't saved/restored
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync if (pVM->cpum.s.CPUFeaturesExt.edx & X86_CPUID_AMD_FEATURE_EDX_FFXSR)
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync /** @todo Do we really need to read this every time?? The host could change this on the fly though. */
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync /* fxrstor doesn't restore the XMM state! */
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync pVCpu->cpum.s.fUseFlags |= CPUM_MANUAL_XMM_RESTORE;
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync#endif /* CPUM_CAN_HANDLE_NM_TRAPS_IN_KERNEL_MODE */
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync Assert((pVCpu->cpum.s.fUseFlags & (CPUM_USED_FPU | CPUM_USED_FPU_SINCE_REM)) == (CPUM_USED_FPU | CPUM_USED_FPU_SINCE_REM));
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync * Save guest FPU/XMM state
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync * @returns VBox status code.
d5b5f09d8841828e647de9da5003fda55ca4cd5evboxsync * @param pVM VM handle.
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync * @param pVCpu VMCPU handle.
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync * @param pCtx CPU context
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsyncVMMR0DECL(int) CPUMR0SaveGuestFPU(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync AssertReturn((pVCpu->cpum.s.fUseFlags & CPUM_USED_FPU), VINF_SUCCESS);
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync if (!(pVCpu->cpum.s.fUseFlags & CPUM_SYNC_FPU_STATE))
2622c26c6b4105d944a29c5e2c77b6ef26e10101vboxsync /* else nothing to do; we didn't perform a world switch */
2e2dec6e64c09dd7e3fe4ad0ee8bb5cf7d63762evboxsync * We've already saved the XMM registers in the assembly wrapper, so
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * we have to save them before saving the entire FPU state and put them
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * back afterwards.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync /** @todo This could be skipped if MSR_K6_EFER_FFXSR is set, but
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * I'm not able to test such an optimization tonight.
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync * We could just all this in assembly. */
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync memcpy(&aGuestXmmRegs[0], &pVCpu->cpum.s.Guest.fpu.aXMM[0], sizeof(aGuestXmmRegs));
2e2dec6e64c09dd7e3fe4ad0ee8bb5cf7d63762evboxsync /* Clear MSR_K6_EFER_FFXSR or else we'll be unable to save/restore the XMM state with fxsave/fxrstor. */
2e2dec6e64c09dd7e3fe4ad0ee8bb5cf7d63762evboxsync if (pVCpu->cpum.s.fUseFlags & CPUM_MANUAL_XMM_RESTORE)
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync ASMWrMsr(MSR_K6_EFER, oldMsrEFERHost & ~MSR_K6_EFER_FFXSR);
d1a00c93378091ef28db9d959b2d692cc8143a07vboxsync cpumR0SaveGuestRestoreHostFPUState(&pVCpu->cpum.s);
2e2dec6e64c09dd7e3fe4ad0ee8bb5cf7d63762evboxsync /* Restore EFER MSR */
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync if (pVCpu->cpum.s.fUseFlags & CPUM_MANUAL_XMM_RESTORE)
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync ASMWrMsr(MSR_K6_EFER, oldMsrEFERHost | MSR_K6_EFER_FFXSR);
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync memcpy(&pVCpu->cpum.s.Guest.fpu.aXMM[0], &aGuestXmmRegs[0], sizeof(aGuestXmmRegs));
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync#else /* CPUM_CAN_HANDLE_NM_TRAPS_IN_KERNEL_MODE */
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync# error "Fix all the NM_TRAPS_IN_KERNEL_MODE code path. I'm not going to fix unused code now."
e2843ed205192b88e54eef60ad541d00bbbc932avboxsync if (pVCpu->cpum.s.fUseFlags & CPUM_MANUAL_XMM_RESTORE)
return VINF_SUCCESS;
#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
if (fDR6)
return VINF_SUCCESS;
#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
if (fDR6)
return VINF_SUCCESS;
AssertCompile((uintptr_t)&pVCpu->cpum.s.Host.dr3 - (uintptr_t)&pVCpu->cpum.s.Host.dr0 == sizeof(uint64_t) * 3);
return VINF_SUCCESS;
AssertCompile((uintptr_t)&pVCpu->cpum.s.Host.dr3 - (uintptr_t)&pVCpu->cpum.s.Host.dr0 == sizeof(uint64_t) * 3);
return VINF_SUCCESS;
#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
AssertFailed();
return VERR_NOT_IMPLEMENTED;
AssertFailed();
return VERR_NOT_IMPLEMENTED;
if (fDR6)
return VINF_SUCCESS;
static int cpumR0MapLocalApics(void)
LogRel(("CPUM: Too many real CPUs/cores/threads - %u, max %u\n", RTMpGetArraySize(), RT_ELEMENTS(g_aLApics)));
return VERR_TOO_MANY_CPUS;
return rc;
return VINF_SUCCESS;
static void cpumR0UnmapLocalApics(void)