diff --git a/src.herb/VirtualBox-6.1.12/include/iprt/memobj.h b/src.loqs/VirtualBox-6.1.12/include/iprt/memobj.h index 2510d8b..4925315 100644 --- a/src.herb/VirtualBox-6.1.12/include/iprt/memobj.h +++ b/src.loqs/VirtualBox-6.1.12/include/iprt/memobj.h @@ -127,7 +127,10 @@ RTR0DECL(int) RTR0MemObjFree(RTR0MEMOBJ MemObj, bool fFreeMappings); * @returns IPRT status code. * @param pMemObj Where to store the ring-0 memory object handle. * @param cb Number of bytes to allocate. This is rounded up to nearest page. - * @param fExecutable Flag indicating whether it should be permitted to executed code in the memory object. + * @param fExecutable Flag indicating whether it should be permitted to + * executed code in the memory object. The user must + * use RTR0MemObjProtect after initialization the + * allocation to actually make it executable. */ #define RTR0MemObjAllocPage(pMemObj, cb, fExecutable) \ RTR0MemObjAllocPageTag((pMemObj), (cb), (fExecutable), RTMEM_TAG) @@ -140,7 +143,10 @@ RTR0DECL(int) RTR0MemObjFree(RTR0MEMOBJ MemObj, bool fFreeMappings); * @returns IPRT status code. * @param pMemObj Where to store the ring-0 memory object handle. * @param cb Number of bytes to allocate. This is rounded up to nearest page. - * @param fExecutable Flag indicating whether it should be permitted to executed code in the memory object. + * @param fExecutable Flag indicating whether it should be permitted to + * executed code in the memory object. The user must + * use RTR0MemObjProtect after initialization the + * allocation to actually make it executable. * @param pszTag Allocation tag used for statistics and such. */ RTR0DECL(int) RTR0MemObjAllocPageTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag); @@ -154,7 +160,10 @@ RTR0DECL(int) RTR0MemObjAllocPageTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecu * @returns IPRT status code. * @param pMemObj Where to store the ring-0 memory object handle. * @param cb Number of bytes to allocate. This is rounded up to nearest page. - * @param fExecutable Flag indicating whether it should be permitted to executed code in the memory object. + * @param fExecutable Flag indicating whether it should be permitted to + * executed code in the memory object. The user must + * use RTR0MemObjProtect after initialization the + * allocation to actually make it executable. */ #define RTR0MemObjAllocLow(pMemObj, cb, fExecutable) \ RTR0MemObjAllocLowTag((pMemObj), (cb), (fExecutable), RTMEM_TAG) @@ -168,7 +177,10 @@ RTR0DECL(int) RTR0MemObjAllocPageTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecu * @returns IPRT status code. * @param pMemObj Where to store the ring-0 memory object handle. * @param cb Number of bytes to allocate. This is rounded up to nearest page. - * @param fExecutable Flag indicating whether it should be permitted to executed code in the memory object. + * @param fExecutable Flag indicating whether it should be permitted to + * executed code in the memory object. The user must + * use RTR0MemObjProtect after initialization the + * allocation to actually make it executable. * @param pszTag Allocation tag used for statistics and such. */ RTR0DECL(int) RTR0MemObjAllocLowTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag); @@ -182,7 +194,10 @@ RTR0DECL(int) RTR0MemObjAllocLowTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecut * @returns IPRT status code. * @param pMemObj Where to store the ring-0 memory object handle. * @param cb Number of bytes to allocate. This is rounded up to nearest page. - * @param fExecutable Flag indicating whether it should be permitted to executed code in the memory object. + * @param fExecutable Flag indicating whether it should be permitted to + * executed code in the memory object. The user must + * use RTR0MemObjProtect after initialization the + * allocation to actually make it executable. */ #define RTR0MemObjAllocCont(pMemObj, cb, fExecutable) \ RTR0MemObjAllocContTag((pMemObj), (cb), (fExecutable), RTMEM_TAG) @@ -196,7 +211,10 @@ RTR0DECL(int) RTR0MemObjAllocLowTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecut * @returns IPRT status code. * @param pMemObj Where to store the ring-0 memory object handle. * @param cb Number of bytes to allocate. This is rounded up to nearest page. - * @param fExecutable Flag indicating whether it should be permitted to executed code in the memory object. + * @param fExecutable Flag indicating whether it should be permitted to + * executed code in the memory object. The user must + * use RTR0MemObjProtect after initialization the + * allocation to actually make it executable. * @param pszTag Allocation tag used for statistics and such. */ RTR0DECL(int) RTR0MemObjAllocContTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag); diff --git a/src.herb/VirtualBox-6.1.12/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c b/src.loqs/VirtualBox-6.1.12/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c index 2e7aa6e..ba96384 100644 --- a/src.herb/VirtualBox-6.1.12/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c +++ b/src.loqs/VirtualBox-6.1.12/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c @@ -144,9 +144,9 @@ static int force_async_tsc = 0; * Memory for the executable memory heap (in IPRT). */ # ifdef DEBUG -# define EXEC_MEMORY_SIZE 8388608 /* 8 MB */ +# define EXEC_MEMORY_SIZE 10485760 /* 10 MB */ # else -# define EXEC_MEMORY_SIZE 2097152 /* 2 MB */ +# define EXEC_MEMORY_SIZE 8388608 /* 8 MB */ # endif extern uint8_t g_abExecMemory[EXEC_MEMORY_SIZE]; # ifndef VBOX_WITH_TEXT_MODMEM_HACK @@ -756,27 +756,25 @@ EXPORT_SYMBOL(SUPDrvLinuxIDC); RTCCUINTREG VBOXCALL supdrvOSChangeCR4(RTCCUINTREG fOrMask, RTCCUINTREG fAndMask) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) - RTCCUINTREG uOld = this_cpu_read(cpu_tlbstate.cr4); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) + RTCCUINTREG const uOld = __read_cr4(); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0) + RTCCUINTREG const uOld = this_cpu_read(cpu_tlbstate.cr4); #else - RTCCUINTREG uOld = __read_cr4(); + RTCCUINTREG const uOld = ASMGetCR4(); #endif - RTCCUINTREG uNew = (uOld & fAndMask) | fOrMask; + RTCCUINTREG const uNew = (uOld & fAndMask) | fOrMask; if (uNew != uOld) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) + ASMSetCR4(uNew); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0) this_cpu_write(cpu_tlbstate.cr4, uNew); __write_cr4(uNew); -#endif - ASMSetCR4(uNew); - } #else - RTCCUINTREG uOld = ASMGetCR4(); - RTCCUINTREG uNew = (uOld & fAndMask) | fOrMask; - if (uNew != uOld) ASMSetCR4(uNew); #endif + } return uOld; } diff --git a/src.herb/VirtualBox-6.1.12/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c b/src.loqs/VirtualBox-6.1.12/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c index 5f6bf73..4b842a9 100644 --- a/src.herb/VirtualBox-6.1.12/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c +++ b/src.loqs/VirtualBox-6.1.12/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c @@ -1,4 +1,4 @@ -/* $Id: memobj-r0drv-linux.c 85516 2020-07-29 10:47:38Z vboxsync $ */ +/* $Id: memobj-r0drv-linux.c $ */ /** @file * IPRT - Ring-0 Memory Objects, Linux. */ @@ -1552,7 +1552,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO ? ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub) : ioremap_cache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub); -#else /* KERNEL_VERSION < 2.6.25 */ +#else pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO ? ioremap_nocache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub) : ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub); diff --git a/src.herb/VirtualBox-6.1.12/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h b/src.loqs/VirtualBox-6.1.12/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h index 6ee6c00..bc6dcf5 100644 --- a/src.herb/VirtualBox-6.1.12/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h +++ b/src.loqs/VirtualBox-6.1.12/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h @@ -1,4 +1,4 @@ -/* $Id: the-linux-kernel.h 85518 2020-07-29 11:01:45Z vboxsync $ */ +/* $Id: the-linux-kernel.h $ */ /** @file * IPRT - Include all necessary headers for the Linux kernel. */ diff --git a/src.herb/VirtualBox-6.1.12/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c b/src.loqs/VirtualBox-6.1.12/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c index 7cd8ca1..4c9c518 100644 --- a/src.herb/VirtualBox-6.1.12/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c +++ b/src.loqs/VirtualBox-6.1.12/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c @@ -1,4 +1,4 @@ -/* $Id: time-r0drv-linux.c 85208 2020-07-10 23:58:39Z vboxsync $ */ +/* $Id: time-r0drv-linux.c $ */ /** @file * IPRT - Time, Ring-0 Driver, Linux. */ @@ -51,7 +51,6 @@ DECLINLINE(uint64_t) rtTimeGetSystemNanoTS(void) */ uint64_t u64; struct timespec64 Ts = { 0, 0 }; - ktime_get_ts64(&Ts); u64 = Ts.tv_sec * RT_NS_1SEC_64 + Ts.tv_nsec; return u64;