VirtualBox

Changeset 9212 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
May 29, 2008 9:38:38 AM (17 years ago)
Author:
vboxsync
Message:

Major changes for sizeof(RTGCPTR) == uint64_t.
Introduced RCPTRTYPE for pointers valid in raw mode only (RTGCPTR32).

Disabled by default. Enable by adding VBOX_WITH_64_BITS_GUESTS to your LocalConfig.kmk.

Location:
trunk/src/VBox/VMM/VMMR0
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/DBGFR0.cpp

    r8155 r9212  
    4545 * @param   uDr6        The DR6 register value.
    4646 */
    47 DBGFR0DECL(int) DBGFR0Trap01Handler(PVM pVM, PCPUMCTXCORE pRegFrame, RTUINTREG uDr6)
     47DBGFR0DECL(int) DBGFR0Trap01Handler(PVM pVM, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6)
    4848{
    4949    /** @todo Intel docs say that X86_DR6_BS has the highest priority... */
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r9188 r9212  
    681681    pVMCB->guest.u64RAX    = pCtx->eax;
    682682
    683     /* vmrun will fail otherwise. */
    684     pVMCB->guest.u64EFER   = MSR_K6_EFER_SVME;
     683    /* vmrun will fail without MSR_K6_EFER_SVME. */
     684    pVMCB->guest.u64EFER   = pCtx->msrEFER | MSR_K6_EFER_SVME;
    685685
    686686    /** TSC offset. */
     
    696696    }
    697697
    698     /** @todo 64 bits stuff (?):
    699      * - STAR
    700      * - LSTAR
    701      * - CSTAR
    702      * - SFMASK
    703      * - KernelGSBase
    704      */
     698    /* Sync the various msrs for 64 bits mode. */
     699    pVMCB->guest.u64STAR            = pCtx->msrSTAR;            /* legacy syscall eip, cs & ss */
     700    pVMCB->guest.u64LSTAR           = pCtx->msrLSTAR;           /* 64 bits mode syscall rip */
     701    pVMCB->guest.u64CSTAR           = pCtx->msrCSTAR;           /* compatibility mode syscall rip */
     702    pVMCB->guest.u64SFMASK          = pCtx->msrSFMASK;          /* syscall flag mask */
     703    pVMCB->guest.u64KernelGSBase    = pCtx->msrKERNELGSBASE;    /* swapgs exchange value */
    705704
    706705#ifdef DEBUG
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r9188 r9212  
    273273    AssertRC(rc);
    274274
    275     /* VMX_VMCS_CTRL_ENTRY_CONTROLS
    276      * Set required bits to one and zero according to the MSR capabilities.
    277      */
    278     val  = (pVM->hwaccm.s.vmx.msr.vmx_entry & 0xFFFFFFFF);
    279     if (pVM->hwaccm.s.cpuid.u32AMDFeatureEDX & X86_CPUID_AMD_FEATURE_EDX_LONG_MODE)
    280     {
    281         /** @todo 32 bits guest mode only for now. */
    282         /* val |= VMX_VMCS_CTRL_ENTRY_CONTROLS_IA64_MODE; */
    283     }
    284     /* Mask away the bits that the CPU doesn't support */
    285     /** @todo make sure they don't conflict with the above requirements. */
    286     val &= (pVM->hwaccm.s.vmx.msr.vmx_entry >> 32ULL);
    287     /* else Must be zero when AMD64 is not available. */
    288     rc = VMXWriteVMCS(VMX_VMCS_CTRL_ENTRY_CONTROLS, val);
    289     AssertRC(rc);
    290 
    291275    /* VMX_VMCS_CTRL_EXIT_CONTROLS
    292276     * Set required bits to one and zero according to the MSR capabilities.
     
    958942        STAM_COUNTER_INC(&pVM->hwaccm.s.StatTSCIntercept);
    959943    }
     944
     945    /* VMX_VMCS_CTRL_ENTRY_CONTROLS
     946     * Set required bits to one and zero according to the MSR capabilities.
     947     */
     948    val = (pVM->hwaccm.s.vmx.msr.vmx_entry & 0xFFFFFFFF);
     949
     950    /* 64 bits guest mode? */
     951    if (pCtx->msrEFER & MSR_K6_EFER_LMA)
     952        val |= VMX_VMCS_CTRL_ENTRY_CONTROLS_IA64_MODE;
     953
     954    /* Mask away the bits that the CPU doesn't support */
     955    /** @todo make sure they don't conflict with the above requirements. */
     956    val &= (pVM->hwaccm.s.vmx.msr.vmx_entry >> 32ULL);
     957    /* else Must be zero when AMD64 is not available. */
     958    rc = VMXWriteVMCS(VMX_VMCS_CTRL_ENTRY_CONTROLS, val);
     959    AssertRC(rc);
    960960
    961961    /* Done. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette