Changeset 49019 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Oct 10, 2013 8:45:11 AM (11 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/CPUMAllA.asm
r48673 r49019 38 38 39 39 BEGINCODE 40 41 ;; Macro for FXSAVE/FXRSTOR leaky behaviour on AMD CPUs, see cpumR3CheckLeakyFpu(). 42 ; Cleans the FPU state, if necessary, before restoring the FPU. 43 ; 44 ; This macro ASSUMES CR0.TS is not set! 45 ; @remarks Trashes xAX!! 46 ; Changes here should also be reflected in CPUMR0A.asm's copy! 47 %macro CLEANFPU 0 48 test dword [xDX + CPUMCPU.fUseFlags], CPUM_USE_FFXSR_LEAKY 49 jz .nothing_to_clean 50 51 xor eax, eax 52 fnstsw ax ; Get FSW 53 test eax, RT_BIT(7) ; If FSW.ES (bit 7) is set, clear it to not cause FPU exceptions 54 ; while clearing & loading the FPU bits in 'clean_fpu' 55 jz clean_fpu 56 fnclex 57 58 .clean_fpu: 59 ffree st7 ; Clear FPU stack register(7)'s tag entry to prevent overflow if a wraparound occurs 60 ; for the upcoming push (load) 61 fild dword [xDX + CPUMCPU.Guest.fpu] ; Explicit FPU load to overwrite FIP, FOP, FDP registers in the FPU. 62 63 .nothing_to_clean: 64 %endmacro 65 40 66 41 67 ;; … … 172 198 173 199 ; Load new CR0 value. 174 ; IN_RING0 the caller saves/restores CR0 anyway, so avoid the extra CR0 write.175 ; Currently the only caller in ring-0 is CPUMR0LoadGuestFPU()->CPUMHandleLazyFPU().176 200 ;; @todo Optimize the many unconditional CR0 writes. 177 %if def IN_RC201 %ifndef IN_RING3 178 202 mov cr0, xCX ; load the new cr0 flags. 179 203 %endif -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r48697 r49019 3090 3090 } 3091 3091 3092 #if ndef IN_RING33092 #ifdef IN_RC 3093 3093 3094 3094 /** … … 3103 3103 } 3104 3104 3105 #endif /* !IN_R ING3*/3105 #endif /* !IN_RC */ 3106 3106 3107 3107 /**
Note:
See TracChangeset
for help on using the changeset viewer.