| 9 | |
| 10 | Edit: the diffs for that particular issue are: |
| 11 | |
| 12 | {{{ |
| 13 | $ svn diff |
| 14 | Index: src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c |
| 15 | =================================================================== |
| 16 | --- src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c (revision 136356) |
| 17 | +++ src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c (working copy) |
| 18 | @@ -842,8 +842,11 @@ |
| 19 | rcLnx = pci_request_region(pPciDev, iRegion, "vboxpci"); |
| 20 | if (!rcLnx) |
| 21 | { |
| 22 | - /* For now no caching, try to optimize later. */ |
| 23 | - RTR0PTR R0PtrMapping = ioremap_nocache(pci_resource_start(pPciDev, iRegion), |
| 24 | + /* |
| 25 | + * ioremap_cache() defaults to no caching since 2.6 kernels. |
| 26 | + * We try to optimize later. |
| 27 | + */ |
| 28 | + RTR0PTR R0PtrMapping = ioremap_cache(pci_resource_start(pPciDev, iRegion), |
| 29 | pci_resource_len(pPciDev, iRegion)); |
| 30 | |
| 31 | if (R0PtrMapping != NIL_RTR0PTR) |
| 32 | @@ -850,7 +853,7 @@ |
| 33 | pIns->aRegionR0Mapping[iRegion] = R0PtrMapping; |
| 34 | else |
| 35 | { |
| 36 | - vbpci_printk(KERN_DEBUG, pPciDev, "ioremap_nocache() failed\n"); |
| 37 | + vbpci_printk(KERN_DEBUG, pPciDev, "ioremap_cache() failed\n"); |
| 38 | pci_release_region(pPciDev, iRegion); |
| 39 | rc = VERR_MAP_FAILED; |
| 40 | } |
| 41 | Index: src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c |
| 42 | =================================================================== |
| 43 | --- src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c (revision 136356) |
| 44 | +++ src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c (working copy) |
| 45 | @@ -1461,9 +1461,19 @@ |
| 46 | * MMIO / physical memory. |
| 47 | */ |
| 48 | Assert(pMemLnxToMap->Core.enmType == RTR0MEMOBJTYPE_PHYS && !pMemLnxToMap->Core.u.Phys.fAllocated); |
| 49 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) |
| 50 | + /* |
| 51 | + * ioremap() defaults to no caching since the 2.6 kernels. |
| 52 | + * ioremap_nocache() has been removed finally in 5.6-rc1. |
| 53 | + */ |
| 54 | pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO |
| 55 | + ? ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub) |
| 56 | + : ioremap_cache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub); |
| 57 | +#else /* KERNEL_VERSION < 2.6.25 */ |
| 58 | + pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO |
| 59 | ? ioremap_nocache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub) |
| 60 | : ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub); |
| 61 | +#endif /* KERNEL_VERSION < 2.6.25 */ |
| 62 | if (pMemLnx->Core.pv) |
| 63 | { |
| 64 | /** @todo fix protection. */ |
| 65 | }}} |