VirtualBox

Changeset 48249 in vbox for trunk/src


Ignore:
Timestamp:
Sep 3, 2013 2:16:05 PM (11 years ago)
Author:
vboxsync
Message:

LegacyandAMD64.asm: Sanitize CR4 before loading the intermediate context into CR3 (from host) . This should hopefully fix the occational triple faults on windows 7.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac

    r48243 r48249  
    429429    mov     eax, cr3
    430430    mov     [edx + CPUMCPU.Host.cr3], eax
    431     mov     eax, cr4
    432     mov     [edx + CPUMCPU.Host.cr4], eax
    433 %if 0 ; paranoia
    434     test    eax, X86_CR4_VMXE
    435     jz      .vmxe_fine
    436     mov     eax, VERR_VMX_IN_VMX_ROOT_MODE
    437     retf
    438 .vmxe_fine:
    439 %endif
     431    mov     esi, cr4                      ; esi = cr4, we'll modify it further down.
     432    mov     [edx + CPUMCPU.Host.cr4], esi
    440433
    441434    DEBUG32_S_CHAR('c')
     
    467460
    468461    ;;
     462    ;; Clean up CR4.  X86_CR4_PGE, X86_CR4_PCE, X86_CR4_PCIDE (not really
     463    ;; relevant for 32-bit, but whatever) and X86_CR4_VMXE must be cleared.
     464    ;;
     465    and     esi, X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD | X86_CR4_DE | X86_CR4_PSE | X86_CR4_PAE \
     466               | X86_CR4_MCE | X86_CR4_OSFSXR | X86_CR4_OSXMMEEXCPT | X86_CR4_SMXE | X86_CR4_OSXSAVE
     467    mov     cr4, esi
     468
     469    ;;
    469470    ;; Load Intermediate memory context.
    470471    ;;
     
    475476%ifdef VBOX_WITH_64ON32_CMOS_DEBUG
    476477    DEBUG_CMOS_TRASH_AL 17h
    477     jmp     .first_jmp
    478     times 65 db 90h
    479 .first_jmp:
    480     times 65 db 90h
    481 .second_jmp:
    482     DEBUG_CMOS_TRASH_AL 18h
    483478%endif
    484479
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