--- a/include/iprt/cdefs.h.ORIG 2019-02-02 13:26:56.000000000 +0100 +++ b/include/iprt/cdefs.h 2019-11-26 14:05:58.195748999 +0100 @@ -1166,7 +1166,7 @@ * Tell the compiler that we're falling through to the next case in a switch. * @sa RT_FALL_THRU */ #if RT_GNUC_PREREQ(7, 0) -# define RT_FALL_THROUGH() __attribute__((fallthrough)) +# define RT_FALL_THROUGH() __attribute__((__fallthrough__)) #else # define RT_FALL_THROUGH() (void)0 #endif --- a/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c.ORIG 2019-09-12 14:21:27.000000000 +0200 +++ b/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c 2019-11-26 14:13:33.946723885 +0100 @@ -924,8 +924,13 @@ for (i = 0; i < skb_shinfo(pBuf)->nr_frags; i++) { skb_frag_t *pFrag = &skb_shinfo(pBuf)->frags[i]; - pSG->aSegs[iSeg].cb = pFrag->size; +# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) + pSG->aSegs[iSeg].cb = pFrag->bv_len; + pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset; +# else /* < KERNEL_VERSION(5, 4, 0) */ + pSG->aSegs[iSeg].cb = pFrag->size; pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->page_offset; +# endif /* >= KERNEL_VERSION(5, 4, 0) */ Log6((" %p", pSG->aSegs[iSeg].pv)); pSG->aSegs[iSeg++].Phys = NIL_RTHCPHYS; Assert(iSeg <= pSG->cSegsAlloc); @@ -940,8 +945,12 @@ for (i = 0; i < skb_shinfo(pFragBuf)->nr_frags; i++) { skb_frag_t *pFrag = &skb_shinfo(pFragBuf)->frags[i]; - pSG->aSegs[iSeg].cb = pFrag->size; +# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) + pSG->aSegs[iSeg].cb = pFrag->bv_len; + pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset; +# else /* < KERNEL_VERSION(5, 4, 0) */ pSG->aSegs[iSeg].cb = pFrag->size; pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->page_offset; +# endif /* >= KERNEL_VERSION(5, 4, 0) */ Log6((" %p", pSG->aSegs[iSeg].pv)); pSG->aSegs[iSeg++].Phys = NIL_RTHCPHYS; Assert(iSeg <= pSG->cSegsAlloc); 38a39,42 > #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) > #include > #endif /* >= KERNEL_VERSION(4, 11, 0) */ > --- a/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h.ORIG 2019-09-11 11:59:56.000000000 +0200 +++ b/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h 2019-11-26 18:33:24.084171191 +0100 @@ -130,6 +130,7 @@ #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) # include +# include #endif /* For the basic additions module */ #include @@ -315,16 +316,22 @@ * to be a bug in one of the many patches that redhat applied. * It should be safe to do this on less buggy linux kernels too. ;-) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) # define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) \ do { \ if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) \ change_page_attr(pPages, cPages, prot); \ change_page_attr(pPages, cPages, prot); \ } while (0) +#else +# define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) +#endif # endif /* !RT_ARCH_AMD64 */ #endif /* !NO_REDHAT_HACKS */ #ifndef MY_CHANGE_PAGE_ATTR +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) + # ifdef RT_ARCH_AMD64 /** @todo This is a cheap hack, but it'll get around that 'else BUG();' in __change_page_attr(). */ # define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) \ do { \ @@ -334,9 +341,12 @@ # else # define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) change_page_attr(pPages, cPages, prot) # endif +#else +# define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) +#endif #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) && LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) # define MY_SET_PAGES_EXEC(pPages, cPages) set_pages_x(pPages, cPages) # define MY_SET_PAGES_NOEXEC(pPages, cPages) set_pages_nx(pPages, cPages) #else --- a/src/VBox/Additions/linux/drm/vbox_drv.c.ORIG 2019-10-10 20:28:09.000000000 +0200 +++ b/src/VBox/Additions/linux/drm/vbox_drv.c 2019-11-26 15:49:36.898742790 +0100 @@ -270,12 +270,17 @@ } static struct drm_driver driver = { +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ | #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) && !defined(RHEL_81) DRIVER_IRQ_SHARED | #endif +# endif /* < KERNEL_VERSION(5, 1, 0) && !defined(RHEL_81) */ DRIVER_PRIME, +#else /* >= KERNEL_VERSION(5, 4, 0) */ + .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ, +#endif /* < KERNEL_VERSION(5, 4, 0) */ .dev_priv_size = 0, .load = vbox_driver_load, --- a/src/VBox/Additions/linux/drm/vbox_main.c.ORIG 2019-10-10 20:28:09.000000000 +0200 +++ b/src/VBox/Additions/linux/drm/vbox_main.c 2019-11-26 15:51:55.109735174 +0100 @@ -617,10 +617,14 @@ static inline u64 vbox_bo_mmap_offset(struct vbox_bo *bo) { #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_70) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) + return drm_vma_node_offset_addr(&bo->bo.base.vma_node); +#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_70) return bo->bo.addr_space_offset; #else return drm_vma_node_offset_addr(&bo->bo.vma_node); #endif +#endif /* >= KERNEL_VERSION(5, 4, 0) */ } int --- a/src/VBox/Runtime/common/fs/ntfsvfs.cpp.ORIG 2019-10-10 20:36:03.000000000 +0200 +++ b/src/VBox/Runtime/common/fs/ntfsvfs.cpp 2019-11-26 16:04:50.937692422 +0100 @@ -1052,7 +1052,7 @@ case 4: cClustersInRun |= (uint32_t)pbPairs[offPairs + 3] << 24; RT_FALL_THRU(); case 3: cClustersInRun |= (uint32_t)pbPairs[offPairs + 2] << 16; RT_FALL_THRU(); case 2: cClustersInRun |= (uint16_t)pbPairs[offPairs + 1] << 8; RT_FALL_THRU(); - case 1: cClustersInRun |= (uint16_t)pbPairs[offPairs + 0] << 0; RT_FALL_THRU(); + case 1: cClustersInRun |= (uint16_t)pbPairs[offPairs + 0] << 0; } offPairs += cbRunField; AssertBreakStmt(cClustersInRun <= cMaxClustersInRun, --- a/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c.ORIG 2019-10-10 20:36:16.000000000 +0200 +++ b/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c 2019-11-26 16:05:28.583690348 +0100 @@ -36,6 +36,9 @@ #include #include "internal/thread.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) + #include +#endif /* >= KERNEL_VERSION(4, 11, 0) */ RTDECL(RTTHREAD) RTThreadSelf(void) {