Changeset 14771 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Nov 28, 2008 11:07:18 AM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMSwitcher.cpp
r14768 r14771 55 55 &vmmR3Switcher32BitTo32Bit_Def, 56 56 &vmmR3Switcher32BitToPAE_Def, 57 NULL, //&vmmR3Switcher32BitToAMD64_Def - disabled because it causes assertions.57 &vmmR3Switcher32BitToAMD64_Def, 58 58 &vmmR3SwitcherPAETo32Bit_Def, 59 59 &vmmR3SwitcherPAEToPAE_Def, 60 NULL, //&vmmR3SwitcherPAEToAMD64_Def - disabled because it causes assertions.60 &vmmR3SwitcherPAEToAMD64_Def, 61 61 NULL, //&vmmR3SwitcherPAETo32Bit_Def, 62 62 # ifdef VBOX_WITH_HYBIRD_32BIT_KERNEL … … 348 348 case FIX_GC_2_ID_NEAR_REL: 349 349 { 350 Assert (offSrc - pSwitcher->offGCCode < pSwitcher->cbGCCode);350 AssertMsg(offSrc - pSwitcher->offGCCode < pSwitcher->cbGCCode, ("%x - %x < %x\n", offSrc, pSwitcher->offGCCode, pSwitcher->cbGCCode)); 351 351 uint32_t offTrg = *u.pu32++; 352 352 Assert(offTrg - pSwitcher->offIDCode0 < pSwitcher->cbIDCode0 || offTrg - pSwitcher->offIDCode1 < pSwitcher->cbIDCode1); … … 610 610 #if defined(RT_ARCH_AMD64) || defined(VBOX_WITH_HYBIRD_32BIT_KERNEL) 611 611 /* 612 * 64-bit HC pointer fixup to (HC) target within the code (32-bit offset).613 */614 case FIX_HC_64BIT:615 {616 uint32_t offTrg = *u.pu32++;617 Assert(offSrc < pSwitcher->cbCode);618 Assert(offTrg - pSwitcher->offHCCode0 < pSwitcher->cbHCCode0 || offTrg - pSwitcher->offHCCode1 < pSwitcher->cbHCCode1);619 *uSrc.pu64 = R0PtrCode + offTrg;620 break;621 }622 623 /*624 612 * 64-bit HC Code Selector (no argument). 625 613 */ … … 636 624 #endif 637 625 /* 626 * 64-bit HC pointer fixup to (HC) target within the code (32-bit offset). 627 */ 628 case FIX_HC_64BIT: 629 { 630 uint32_t offTrg = *u.pu32++; 631 Assert(offSrc < pSwitcher->cbCode); 632 Assert(offTrg - pSwitcher->offHCCode0 < pSwitcher->cbHCCode0 || offTrg - pSwitcher->offHCCode1 < pSwitcher->cbHCCode1); 633 *uSrc.pu64 = R0PtrCode + offTrg; 634 break; 635 } 636 637 /* 638 638 * 64-bit HC pointer to the CPUM instance data (no argument). 639 639 */ … … 661 661 */ 662 662 case FIX_ID_64BIT: 663 case FIX_HC_64BIT_NOCHECK: 663 664 { 664 665 uint32_t offTrg = *u.pu32++; 665 666 Assert(offSrc < pSwitcher->cbCode); 666 Assert( offTrg - pSwitcher->offIDCode0 < pSwitcher->cbIDCode0 || offTrg - pSwitcher->offIDCode1 < pSwitcher->cbIDCode1);667 Assert(u8 == FIX_HC_64BIT_NOCHECK || offTrg - pSwitcher->offIDCode0 < pSwitcher->cbIDCode0 || offTrg - pSwitcher->offIDCode1 < pSwitcher->cbIDCode1); 667 668 *uSrc.pu64 = u32IDCode + offTrg; 668 669 break; … … 883 884 } 884 885 886 /** 887 * Relocator for the PAE to AMD64 world switcher. 888 */ 889 DECLCALLBACK(void) vmmR3SwitcherPAEToAMD64_Relocate(PVM pVM, PVMMSWITCHERDEF pSwitcher, RTR0PTR R0PtrCode, uint8_t *pu8CodeR3, RTGCPTR GCPtrCode, uint32_t u32IDCode) 890 { 891 vmmR3SwitcherGenericRelocate(pVM, pSwitcher, R0PtrCode, pu8CodeR3, GCPtrCode, u32IDCode, 892 SELMGetHyperCS(pVM), SELMGetHyperDS(pVM), SELMGetHyperTSS(pVM), SELMGetHyperGDT(pVM), SELMGetHyperCS64(pVM)); 893 } 894 885 895 886 896 /** -
trunk/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac
r14767 r14771 171 171 ;; Jump to identity mapped location 172 172 ;; 173 FIXUP FIX_ GC_2_ID_NEAR_REL, 1, NAME(IDEnterTarget) - NAME(Start)173 FIXUP FIX_HC_2_ID_NEAR_REL, 1, NAME(IDEnterTarget) - NAME(Start) 174 174 jmp near NAME(IDEnterTarget) 175 175 … … 225 225 ; 64-bit jump target 226 226 NAME(pICEnterTarget): 227 FIXUP FIX_HC_64BIT , 0, NAME(ICEnterTarget) - NAME(Start)227 FIXUP FIX_HC_64BIT_NOCHECK, 0, NAME(ICEnterTarget) - NAME(Start) 228 228 dq 0ffffffffffffffffh 229 229 … … 327 327 mov cr3, rax 328 328 ;; We're now in the intermediate memory context! 329 330 ;; 331 ;; Switch to compatibility mode, placing ourselves in identity mapped code. 332 ;; 333 jmp far [NAME(fpIDEnterTarget) wrt rip] 334 335 ; 16:32 Pointer to IDEnterTarget. 336 NAME(fpIDEnterTarget): 337 FIXUP FIX_ID_32BIT, 0, NAME(IDExitTarget) - NAME(Start) 338 dd 0 339 FIXUP FIX_HYPER_CS, 0 340 dd 0 329 341 330 ;;331 ;; Jump to identity mapped location332 ;;333 FIXUP FIX_GC_2_ID_NEAR_REL, 1, NAME(IDExitTarget) - NAME(Start)334 jmp near NAME(IDExitTarget)335 336 342 ; We're now on identity mapped pages! 337 343 ALIGNCODE(16) … … 378 384 ;; 5. Jump to guest code mapping of the code and load the Hypervisor CS. 379 385 ;; 380 FIXUP FIX_ID_2_ GC_NEAR_REL, 1, NAME(ICExitTarget) - NAME(Start)386 FIXUP FIX_ID_2_HC_NEAR_REL, 1, NAME(ICExitTarget) - NAME(Start) 381 387 jmp near NAME(ICExitTarget) 382 388 … … 589 595 at VMMSWITCHERDEF.cbIDCode0, dd NAME(ICEnterTarget) - NAME(IDEnterTarget) 590 596 at VMMSWITCHERDEF.offIDCode1, dd NAME(IDExitTarget) - NAME(Start) 591 at VMMSWITCHERDEF.cbIDCode1, dd NAME(ICExitTarget) - NAME( IDExitTarget)592 at VMMSWITCHERDEF.offGCCode, dd NAME(ICEnterTarget) - NAME(Start)593 at VMMSWITCHERDEF.cbGCCode, dd NAME(IDExitTarget) - NAME(ICEnterTarget)597 at VMMSWITCHERDEF.cbIDCode1, dd NAME(ICExitTarget) - NAME(Start) 598 at VMMSWITCHERDEF.offGCCode, dd 0 599 at VMMSWITCHERDEF.cbGCCode, dd 0 594 600 595 601 iend -
trunk/src/VBox/VMM/VMMSwitcher/VMMSwitcher.h
r14167 r14771 63 63 #define FIX_ID_FAR32_TO_64BIT_MODE 33 64 64 #define FIX_GC_APIC_BASE_32BIT 34 65 #define FIX_HC_64BIT_NOCHECK 35 65 66 #define FIX_THE_END 255 66 67 /** @} */ -
trunk/src/VBox/VMM/VMMSwitcher/VMMSwitcher.mac
r14167 r14771 107 107 %define FIX_ID_FAR32_TO_64BIT_MODE 33 108 108 %define FIX_GC_APIC_BASE_32BIT 34 109 %define FIX_HC_64BIT_NOCHECK 35 109 110 %define FIX_THE_END 255 110 111 ;/** @} */
Note:
See TracChangeset
for help on using the changeset viewer.