VirtualBox

Ignore:
Timestamp:
May 30, 2017 7:58:21 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
115808
Message:

HostDrivers/Support, VMM: bugref:8864: On Linux 4.12 the GDT is mapped read-only. The writable-mapped GDT is available and is used for clearing the TSS BUSY descriptor bit and for LTR.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp

    r66581 r67136  
    199199    { "SUPR0SuspendVTxOnCpu",                   (void *)(uintptr_t)SUPR0SuspendVTxOnCpu },
    200200    { "SUPR0ResumeVTxOnCpu",                    (void *)(uintptr_t)SUPR0ResumeVTxOnCpu },
     201    { "SUPR0GetCurrentGdtRw",                   (void *)(uintptr_t)SUPR0GetCurrentGdtRw },
    201202    { "SUPR0GetKernelFeatures",                 (void *)(uintptr_t)SUPR0GetKernelFeatures },
    202203    { "SUPR0GetPagingMode",                     (void *)(uintptr_t)SUPR0GetPagingMode },
     
    38773878
    38783879
     3880SUPR0DECL(int) SUPR0GetCurrentGdtRw(RTHCUINTPTR *pGdtRw)
     3881{
     3882#ifdef RT_OS_LINUX
     3883    return supdrvOSetCurrentGdtRw(pGdtRw);
     3884#else
     3885    return VERR_NOT_IMPLEMENTED;
     3886#endif
     3887}
     3888
     3889
    38793890/**
    38803891 * Checks if Intel VT-x feature is usable on this CPU.
  • trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h

    r64872 r67136  
    842842bool VBOXCALL   supdrvOSSuspendVTxOnCpu(void);
    843843void VBOXCALL   supdrvOSResumeVTxOnCpu(bool fSuspended);
     844int  VBOXCALL   supdrvOSetCurrentGdtRw(RTHCUINTPTR *pGdtRw);
    844845
    845846/**
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r62694 r67136  
    6161# include <asm/msr.h>
    6262#endif
     63
     64#include <asm/desc.h>
    6365
    6466#include <iprt/asm-amd64-x86.h>
     
    14011403    fFlags |= SUPKERNELFEATURES_GDT_READ_ONLY;
    14021404#endif
     1405#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
     1406    fFlags |= SUPKERNELFEATURES_GDT_NEED_WRITABLE;
     1407#endif
    14031408#if defined(VBOX_STRICT) || defined(VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV)
    14041409    fFlags |= SUPKERNELFEATURES_SMAP;
     
    14111416
    14121417
     1418int supdrvOSetCurrentGdtRw(RTHCUINTPTR *pGdtRw)
     1419{
     1420#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
     1421    *pGdtRw = (RTHCUINTPTR)get_current_gdt_rw();
     1422    return VINF_SUCCESS;
     1423#else
     1424    return VERR_NOT_IMPLEMENTED;
     1425#endif
     1426}
     1427
     1428
    14131429module_init(VBoxDrvLinuxInit);
    14141430module_exit(VBoxDrvLinuxUnload);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette