Ticket #20914: vbox-linux-5.18.patch
| File vbox-linux-5.18.patch, 9.0 KB (added by , 2 years ago) |
|---|
-
include/VBox/sup.h
2142 2142 */ 2143 2143 SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void); 2144 2144 2145 /** 2146 * Notification from R0 VMM prior to loading the guest-FPU register state. 2147 * 2148 * @returns Whether the host-FPU register state has been saved by the host kernel. 2149 * @param fCtxHook Whether thread-context hooks are enabled. 2150 * 2151 * @remarks Called with preemption disabled. 2152 */ 2153 SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook); 2154 2155 /** 2156 * Notification from R0 VMM prior to saving the guest-FPU register state (and 2157 * potentially restoring the host-FPU register state) in ring-0. 2158 * 2159 * @param fCtxHook Whether thread-context hooks are enabled. 2160 * 2161 * @remarks Called with preemption disabled. 2162 */ 2163 SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook); 2164 2145 2165 /** @copydoc RTLogGetDefaultInstanceEx 2146 2166 * @remarks To allow overriding RTLogGetDefaultInstanceEx locally. */ 2147 2167 SUPR0DECL(struct RTLOGGER *) SUPR0GetDefaultLogInstanceEx(uint32_t fFlagsAndGroup); -
src/VBox/Additions/linux/sharedfolders/regops.c
3823 3823 .readpage = vbsf_readpage, 3824 3824 .writepage = vbsf_writepage, 3825 3825 /** @todo Need .writepages if we want msync performance... */ 3826 #if RTLNX_VER_MIN(2,5,12) 3826 #if RTLNX_VER_MIN(5,18,0) 3827 .dirty_folio = filemap_dirty_folio, 3828 #elif RTLNX_VER_MIN(2,5,12) 3827 3829 .set_page_dirty = __set_page_dirty_buffers, 3828 3830 #endif 3829 3831 #if RTLNX_VER_MIN(5,14,0) -
src/VBox/Additions
-
src/VBox/HostDrivers/Support/SUPDrv.cpp
Property changes on: src/VBox/Additions ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk/src/VBox/Additions:r150844
98 98 # endif 99 99 #endif 100 100 101 #if defined(RT_OS_LINUX) && !defined(__NO_FORTIFY) && defined(__OPTIMIZE__) && defined(CONFIG_FORTIFY_SOURCE) 102 /* In Linux 5.18-rc1, memcpy became a wrapper which does fortify checks 103 * before triggering __underlying_memcpy() call. We do not pass these checks here, 104 * so bypass them for now. */ 105 # if RTLNX_VER_MIN(5,18,0) 106 # define SUPDRV_MEMCPY __underlying_memcpy 107 # else 108 # define SUPDRV_MEMCPY memcpy 109 # endif 110 #else 111 # define SUPDRV_MEMCPY memcpy 112 #endif 101 113 102 114 /* 103 115 * Logging assignments: … … 266 278 SUPEXP_STK_BACK( 2, SUPR0ContFree), 267 279 SUPEXP_STK_BACK( 2, SUPR0ChangeCR4), 268 280 SUPEXP_STK_BACK( 1, SUPR0EnableVTx), 281 SUPEXP_STK_OKAY( 1, SUPR0FpuBegin), 282 SUPEXP_STK_OKAY( 1, SUPR0FpuEnd), 269 283 SUPEXP_STK_BACK( 0, SUPR0SuspendVTxOnCpu), 270 284 SUPEXP_STK_BACK( 1, SUPR0ResumeVTxOnCpu), 271 285 SUPEXP_STK_OKAY( 1, SUPR0GetCurrentGdtRw), … … 1742 1756 1743 1757 /* execute */ 1744 1758 pReq->u.Out.cFunctions = RT_ELEMENTS(g_aFunctions); 1745 memcpy(&pReq->u.Out.aFunctions[0], g_aFunctions, sizeof(g_aFunctions));1759 SUPDRV_MEMCPY(&pReq->u.Out.aFunctions[0], g_aFunctions, sizeof(g_aFunctions)); 1746 1760 pReq->Hdr.rc = VINF_SUCCESS; 1747 1761 return 0; 1748 1762 } -
src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
2002 2002 } 2003 2003 2004 2004 2005 SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook) 2006 { 2007 RT_NOREF(fCtxHook); 2008 return false; 2009 } 2010 2011 2012 SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook) 2013 { 2014 RT_NOREF(fCtxHook); 2015 } 2016 2005 2017 /* 2006 2018 * 2007 2019 * org_virtualbox_SupDrv -
src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
640 640 return 0; 641 641 } 642 642 643 644 SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook) 645 { 646 RT_NOREF(fCtxHook); 647 return false; 648 } 649 650 651 SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook) 652 { 653 RT_NOREF(fCtxHook); 654 } 655 -
src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
1454 1454 } 1455 1455 1456 1456 1457 SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook) 1458 { 1459 RT_NOREF(fCtxHook); 1460 #if RTLNX_VER_MIN(5,18,0) 1461 kernel_fpu_begin(); 1462 /* if (fCtxHook) */ 1463 preempt_enable(); /* HACK ALERT! undo the implicit preempt_disable() in kernel_fpu_begin(). */ 1464 return true; 1465 #else 1466 return false; 1467 #endif 1468 } 1469 1470 1471 SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook) 1472 { 1473 RT_NOREF(fCtxHook); 1474 #if RTLNX_VER_MIN(5,18,0) 1475 /* if (fCtxHook) */ 1476 preempt_disable(); /* HACK ALERT! undo the implicit preempt_enable() in SUPR0FpuBegin(). */ 1477 kernel_fpu_end(); 1478 #endif 1479 } 1480 1481 1457 1482 int VBOXCALL supdrvOSGetCurrentGdtRw(RTHCUINTPTR *pGdtRw) 1458 1483 { 1459 1484 #if RTLNX_VER_MIN(4,12,0) -
src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
541 541 return 0; 542 542 } 543 543 544 545 SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook) 546 { 547 RT_NOREF(fCtxHook); 548 return false; 549 } 550 551 552 SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook) 553 { 554 RT_NOREF(fCtxHook); 555 } 556 -
src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
1309 1309 return 0; 1310 1310 } 1311 1311 1312 1313 SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook) 1314 { 1315 RT_NOREF(fCtxHook); 1316 return false; 1317 } 1318 1319 1320 SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook) 1321 { 1322 RT_NOREF(fCtxHook); 1323 } 1324 -
src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
2704 2704 } 2705 2705 2706 2706 2707 SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook) 2708 { 2709 RT_NOREF(fCtxHook); 2710 return false; 2711 } 2712 2713 2714 SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook) 2715 { 2716 RT_NOREF(fCtxHook); 2717 } 2718 2719 2707 2720 SUPR0DECL(int) SUPR0IoCtlSetupForHandle(PSUPDRVSESSION pSession, intptr_t hHandle, uint32_t fFlags, PSUPR0IOCTLCTX *ppCtx) 2708 2721 { 2709 2722 /* -
src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
2311 2311 vboxNetFltDumpPacket(pSG, true, "host", (fDst & INTNETTRUNKDIR_WIRE) ? 0 : 1); 2312 2312 Log6(("vboxNetFltPortOsXmit: pBuf->cb dump:\n%.*Rhxd\n", sizeof(pBuf->cb), pBuf->cb)); 2313 2313 Log6(("vboxNetFltPortOsXmit: netif_rx_ni(%p)\n", pBuf)); 2314 #if RTLNX_VER_MIN(5,18,0) 2315 local_bh_disable(); 2316 err = netif_rx(pBuf); 2317 local_bh_enable(); 2318 #else 2314 2319 err = netif_rx_ni(pBuf); 2320 #endif 2315 2321 if (err) 2316 2322 rc = RTErrConvertFromErrno(err); 2317 2323 } -
src/VBox/VMM/VMMR0/CPUMR0.cpp
440 440 Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_USED_FPU_GUEST)); 441 441 Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_SYNC_FPU_STATE)); 442 442 443 /* Notify the support driver prior to loading the guest-FPU register state. */ 444 SUPR0FpuBegin(false /* unused */); 445 443 446 if (!pVM->cpum.s.HostFeatures.fLeakyFxSR) 444 447 { 445 448 Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_USED_MANUAL_XMM_RESTORE)); … … 484 487 Assert(ASMGetCR4() & X86_CR4_OSFXSR); 485 488 if (pVCpu->cpum.s.fUseFlags & (CPUM_USED_FPU_GUEST | CPUM_USED_FPU_HOST)) 486 489 { 490 /* Notify the support driver prior to loading the host-FPU register state. */ 491 SUPR0FpuEnd(false /* unused */); 492 487 493 fSavedGuest = RT_BOOL(pVCpu->cpum.s.fUseFlags & CPUM_USED_FPU_GUEST); 488 494 if (!(pVCpu->cpum.s.fUseFlags & CPUM_USED_MANUAL_XMM_RESTORE)) 489 495 cpumR0SaveGuestRestoreHostFPUState(&pVCpu->cpum.s);

