VirtualBox

Changeset 14805 in vbox for trunk


Ignore:
Timestamp:
Nov 29, 2008 3:24:36 AM (16 years ago)
Author:
vboxsync
Message:

#3202: Use SUPR0Abs*.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/sup.h

    r14798 r14805  
    844844SUPR0DECL(int) SUPR0NativeEnableHwVirtExt(PSUPDRVSESSION pSession, bool fEnable);
    845845
     846/** @name Absolute symbols
     847 * Take the address of these, don't try call them.
     848 * @{ */
     849SUPR0DECL(void) SUPR0AbsIs64bit(void);
     850SUPR0DECL(void) SUPR0Abs64bitKernelCS(void);
     851SUPR0DECL(void) SUPR0Abs64bitKernelSS(void);
     852SUPR0DECL(void) SUPR0Abs64bitKernelDS(void);
     853SUPR0DECL(void) SUPR0AbsKernelCS(void);
     854SUPR0DECL(void) SUPR0AbsKernelSS(void);
     855SUPR0DECL(void) SUPR0AbsKernelDS(void);
     856SUPR0DECL(void) SUPR0AbsKernelES(void);
     857SUPR0DECL(void) SUPR0AbsKernelFS(void);
     858SUPR0DECL(void) SUPR0AbsKernelGS(void);
     859/** @} */
    846860
    847861/**
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r14804 r14805  
    824824
    825825        /* Selector registers. */
     826#ifdef VBOX_WITH_HYBIRD_32BIT_KERNEL
     827        if (VMX_IS_64BIT_HOST_MODE())
     828        {
     829            cs = (RTSEL)(uintptr_t)&SUPR0Abs64bitKernelCS;
     830            ss = (RTSEL)(uintptr_t)&SUPR0Abs64bitKernelSS;
     831        }
     832        else
     833        {
     834            /* sysenter loads LDT cs & ss, VMX doesn't like this. Load the GDT ones (safe). */
     835            cs = (RTSEL)(uintptr_t)&SUPR0AbsKernelCS;
     836            ss = (RTSEL)(uintptr_t)&SUPR0AbsKernelSS;
     837        }
     838#else
    826839        cs = ASMGetCS();
    827840        ss = ASMGetSS();
    828 #ifdef RT_OS_DARWIN
    829         /* VMX doesn't like LDT cs and ss, so switch to the GDT ones. Weird kernel. */
    830         if (cs == 0x04)                 /* SYSENTER_CS & ~3 */
    831             cs = 0x08;                  /* KERNEL_CS */
    832         if (ss == 0x0c)                 /* (SYSENTER_CS & ~3) + 8 */
    833             ss = 0x10;                  /* KERNEL_DS */
    834         if (VMX_IS_64BIT_HOST_MODE())
    835         {
    836             cs = 0x80;                  /* KERNEL64_CS - fixme */
    837             ss = 0x88;                  /* KERNEL64_CS - fixme */
    838         }
    839841#endif
    840842        rc  = VMXWriteVMCS(VMX_VMCS16_HOST_FIELD_CS,          cs);
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