From 23dfa4f25416d5e4ebb15f171a7dde8de1bbd18565727f3cd68759126541ac98 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Tue, 24 Sep 2019 16:49:12 +0000 Subject: [PATCH] Accepting request 732783 from home:lwfinger:branches:Virtualization - Add BuildRequires for device-mapper - Add file "fixes_for_5.4.patch" to handle API changes in kernel 5.4 OBS-URL: https://build.opensuse.org/request/show/732783 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=505 --- fixes_for_5.4.patch | 72 +++++++++++++++++++++++++++++++++++++++++++++ virtualbox.changes | 7 +++++ virtualbox.spec | 4 +++ 3 files changed, 83 insertions(+) create mode 100644 fixes_for_5.4.patch diff --git a/fixes_for_5.4.patch b/fixes_for_5.4.patch new file mode 100644 index 0000000..394069b --- /dev/null +++ b/fixes_for_5.4.patch @@ -0,0 +1,72 @@ +Index: VirtualBox-6.0.12/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c +=================================================================== +--- VirtualBox-6.0.12.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c ++++ VirtualBox-6.0.12/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c +@@ -924,8 +924,13 @@ static void vboxNetFltLinuxSkBufToSG(PVB + for (i = 0; i < skb_shinfo(pBuf)->nr_frags; i++) + { + skb_frag_t *pFrag = &skb_shinfo(pBuf)->frags[i]; ++#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 + pSG->aSegs[iSeg].cb = pFrag->size; + pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->page_offset; ++#endif + Log6((" %p", pSG->aSegs[iSeg].pv)); + pSG->aSegs[iSeg++].Phys = NIL_RTHCPHYS; + Assert(iSeg <= pSG->cSegsAlloc); +@@ -940,8 +945,13 @@ static void vboxNetFltLinuxSkBufToSG(PVB + for (i = 0; i < skb_shinfo(pFragBuf)->nr_frags; i++) + { + skb_frag_t *pFrag = &skb_shinfo(pFragBuf)->frags[i]; ++#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 + pSG->aSegs[iSeg].cb = pFrag->size; + pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->page_offset; ++#endif + Log6((" %p", pSG->aSegs[iSeg].pv)); + pSG->aSegs[iSeg++].Phys = NIL_RTHCPHYS; + Assert(iSeg <= pSG->cSegsAlloc); +Index: VirtualBox-6.0.12/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c +=================================================================== +--- VirtualBox-6.0.12.orig/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c ++++ VirtualBox-6.0.12/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c +@@ -444,8 +444,10 @@ RTR0DECL(void *) RTMemContAlloc(PRTCCPHY + + SetPageReserved(&paPages[iPage]); + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 20) /** @todo find the exact kernel where change_page_attr was introduced. */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) + MY_SET_PAGES_EXEC(&paPages[iPage], 1); + #endif ++#endif + } + *pPhys = page_to_phys(paPages); + pvRet = phys_to_virt(page_to_phys(paPages)); +@@ -492,8 +494,10 @@ RTR0DECL(void) RTMemContFree(void *pv, s + { + ClearPageReserved(&paPages[iPage]); + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 20) /** @todo find the exact kernel where change_page_attr was introduced. */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) + MY_SET_PAGES_NOEXEC(&paPages[iPage], 1); + #endif ++#endif + } + __free_pages(paPages, cOrder); + IPRT_LINUX_RESTORE_EFL_AC(); +Index: VirtualBox-6.0.12/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c +=================================================================== +--- VirtualBox-6.0.12.orig/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c ++++ VirtualBox-6.0.12/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c +@@ -36,6 +36,9 @@ + #include + #include "internal/thread.h" + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) ++#include ++#endif + + RTDECL(RTTHREAD) RTThreadSelf(void) + { diff --git a/virtualbox.changes b/virtualbox.changes index 599b2a6..6ac42ba 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Sep 23 17:17:18 UTC 2019 - Larry Finger + +- Add BuildRequires for device-mapper + +- Add file "fixes_for_5.4.patch" to handle API changes in kernel 5.4 + ------------------------------------------------------------------- Sat Sep 7 21:28:46 UTC 2019 - Larry Finger diff --git a/virtualbox.spec b/virtualbox.spec index c81950d..315d58a 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -147,6 +147,8 @@ Patch131: fixes_for_5.3.patch # Fixes for Qt5.13 on 32-bit systems Patch132: fixes_for_qt5.13.patch #endif +# Fixes for API changes in kernel 5.4 +Patch133: fixes_for_5.4.patch Patch999: virtualbox-fix-ui-background-color.patch # BuildRequires: LibVNCServer-devel @@ -163,6 +165,7 @@ BuildRequires: boost-devel %endif BuildRequires: %{kernel_module_package_buildreqs} BuildRequires: dev86 +BuildRequires: device-mapper BuildRequires: device-mapper-devel BuildRequires: dmidecode BuildRequires: e2fsprogs-devel @@ -449,6 +452,7 @@ as an "extpack" for VirtualBox. The implementation is licensed under GPL. %ifarch %ix86 && 0%{?qt5ver} >= 51300 %patch132 -p1 %endif +%patch133 -p1 # make VB UI background colors look sane again %patch999 -p1