VirtualBox

Changeset 15563 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 16, 2008 9:25:08 AM (16 years ago)
Author:
vboxsync
Message:

Save and restore the host's EFER msr in the 32->64 switcher.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/CPUMInternal.h

    r15417 r15563  
    189189    CPUMSYSENTER    SysEnter;
    190190
     191    /** MSRs
     192     * @{ */
     193    uint64_t        efer;
     194    /** @} */
     195
    191196    /* padding to get 64byte aligned size */
    192     uint8_t         auPadding[24+32];
     197    uint8_t         auPadding[16+32];
    193198
    194199#elif HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
  • trunk/src/VBox/VMM/CPUMInternal.mac

    r15414 r15563  
    272272    .Host.SysEnter.eip   resq    1
    273273    .Host.SysEnter.esp   resq    1
     274    .Host.efer           resq    1
    274275
    275276%else ; 64-bit
  • trunk/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac

    r15392 r15563  
    145145    mov     [edx + CPUMCPU.Host.cr4], eax
    146146
     147    ; save the host EFER msr
     148    mov     ebx, edx
     149    mov     ecx, MSR_K6_EFER
     150    rdmsr
     151    mov     [ebx + CPUMCPU.Host.efer], eax
     152    mov     [ebx + CPUMCPU.Host.efer + 4], edx
     153    mov     edx, ebx
     154
    147155    CPUM_FROM_CPUMCPU(edx)
    148156    ; Load new gdt so we can do a far jump after going into 64 bits mode
     
    440448    CPUMCPU_FROM_CPUM(edx)
    441449
    442        
     450    ; restore the host EFER
     451    mov     ebx, edx
     452    mov     ecx, MSR_K6_EFER
     453    mov     eax, [ebx + CPUMCPU.Host.efer]
     454    mov     edx, [ebx + CPUMCPU.Host.efer + 4]
     455    wrmsr
     456    mov     edx, ebx
     457   
    443458    ; activate host gdt and idt
    444459    lgdt    [edx + CPUMCPU.Host.gdtr]
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