Changeset 57446 in vbox for trunk/src/VBox/VMM/VMMR0/CPUMR0.cpp
- Timestamp:
- Aug 18, 2015 5:33:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/CPUMR0.cpp
r57358 r57446 256 256 { 257 257 #ifdef RT_ARCH_X86 258 # ifdef VBOX_WITH_HYBRID_32BIT_KERNEL259 if (fExtFeaturesEDX & X86_CPUID_EXT_FEATURE_EDX_LONG_MODE)260 # else261 258 if (!ASMIsIntelCpu()) 262 # endif263 259 #endif 264 260 { … … 400 396 { 401 397 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 402 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)398 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) 403 399 if (CPUMIsGuestInLongModeEx(pCtx)) 404 400 { … … 464 460 NOREF(pVM); NOREF(pCtx); 465 461 466 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)462 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) 467 463 if (CPUMIsGuestInLongModeEx(pCtx)) 468 464 { … … 531 527 * Save the host state. 532 528 */ 533 #ifdef VBOX_WITH_HYBRID_32BIT_KERNEL534 AssertCompile((uintptr_t)&pVCpu->cpum.s.Host.dr3 - (uintptr_t)&pVCpu->cpum.s.Host.dr0 == sizeof(uint64_t) * 3);535 cpumR0SaveDRx(&pVCpu->cpum.s.Host.dr0);536 #else537 529 pVCpu->cpum.s.Host.dr0 = ASMGetDR0(); 538 530 pVCpu->cpum.s.Host.dr1 = ASMGetDR1(); 539 531 pVCpu->cpum.s.Host.dr2 = ASMGetDR2(); 540 532 pVCpu->cpum.s.Host.dr3 = ASMGetDR3(); 541 #endif542 533 pVCpu->cpum.s.Host.dr6 = ASMGetDR6(); 543 534 /** @todo dr7 might already have been changed to 0x400; don't care right now as it's harmless. */ … … 583 574 if (pVCpu->cpum.s.fUseFlags & CPUM_USED_DEBUG_REGS_GUEST) 584 575 { 585 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)576 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) 586 577 if (CPUMIsGuestInLongModeEx(&pVCpu->cpum.s.Guest)) 587 578 { … … 594 585 #endif 595 586 { 596 #ifdef VBOX_WITH_HYBRID_32BIT_KERNEL597 cpumR0SaveDRx(&pVCpu->cpum.s.Guest.dr[0]);598 #else599 587 pVCpu->cpum.s.Guest.dr[0] = ASMGetDR0(); 600 588 pVCpu->cpum.s.Guest.dr[1] = ASMGetDR1(); 601 589 pVCpu->cpum.s.Guest.dr[2] = ASMGetDR2(); 602 590 pVCpu->cpum.s.Guest.dr[3] = ASMGetDR3(); 603 #endif604 591 if (fDr6) 605 592 pVCpu->cpum.s.Guest.dr[6] = ASMGetDR6(); … … 619 606 ASMSetDR7(X86_DR7_INIT_VAL); 620 607 621 #ifdef VBOX_WITH_HYBRID_32BIT_KERNEL622 AssertCompile((uintptr_t)&pVCpu->cpum.s.Host.dr3 - (uintptr_t)&pVCpu->cpum.s.Host.dr0 == sizeof(uint64_t) * 3);623 cpumR0LoadDRx(&pVCpu->cpum.s.Host.dr0);624 #else625 608 ASMSetDR0(pVCpu->cpum.s.Host.dr0); 626 609 ASMSetDR1(pVCpu->cpum.s.Host.dr1); 627 610 ASMSetDR2(pVCpu->cpum.s.Host.dr2); 628 611 ASMSetDR3(pVCpu->cpum.s.Host.dr3); 629 #endif630 612 /** @todo consider only updating if they differ, esp. DR6. Need to figure how 631 613 * expensive DRx reads are over DRx writes. */ … … 660 642 if (pVCpu->cpum.s.fUseFlags & CPUM_USED_DEBUG_REGS_GUEST) 661 643 { 662 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)644 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) 663 645 if (CPUMIsGuestInLongModeEx(&pVCpu->cpum.s.Guest)) 664 646 { … … 671 653 #endif 672 654 { 673 #ifdef VBOX_WITH_HYBRID_32BIT_KERNEL674 cpumR0SaveDRx(&pVCpu->cpum.s.Guest.dr[0]);675 #else676 655 pVCpu->cpum.s.Guest.dr[0] = ASMGetDR0(); 677 656 pVCpu->cpum.s.Guest.dr[1] = ASMGetDR1(); 678 657 pVCpu->cpum.s.Guest.dr[2] = ASMGetDR2(); 679 658 pVCpu->cpum.s.Guest.dr[3] = ASMGetDR3(); 680 #endif681 659 if (fDr6) 682 660 pVCpu->cpum.s.Guest.dr[6] = ASMGetDR6(); … … 707 685 * DR7 and DR6 (if fDr6 is true) are left to the caller. 708 686 */ 709 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)687 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) 710 688 if (CPUMIsGuestInLongModeEx(&pVCpu->cpum.s.Guest)) 711 689 ASMAtomicOrU32(&pVCpu->cpum.s.fUseFlags, CPUM_SYNC_DEBUG_REGS_GUEST); /* Postpone it to the world switch. */ … … 713 691 #endif 714 692 { 715 #ifdef VBOX_WITH_HYBRID_32BIT_KERNEL716 cpumR0LoadDRx(&pVCpu->cpum.s.Guest.dr[0]);717 #else718 693 ASMSetDR0(pVCpu->cpum.s.Guest.dr[0]); 719 694 ASMSetDR1(pVCpu->cpum.s.Guest.dr[1]); 720 695 ASMSetDR2(pVCpu->cpum.s.Guest.dr[2]); 721 696 ASMSetDR3(pVCpu->cpum.s.Guest.dr[3]); 722 #endif723 697 if (fDr6) 724 698 ASMSetDR6(pVCpu->cpum.s.Guest.dr[6]); … … 754 728 * DR7 and DR6 (if fDr6 is true) are left to the caller. 755 729 */ 756 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)730 #if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) 757 731 if (CPUMIsGuestInLongModeEx(&pVCpu->cpum.s.Guest)) 758 732 ASMAtomicOrU32(&pVCpu->cpum.s.fUseFlags, CPUM_SYNC_DEBUG_REGS_HYPER); /* Postpone it. */ … … 760 734 #endif 761 735 { 762 #ifdef VBOX_WITH_HYBRID_32BIT_KERNEL763 cpumR0LoadDRx(&pVCpu->cpum.s.Hyper.dr[0]);764 #else765 736 ASMSetDR0(pVCpu->cpum.s.Hyper.dr[0]); 766 737 ASMSetDR1(pVCpu->cpum.s.Hyper.dr[1]); 767 738 ASMSetDR2(pVCpu->cpum.s.Hyper.dr[2]); 768 739 ASMSetDR3(pVCpu->cpum.s.Hyper.dr[3]); 769 #endif770 740 if (fDr6) 771 741 ASMSetDR6(X86_DR6_INIT_VAL);
Note:
See TracChangeset
for help on using the changeset viewer.