Changeset 18851 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Apr 8, 2009 5:31:06 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWACCMR0A.asm
r15415 r18851 54 54 %ifdef VBOX_WITH_HYBRID_32BIT_KERNEL 55 55 %define MAYBE_64_BIT 56 %else 57 %ifdef RT_OS_DARWIN 58 %ifdef RT_ARCH_AMD64 59 ;; 60 ; Load the NULL selector into DS, ES, FS and GS on 64-bit darwin so we don't 61 ; risk loading a stale LDT value or something invalid. 62 %define HWACCM_64_BIT_USE_NULL_SEL 63 %endif 64 %endif 56 65 %endif 57 66 … … 148 157 ; trashes, rax, rdx & rcx 149 158 %macro MYPUSHSEGS64 2 159 %ifndef HWACCM_64_BIT_USE_NULL_SEL 150 160 mov %2, es 151 161 push %1 152 162 mov %2, ds 153 163 push %1 164 %endif 154 165 155 166 ; Special case for FS; Windows and Linux either don't use it or restore it when leaving kernel mode, Solaris OTOH doesn't and we must save it. … … 158 169 push rdx 159 170 push rax 171 %ifndef HWACCM_64_BIT_USE_NULL_SEL 160 172 push fs 173 %endif 161 174 162 175 ; Special case for GS; OSes typically use swapgs to reset the hidden base register for GS on entry into the kernel. The same happens on exit … … 165 178 push rdx 166 179 push rax 180 %ifndef HWACCM_64_BIT_USE_NULL_SEL 167 181 push gs 182 %endif 168 183 %endmacro 169 184 … … 171 186 %macro MYPOPSEGS64 2 172 187 ; Note: do not step through this code with a debugger! 188 %ifndef HWACCM_64_BIT_USE_NULL_SEL 189 xor eax, eax 190 mov ds, ax 191 mov es, ax 192 mov fs, ax 193 mov gs, ax 194 %endif 195 196 %ifndef HWACCM_64_BIT_USE_NULL_SEL 173 197 pop gs 198 %endif 174 199 pop rax 175 200 pop rdx … … 177 202 wrmsr 178 203 204 %ifndef HWACCM_64_BIT_USE_NULL_SEL 179 205 pop fs 206 %endif 180 207 pop rax 181 208 pop rdx … … 184 211 ; Now it's safe to step again 185 212 213 %ifndef HWACCM_64_BIT_USE_NULL_SEL 186 214 pop %1 187 215 mov ds, %2 188 216 pop %1 189 217 mov es, %2 218 %endif 190 219 %endmacro 191 220
Note:
See TracChangeset
for help on using the changeset viewer.