diff -Nru virtualbox-4.1.12-dfsg/debian/changelog virtualbox-4.1.12-dfsg/debian/changelog --- virtualbox-4.1.12-dfsg/debian/changelog 2013-03-31 17:01:39.000000000 +0000 +++ virtualbox-4.1.12-dfsg/debian/changelog 2013-09-30 08:55:24.000000000 +0000 @@ -1,3 +1,16 @@ +virtualbox (4.1.12-dfsg-2ubuntu0.5) precise-proposed; urgency=low + + * Update the patch for Linux 3.11 with a more complete + implementation (LP: #1076603). + + -- Alberto Milone Mon, 30 Sep 2013 10:54:27 +0200 + +virtualbox (4.1.12-dfsg-2ubuntu0.4) precise-proposed; urgency=low + + * Add support for kernels up to 3.11 (LP: #1076603). + + -- Alberto Milone Tue, 10 Sep 2013 13:49:14 +0200 + virtualbox (4.1.12-dfsg-2ubuntu0.3) precise-proposed; urgency=low [ Felix Geyer ] diff -Nru virtualbox-4.1.12-dfsg/debian/patches/41-add-support-for-linux-3-7.patch virtualbox-4.1.12-dfsg/debian/patches/41-add-support-for-linux-3-7.patch --- virtualbox-4.1.12-dfsg/debian/patches/41-add-support-for-linux-3-7.patch 1970-01-01 00:00:00.000000000 +0000 +++ virtualbox-4.1.12-dfsg/debian/patches/41-add-support-for-linux-3-7.patch 2013-09-10 07:49:49.000000000 +0000 @@ -0,0 +1,30 @@ +From 455df559ccb9f59119a04d62b7732dfadf35dc52 Mon Sep 17 00:00:00 2001 +From: Alberto Milone +Date: Tue, 10 Sep 2013 09:44:30 +0200 +Subject: [PATCH 1/1] Add support for Linux 3.7 + +--- + src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c +index 29697ca..f8d0f41 100644 +--- a/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c ++++ b/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c +@@ -1448,7 +1448,12 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ p + + #if defined(VBOX_USE_INSERT_PAGE) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) + rc = vm_insert_page(vma, ulAddrCur, pMemLnxToMap->apPages[iPage]); +- vma->vm_flags |= VM_RESERVED; /* This flag helps making 100% sure some bad stuff wont happen (swap, core, ++). */ ++/* This flag helps making 100% sure some bad stuff wont happen (swap, core, ++). */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0) ++ vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; ++#else ++ vma->vm_flags |= VM_RESERVED; ++#endif + #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11) + rc = remap_pfn_range(vma, ulAddrCur, page_to_pfn(pMemLnxToMap->apPages[iPage]), PAGE_SIZE, fPg); + #elif defined(VBOX_USE_PAE_HACK) +-- +1.7.9.5 + diff -Nru virtualbox-4.1.12-dfsg/debian/patches/42-add-support-for-linux-3-8.patch virtualbox-4.1.12-dfsg/debian/patches/42-add-support-for-linux-3-8.patch --- virtualbox-4.1.12-dfsg/debian/patches/42-add-support-for-linux-3-8.patch 1970-01-01 00:00:00.000000000 +0000 +++ virtualbox-4.1.12-dfsg/debian/patches/42-add-support-for-linux-3-8.patch 2013-09-10 09:01:00.000000000 +0000 @@ -0,0 +1,30 @@ +From 3bbf30c427dd9783f802c0e170d7d699cef6e888 Mon Sep 17 00:00:00 2001 +From: Alberto Milone +Date: Tue, 10 Sep 2013 10:59:26 +0200 +Subject: [PATCH 1/1] Add support for Linux 3.8 + +Do not use __devinitdata with Linux 3.8 or higher +--- + .../Additions/common/VBoxGuest/VBoxGuest-linux.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c +index e8effb3..ba015bd 100644 +--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c ++++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c +@@ -203,7 +203,11 @@ static struct miscdevice g_MiscDeviceUser = + + + /** PCI hotplug structure. */ +-static const struct pci_device_id __devinitdata g_VBoxGuestPciId[] = ++static const struct pci_device_id ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) ++__devinitdata ++#endif ++g_VBoxGuestPciId[] = + { + { + vendor: VMMDEV_VENDORID, +-- +1.7.9.5 + diff -Nru virtualbox-4.1.12-dfsg/debian/patches/43-add-support-for-linux-3-9.patch virtualbox-4.1.12-dfsg/debian/patches/43-add-support-for-linux-3-9.patch --- virtualbox-4.1.12-dfsg/debian/patches/43-add-support-for-linux-3-9.patch 1970-01-01 00:00:00.000000000 +0000 +++ virtualbox-4.1.12-dfsg/debian/patches/43-add-support-for-linux-3-9.patch 2013-09-10 09:30:23.000000000 +0000 @@ -0,0 +1,27 @@ +From b59ed6c1b2311d39391b27ab9e8c9861a9231c43 Mon Sep 17 00:00:00 2001 +From: Alberto Milone +Date: Tue, 10 Sep 2013 11:28:46 +0200 +Subject: [PATCH 1/1] Add support for Linux 3.9 + +MAX_PRIO and MAX_RT_PRIO have been moved into linux/sched/rt.h +--- + src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c +index d8a723a..f37a9e8 100644 +--- a/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c ++++ b/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c +@@ -35,6 +35,9 @@ + #include + #include + #include "internal/thread.h" ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) ++#include ++#endif + + + RTDECL(RTTHREAD) RTThreadSelf(void) +-- +1.7.9.5 + diff -Nru virtualbox-4.1.12-dfsg/debian/patches/44-add-support-for-linux-3-6.patch virtualbox-4.1.12-dfsg/debian/patches/44-add-support-for-linux-3-6.patch --- virtualbox-4.1.12-dfsg/debian/patches/44-add-support-for-linux-3-6.patch 1970-01-01 00:00:00.000000000 +0000 +++ virtualbox-4.1.12-dfsg/debian/patches/44-add-support-for-linux-3-6.patch 2013-09-10 10:57:05.000000000 +0000 @@ -0,0 +1,26 @@ +From 8d937becf2de6d3c0fdad88586bff5c512ca0f71 Mon Sep 17 00:00:00 2001 +From: Alberto Milone +Date: Tue, 10 Sep 2013 12:56:21 +0200 +Subject: [PATCH 1/1] Add support for Linux 3.6 + +--- + src/VBox/Additions/linux/drm/vboxvideo_drm.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/VBox/Additions/linux/drm/vboxvideo_drm.c b/src/VBox/Additions/linux/drm/vboxvideo_drm.c +index c0d8bb0..c56732d 100644 +--- a/src/VBox/Additions/linux/drm/vboxvideo_drm.c ++++ b/src/VBox/Additions/linux/drm/vboxvideo_drm.c +@@ -103,7 +103,9 @@ static struct drm_driver driver = + { + /* .driver_features = DRIVER_USE_MTRR, */ + .load = vboxvideo_driver_load, ++#if LINUX_VERSION_CODE < KERNEL_VERSION (3, 6, 0) + .reclaim_buffers = drm_core_reclaim_buffers, ++#endif + /* As of Linux 2.6.37, always the internal functions are used. */ + #if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 37) && !defined(DRM_RHEL61) + .get_map_ofs = drm_core_get_map_ofs, +-- +1.7.9.5 + diff -Nru virtualbox-4.1.12-dfsg/debian/patches/45-add-support-for-linux-3-11.patch virtualbox-4.1.12-dfsg/debian/patches/45-add-support-for-linux-3-11.patch --- virtualbox-4.1.12-dfsg/debian/patches/45-add-support-for-linux-3-11.patch 1970-01-01 00:00:00.000000000 +0000 +++ virtualbox-4.1.12-dfsg/debian/patches/45-add-support-for-linux-3-11.patch 2013-09-30 08:54:01.000000000 +0000 @@ -0,0 +1,89 @@ +Description: Fix for Linux 3.11 +Origin: upstream, https://www.virtualbox.org/changeset/47588/vbox and + https://www.virtualbox.org/changeset/47484/vbox + +--- a/src/VBox/Additions/linux/sharedfolders/dirops.c ++++ b/src/VBox/Additions/linux/sharedfolders/dirops.c +@@ -233,7 +233,11 @@ + * b. failure to compute fake inode number + * c. filldir returns an error (see comment on that) + */ +-static int sf_dir_read (struct file *dir, void *opaque, filldir_t filldir) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++static int sf_dir_iterate(struct file *dir, struct dir_context *ctx) ++#else ++static int sf_dir_read(struct file *dir, void *opaque, filldir_t filldir) ++#endif + { + TRACE(); + for (;;) +@@ -257,12 +261,19 @@ + /* skip erroneous entry and proceed */ + LogFunc(("sf_getdent error %d\n", err)); + dir->f_pos += 1; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++ ctx->pos += 1; ++#endif + continue; + } + + /* d_name now contains a valid entry name */ + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++ sanity = ctx->pos + 0xbeef; ++#else + sanity = dir->f_pos + 0xbeef; ++#endif + fake_ino = sanity; + if (sanity - fake_ino) + { +@@ -270,8 +281,11 @@ + return -EINVAL; + } + +- err = filldir(opaque, d_name, strlen(d_name), +- dir->f_pos, fake_ino, DT_UNKNOWN); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++ err = dir_emit(ctx, d_name, strlen(d_name), fake_ino, DT_UNKNOWN); ++#else ++ err = filldir(opaque, d_name, strlen(d_name), dir->f_pos, fake_ino, DT_UNKNOWN); ++#endif + if (err) + { + LogFunc(("filldir returned error %d\n", err)); +@@ -281,6 +295,9 @@ + } + + dir->f_pos += 1; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++ ctx->pos += 1; ++#endif + } + + BUG(); +@@ -289,7 +306,11 @@ + struct file_operations sf_dir_fops = + { + .open = sf_dir_open, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++ .iterate = sf_dir_iterate, ++#else + .readdir = sf_dir_read, ++#endif + .release = sf_dir_release, + .read = generic_read_dir + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) +--- a/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c ++++ b/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c +@@ -1804,7 +1804,11 @@ + + { + PVBOXNETFLTINS pThis = VBOX_FLT_NB_TO_INST(self); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++ struct net_device *pDev = netdev_notifier_info_to_dev(ptr); ++#else + struct net_device *pDev = (struct net_device *)ptr; ++#endif + int rc = NOTIFY_OK; + + Log(("VBoxNetFlt: got event %s(0x%lx) on %s, pDev=%p pThis=%p pThis->u.s.pDev=%p\n", diff -Nru virtualbox-4.1.12-dfsg/debian/patches/series virtualbox-4.1.12-dfsg/debian/patches/series --- virtualbox-4.1.12-dfsg/debian/patches/series 2013-03-31 17:02:24.000000000 +0000 +++ virtualbox-4.1.12-dfsg/debian/patches/series 2013-09-10 11:26:42.000000000 +0000 @@ -19,3 +19,8 @@ 38-fix-nat-local-dns-resolver.patch 39-kernel-35.patch 40-fix-crash-64bit-guests.patch +41-add-support-for-linux-3-7.patch +42-add-support-for-linux-3-8.patch +43-add-support-for-linux-3-9.patch +44-add-support-for-linux-3-6.patch +45-add-support-for-linux-3-11.patch