VirtualBox

Changeset 34991 in vbox


Ignore:
Timestamp:
Dec 13, 2010 11:20:04 AM (14 years ago)
Author:
vboxsync
Message:

VMMSwitcher/PAEand32Bit,LegacyandAMD64: restore the Local APIC NMI vectors _after_ we restored the host CS

Location:
trunk/src/VBox/VMM/VMMSwitcher
Files:
2 edited

Legend:

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

    r33935 r34991  
    5757;
    5858BEGINPROC vmmR0HostToGuest
    59  %ifdef DEBUG_STUFF
     59%ifdef DEBUG_STUFF
    6060    COM32_S_NEWLINE
    6161    COM32_S_CHAR '^'
    62  %endif
    63 
    64  %ifdef VBOX_WITH_STATISTICS
     62%endif
     63
     64%ifdef VBOX_WITH_STATISTICS
    6565    ;
    6666    ; Switcher stats.
     
    6969    mov     edx, 0ffffffffh
    7070    STAM_PROFILE_ADV_START edx
    71  %endif
     71%endif
    7272
    7373    push    ebp
     
    8585    push    cs                          ; allow for far return and restore cs correctly.
    8686    call    NAME(vmmR0HostToGuestAsm)
     87
     88%ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
     89    CPUM_FROM_CPUMCPU(edx)
     90    ; Restore blocked Local APIC NMI vectors
     91    mov     ecx, [edx + CPUM.fApicDisVectors]
     92    mov     edx, [edx + CPUM.pvApicBase]
     93    shr     ecx, 1
     94    jnc     gth_nolint0
     95    and     dword [edx + APIC_REG_LVT_LINT0], ~APIC_REG_LVT_MASKED
     96gth_nolint0:
     97    shr     ecx, 1
     98    jnc     gth_nolint1
     99    and     dword [edx + APIC_REG_LVT_LINT1], ~APIC_REG_LVT_MASKED
     100gth_nolint1:
     101    shr     ecx, 1
     102    jnc     gth_nopc
     103    and     dword [edx + APIC_REG_LVT_PC], ~APIC_REG_LVT_MASKED
     104gth_nopc:
     105    shr     ecx, 1
     106    jnc     gth_notherm
     107    and     dword [edx + APIC_REG_LVT_THMR], ~APIC_REG_LVT_MASKED
     108gth_notherm:
     109%endif
    87110
    88111    ; restore original flags
     
    626649    ;mov     cr2, ecx
    627650
    628 %ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
    629     ; Restore blocked Local APIC NMI vectors
    630     CPUM_FROM_CPUMCPU_WITH_OFFSET edx, ebp
    631     mov     ebx, [edx + CPUM.pvApicBase]
    632     mov     ecx, [edx + CPUM.fApicDisVectors]
    633     CPUMCPU_FROM_CPUM_WITH_OFFSET edx, ebp
    634     shr     ecx, 1
    635     jnc     gth_nolint0
    636     and     dword [ebx + APIC_REG_LVT_LINT0], ~APIC_REG_LVT_MASKED
    637 gth_nolint0:
    638     shr     ecx, 1
    639     jnc     gth_nolint1
    640     and     dword [ebx + APIC_REG_LVT_LINT1], ~APIC_REG_LVT_MASKED
    641 gth_nolint1:
    642     shr     ecx, 1
    643     jnc     gth_nopc
    644     and     dword [ebx + APIC_REG_LVT_PC], ~APIC_REG_LVT_MASKED
    645 gth_nopc:
    646     shr     ecx, 1
    647     jnc     gth_notherm
    648     and     dword [ebx + APIC_REG_LVT_THMR], ~APIC_REG_LVT_MASKED
    649 gth_notherm:
    650 %endif
    651 
    652651    ; restore general registers.
    653652    mov     edi, [edx + CPUMCPU.Host.edi]
  • trunk/src/VBox/VMM/VMMSwitcher/PAEand32Bit.mac

    r33935 r34991  
    8080    push    cs                          ; allow for far return and restore cs correctly.
    8181    call    NAME(vmmR0HostToGuestAsm)
     82
     83%ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
     84    CPUM_FROM_CPUMCPU(edx)
     85    ; Restore blocked Local APIC NMI vectors
     86    ; Do this here to ensure the host CS is already restored
     87    mov     ecx, [edx + CPUM.fApicDisVectors]
     88    mov     edx, [edx + CPUM.pvApicBase]
     89    shr     ecx, 1
     90    jnc     gth_nolint0
     91    and     dword [edx + APIC_REG_LVT_LINT0], ~APIC_REG_LVT_MASKED
     92gth_nolint0:
     93    shr     ecx, 1
     94    jnc     gth_nolint1
     95    and     dword [edx + APIC_REG_LVT_LINT1], ~APIC_REG_LVT_MASKED
     96gth_nolint1:
     97    shr     ecx, 1
     98    jnc     gth_nopc
     99    and     dword [edx + APIC_REG_LVT_PC], ~APIC_REG_LVT_MASKED
     100gth_nopc:
     101    shr     ecx, 1
     102    jnc     gth_notherm
     103    and     dword [edx + APIC_REG_LVT_THMR], ~APIC_REG_LVT_MASKED
     104gth_notherm:
     105%endif
    82106
    83107%ifdef VBOX_WITH_STATISTICS
     
    9941018gth_debug_regs_no:
    9951019
    996 %ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
    997     mov     esi, edx
    998     CPUM_FROM_CPUMCPU(edx)
    999     ; Restore blocked Local APIC NMI vectors
    1000     mov     ebx, [edx + CPUM.pvApicBase]
    1001     mov     ecx, [edx + CPUM.fApicDisVectors]
    1002     mov     edx, esi
    1003     shr     ecx, 1
    1004     jnc     gth_nolint0
    1005     and     dword [ebx + APIC_REG_LVT_LINT0], ~APIC_REG_LVT_MASKED
    1006 gth_nolint0:
    1007     shr     ecx, 1
    1008     jnc     gth_nolint1
    1009     and     dword [ebx + APIC_REG_LVT_LINT1], ~APIC_REG_LVT_MASKED
    1010 gth_nolint1:
    1011     shr     ecx, 1
    1012     jnc     gth_nopc
    1013     and     dword [ebx + APIC_REG_LVT_PC], ~APIC_REG_LVT_MASKED
    1014 gth_nopc:
    1015     shr     ecx, 1
    1016     jnc     gth_notherm
    1017     and     dword [ebx + APIC_REG_LVT_THMR], ~APIC_REG_LVT_MASKED
    1018 gth_notherm:
    1019 %endif
    1020 
    10211020    ; restore general registers.
    10221021    mov     eax, edi                    ; restore return code. eax = return code !!
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