]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: ubuntu: vbox -- Update to 5.1.10-dfsg-2
authorSeth Forshee <seth.forshee@canonical.com>
Mon, 5 Dec 2016 20:05:22 +0000 (14:05 -0600)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
26 files changed:
ubuntu/vbox/BOM
ubuntu/vbox/dkms.conf
ubuntu/vbox/include/VBox/VBoxVideo.h
ubuntu/vbox/include/VBox/err.h
ubuntu/vbox/include/VBox/param.h
ubuntu/vbox/include/VBox/types.h
ubuntu/vbox/include/iprt/err.h
ubuntu/vbox/include/iprt/mangling.h
ubuntu/vbox/include/iprt/mp.h
ubuntu/vbox/include/iprt/time.h
ubuntu/vbox/r0drv/linux/memobj-r0drv-linux.c
ubuntu/vbox/r0drv/linux/mp-r0drv-linux.c
ubuntu/vbox/vboxguest/VBoxGuest.c
ubuntu/vbox/vboxguest/VBoxGuestInternal.h
ubuntu/vbox/vboxguest/revision-generated.h
ubuntu/vbox/vboxguest/version-generated.h
ubuntu/vbox/vboxsf/dirops.c
ubuntu/vbox/vboxsf/revision-generated.h
ubuntu/vbox/vboxsf/version-generated.h
ubuntu/vbox/vboxvideo/revision-generated.h
ubuntu/vbox/vboxvideo/vbox_drv.c
ubuntu/vbox/vboxvideo/vbox_drv.h
ubuntu/vbox/vboxvideo/vbox_main.c
ubuntu/vbox/vboxvideo/vbox_mode.c
ubuntu/vbox/vboxvideo/vbox_ttm.c
ubuntu/vbox/vboxvideo/version-generated.h

index 32b00aac2b74abdf4c6c35a8ae0917f8017a3de3..c0c14575a428eb2f2f9523ede3e4fcd074aea32e 100644 (file)
@@ -1,2 +1,2 @@
-Source: http://ports.ubuntu.com/pool/multiverse/v/virtualbox/virtualbox-guest-dkms_5.1.6-dfsg-1_all.deb
-Version: 5.1.6-dfsg-1
+Source: http://ports.ubuntu.com/pool/multiverse/v/virtualbox/virtualbox-guest-dkms_5.1.10-dfsg-2_all.deb
+Version: 5.1.10-dfsg-2
index dd2d55b23e59e8c0f8a73bfe556bbd68971dd593..e9a96b852c43e3c356b8865a2590ab9058b50f17 100644 (file)
@@ -1,5 +1,5 @@
 PACKAGE_NAME="virtualbox-guest"
-PACKAGE_VERSION="5.1.6"
+PACKAGE_VERSION="5.1.10"
 CLEAN="rm -f *.*o"
 BUILT_MODULE_NAME[0]="vboxguest"
 BUILT_MODULE_LOCATION[0]="vboxguest"
index e08e3f3a10c8ca19d9fba0d52c598d460a1b87eb..337ef5bb16b48083b65fa75e8f34b2f606124e59 100644 (file)
@@ -993,6 +993,9 @@ typedef struct VBVACMDVBVAFLUSH
 /** The virtual monitor has been blanked by the guest and should be blacked
  * out by the host. */
 #define VBVA_SCREEN_F_BLANK    0x0004
+/** The virtual monitor has been blanked by the guest and should be blacked
+ * out by the host using the previous mode values for width. height, etc. */
+#define VBVA_SCREEN_F_BLANK2   0x0008
 
 typedef struct VBVAINFOSCREEN
 {
index 12ba5ffdb90c95c5e76f39b92d3b9b88957a1d56..46389022fb2eec044a8352362771f3d275fa672d 100644 (file)
 #define VERR_PGM_INVALID_LARGE_PAGE_RANGE       (-1645)
 /** Don't mess around with ballooned pages. */
 #define VERR_PGM_PHYS_PAGE_BALLOONED            (-1646)
+/** Internal processing error \#1 in page access handler code. */
+#define VERR_PGM_HANDLER_IPE_1                  (-1647)
 
 
 /** pgmPhysPageMapCommon encountered PGMPAGETYPE_MMIO2_ALIAS_MMIO. */
 #define VERR_PGM_PCI_PASSTHRU_MISCONFIG         (-1682)
 /** Too many MMIO2 ranges. */
 #define VERR_PGM_TOO_MANY_MMIO2_RANGES          (-1683)
-/** Internal processing error in the PGM physial page mapping code dealing
+/** Internal processing error in the PGM physical page mapping code dealing
  * with MMIO2 pages. */
 #define VERR_PGM_PHYS_PAGE_MAP_MMIO2_IPE        (-1684)
+/** Internal processing error in the PGM physcal page handling code related to
+ *  MMIO/MMIO2. */
+#define VERR_PGM_PHYS_MMIO_EX_IPE               (-1685)
 /** @} */
 
 
index 19b313e4aa535705dfbe3f81f1e57c48213b1c0c..f3c00013d112edccb66de17c4f4591d9b581cb31 100644 (file)
 
 /** The maximum number of pages that can be allocated and mapped
  * by various MM, PGM and SUP APIs. */
-#define VBOX_MAX_ALLOC_PAGE_COUNT   (256U * _1M / PAGE_SIZE)
+#if ARCH_BITS == 64
+# define VBOX_MAX_ALLOC_PAGE_COUNT   (_512M / PAGE_SIZE)
+#else
+# define VBOX_MAX_ALLOC_PAGE_COUNT   (_256M / PAGE_SIZE)
+#endif
 
 /** @def VBOX_WITH_PAGE_SHARING
  * Enables the page sharing code.
 #endif
 /** The default size of the below 4GB RAM hole. */
 #define MM_RAM_HOLE_SIZE_DEFAULT    (512U * _1M)
+/** The maximum 64-bit MMIO BAR size.
+ * @remarks There isn't really any limit here other than the size of the
+ *          tracking structures we need (around 1/256 of the size). */
+#if HC_ARCH_BITS == 64
+# define MM_MMIO_64_MAX             _1T
+#else
+# define MM_MMIO_64_MAX             (_1G64 * 16)
+#endif
+/** The maximum 32-bit MMIO BAR size. */
+#define MM_MMIO_32_MAX              _2G
+
 /** @} */
 
 
index 493acae182da39ef694786ffaa897c74a0353df5..81640ac4021056c97a15bac17af23666a6564bff 100644 (file)
@@ -340,6 +340,9 @@ typedef R0PTRTYPE(PPDMDEVINS) PPDMDEVINSR0;
 /** RC pointer to a PDM Device Instance. */
 typedef RCPTRTYPE(PPDMDEVINS) PPDMDEVINSRC;
 
+/** Pointer to a PDM PCI device structure. */
+typedef struct PDMPCIDEV *PPDMPCIDEV;
+
 /** Pointer to a PDM USB Device Instance. */
 typedef struct PDMUSBINS *PPDMUSBINS;
 /** Pointer to a pointer to a PDM USB Device Instance. */
index 3d411ed7fa3f91bd9f1470f1412c28fc4cd0c5f7..73ac9cf50844a87f8c0f8320dff0420291ee19ec 100644 (file)
@@ -950,6 +950,8 @@ RT_C_DECLS_END
 /** Process does not have the increase quota (IQ) privilege needed for
  * creating a process as a given user. IQ is also called 'Increase quotas'. */
 #define VERR_PROC_IQ_PRIV_NOT_HELD          (-22413)
+/** The system has too many CPUs. */
+#define VERR_MP_TOO_MANY_CPUS               (-22414)
 /** @} */
 
 
index c28bcf665e1bce8c41a97e2aec42d33573dbecff..5dfbac1357def11938235eef7857930822007a77 100644 (file)
 # define RTMpGetCount                                   RT_MANGLER(RTMpGetCount)
 # define RTMpGetCurFrequency                            RT_MANGLER(RTMpGetCurFrequency)
 # define RTMpGetDescription                             RT_MANGLER(RTMpGetDescription)
+# define RTMpGetCpuGroupCounts                          RT_MANGLER(RTMpGetCpuGroupCounts)
+# define RTMpGetMaxCpuGroupCount                        RT_MANGLER(RTMpGetMaxCpuGroupCount)
 # define RTMpGetMaxCpuId                                RT_MANGLER(RTMpGetMaxCpuId)
 # define RTMpGetMaxFrequency                            RT_MANGLER(RTMpGetMaxFrequency)
 # define RTMpGetOnlineCount                             RT_MANGLER(RTMpGetOnlineCount)
 # define RTMpOnPairIsConcurrentExecSupported            RT_MANGLER(RTMpOnPairIsConcurrentExecSupported) /* r0drv */
 # define RTMpOnSpecific                                 RT_MANGLER(RTMpOnSpecific)             /* r0drv */
 # define RTMpPokeCpu                                    RT_MANGLER(RTMpPokeCpu)                /* r0drv */
+# define RTMpSetIndexFromCpuGroupMember                 RT_MANGLER(RTMpSetIndexFromCpuGroupMember)
 # define RTMsgError                                     RT_MANGLER(RTMsgError)
 # define RTMsgErrorExit                                 RT_MANGLER(RTMsgErrorExit)
 # define RTMsgErrorExitV                                RT_MANGLER(RTMsgErrorExitV)
 # define RTTimeNanoTSLegacyAsyncUseApicId_EndProc               RT_MANGLER(RTTimeNanoTSLegacyAsyncUseApicId_EndProc)
 # define RTTimeNanoTSLegacyAsyncUseRdtscp                       RT_MANGLER(RTTimeNanoTSLegacyAsyncUseRdtscp)
 # define RTTimeNanoTSLegacyAsyncUseRdtscp_EndProc               RT_MANGLER(RTTimeNanoTSLegacyAsyncUseRdtscp_EndProc)
+# define RTTimeNanoTSLegacyAsyncUseRdtscpGroupChNumCl           RT_MANGLER(RTTimeNanoTSLegacyAsyncUseRdtscpGroupChNumCl)
+# define RTTimeNanoTSLegacyAsyncUseRdtscpGroupChNumCl_EndProc   RT_MANGLER(RTTimeNanoTSLegacyAsyncUseRdtscpGroupChNumCl_EndProc)
 # define RTTimeNanoTSLegacyAsyncUseIdtrLim                      RT_MANGLER(RTTimeNanoTSLegacyAsyncUseIdtrLim)
 # define RTTimeNanoTSLegacyAsyncUseIdtrLim_EndProc              RT_MANGLER(RTTimeNanoTSLegacyAsyncUseIdtrLim_EndProc)
 # define RTTimeNanoTSLegacySyncInvarNoDelta                     RT_MANGLER(RTTimeNanoTSLegacySyncInvarNoDelta)
 # define RTTimeNanoTSLFenceAsyncUseApicId_EndProc               RT_MANGLER(RTTimeNanoTSLFenceAsyncUseApicId_EndProc)
 # define RTTimeNanoTSLFenceAsyncUseRdtscp                       RT_MANGLER(RTTimeNanoTSLFenceAsyncUseRdtscp)
 # define RTTimeNanoTSLFenceAsyncUseRdtscp_EndProc               RT_MANGLER(RTTimeNanoTSLFenceAsyncUseRdtscp_EndProc)
+# define RTTimeNanoTSLFenceAsyncUseRdtscpGroupChNumCl           RT_MANGLER(RTTimeNanoTSLFenceAsyncUseRdtscpGroupChNumCl)
+# define RTTimeNanoTSLFenceAsyncUseRdtscpGroupChNumCl_EndProc   RT_MANGLER(RTTimeNanoTSLFenceAsyncUseRdtscpGroupChNumCl_EndProc)
 # define RTTimeNanoTSLFenceAsyncUseIdtrLim                      RT_MANGLER(RTTimeNanoTSLFenceAsyncUseIdtrLim)
 # define RTTimeNanoTSLFenceAsyncUseIdtrLim_EndProc              RT_MANGLER(RTTimeNanoTSLFenceAsyncUseIdtrLim_EndProc)
 # define RTTimeNanoTSLFenceSyncInvarNoDelta                     RT_MANGLER(RTTimeNanoTSLFenceSyncInvarNoDelta)
index b537ffe8c1fc92a1472296a405d738055ce8b3f1..ad7d3e2e63a4fb88939dcdf4ce61a2ecdaf2091c 100644 (file)
@@ -88,6 +88,37 @@ RTDECL(int) RTMpCpuIdToSetIndex(RTCPUID idCpu);
  */
 RTDECL(RTCPUID) RTMpCpuIdFromSetIndex(int iCpu);
 
+/**
+ * Translates an NT process group member to a CPU set index.
+ *
+ * @returns CPU set index, -1 if not valid.
+ * @param   idxGroup        The CPU group.
+ * @param   idxMember       The CPU group member number.
+ *
+ * @remarks Only available on Windows.
+ */
+RTDECL(int) RTMpSetIndexFromCpuGroupMember(uint32_t idxGroup, uint32_t idxMember);
+
+/**
+ * Gets the member numbers for a CPU group.
+ *
+ * @returns Maximum number of group members.
+ * @param   idxGroup        The CPU group.
+ * @param   pcActive        Where to return the number of active members.
+ *
+ * @remarks Only available on Windows.
+ */
+RTDECL(uint32_t) RTMpGetCpuGroupCounts(uint32_t idxGroup, uint32_t *pcActive);
+
+/**
+ * Get the maximum number of CPU groups.
+ *
+ * @returns Maximum number of CPU groups.
+ *
+ * @remarks Only available on Windows.
+ */
+RTDECL(uint32_t) RTMpGetMaxCpuGroupCount(void);
+
 /**
  * Gets the max CPU identifier (inclusive).
  *
index 5ca53313656ea0115cbc60144c7b77e186c9e60f..a3dcd0d4c4db354ce61e269e4fc5a34b59b99bcc 100644 (file)
@@ -953,12 +953,14 @@ RTDECL(uint64_t) RTTimeNanoTSLFenceSyncInvarNoDelta(PRTTIMENANOTSDATA pData);
 #ifdef IN_RING3
 RTDECL(uint64_t) RTTimeNanoTSLegacyAsyncUseApicId(PRTTIMENANOTSDATA pData);
 RTDECL(uint64_t) RTTimeNanoTSLegacyAsyncUseRdtscp(PRTTIMENANOTSDATA pData);
+RTDECL(uint64_t) RTTimeNanoTSLegacyAsyncUseRdtscpGroupChNumCl(PRTTIMENANOTSDATA pData);
 RTDECL(uint64_t) RTTimeNanoTSLegacyAsyncUseIdtrLim(PRTTIMENANOTSDATA pData);
 RTDECL(uint64_t) RTTimeNanoTSLegacySyncInvarWithDeltaUseApicId(PRTTIMENANOTSDATA pData);
 RTDECL(uint64_t) RTTimeNanoTSLegacySyncInvarWithDeltaUseRdtscp(PRTTIMENANOTSDATA pData);
 RTDECL(uint64_t) RTTimeNanoTSLegacySyncInvarWithDeltaUseIdtrLim(PRTTIMENANOTSDATA pData);
 RTDECL(uint64_t) RTTimeNanoTSLFenceAsyncUseApicId(PRTTIMENANOTSDATA pData);
 RTDECL(uint64_t) RTTimeNanoTSLFenceAsyncUseRdtscp(PRTTIMENANOTSDATA pData);
+RTDECL(uint64_t) RTTimeNanoTSLFenceAsyncUseRdtscpGroupChNumCl(PRTTIMENANOTSDATA pData);
 RTDECL(uint64_t) RTTimeNanoTSLFenceAsyncUseIdtrLim(PRTTIMENANOTSDATA pData);
 RTDECL(uint64_t) RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicId(PRTTIMENANOTSDATA pData);
 RTDECL(uint64_t) RTTimeNanoTSLFenceSyncInvarWithDeltaUseRdtscp(PRTTIMENANOTSDATA pData);
index 4cf93c6ead9cce0c51b6e24a90b537175c4b7395..e43712d499b377feeed873de8155ed03fb5af377 100644 (file)
@@ -1049,8 +1049,14 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3P
         if (R0Process == RTR0ProcHandleSelf())
             rc = get_user_pages(R3Ptr,                  /* Where from. */
                                 cPages,                 /* How many pages. */
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+                                fWrite ? FOLL_WRITE |   /* Write to memory. */
+                                         FOLL_FORCE     /* force write access. */
+                                       : 0,             /* Write to memory. */
+# else
                                 fWrite,                 /* Write to memory. */
                                 fWrite,                 /* force write access. */
+# endif
                                 &pMemLnx->apPages[0],   /* Page array. */
                                 papVMAs);               /* vmas */
         /*
@@ -1063,8 +1069,14 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3P
                                 pTask->mm,              /* Whose pages. */
                                 R3Ptr,                  /* Where from. */
                                 cPages,                 /* How many pages. */
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+                                fWrite ? FOLL_WRITE |   /* Write to memory. */
+                                         FOLL_FORCE     /* force write access. */
+                                       : 0,             /* Write to memory. */
+# else
                                 fWrite,                 /* Write to memory. */
                                 fWrite,                 /* force write access. */
+# endif
                                 &pMemLnx->apPages[0],   /* Page array. */
                                 papVMAs);               /* vmas */
 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) */
@@ -1072,8 +1084,14 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3P
                                 pTask->mm,              /* Whose pages. */
                                 R3Ptr,                  /* Where from. */
                                 cPages,                 /* How many pages. */
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+                                fWrite ? FOLL_WRITE |   /* Write to memory. */
+                                         FOLL_FORCE     /* force write access. */
+                                       : 0,             /* Write to memory. */
+# else
                                 fWrite,                 /* Write to memory. */
                                 fWrite,                 /* force write access. */
+# endif
                                 &pMemLnx->apPages[0],   /* Page array. */
                                 papVMAs);               /* vmas */
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) */
index 5b37881970ea614aedccd747a0022f08707608ba..ec2a83b46bcced32a8bc8b7efdc81fbe0bfe5bdb 100644 (file)
 #include <iprt/thread.h>
 #include "r0drv/mp-r0drv.h"
 
+#ifdef nr_cpumask_bits
+# define VBOX_NR_CPUMASK_BITS   nr_cpumask_bits
+#else
+# define VBOX_NR_CPUMASK_BITS   NR_CPUS
+#endif
 
 RTDECL(RTCPUID) RTMpCpuId(void)
 {
@@ -62,21 +67,21 @@ RT_EXPORT_SYMBOL(RTMpCurSetIndexAndId);
 
 RTDECL(int) RTMpCpuIdToSetIndex(RTCPUID idCpu)
 {
-    return idCpu < RTCPUSET_MAX_CPUS && idCpu < NR_CPUS ? (int)idCpu : -1;
+    return idCpu < RTCPUSET_MAX_CPUS && idCpu < VBOX_NR_CPUMASK_BITS ? (int)idCpu : -1;
 }
 RT_EXPORT_SYMBOL(RTMpCpuIdToSetIndex);
 
 
 RTDECL(RTCPUID) RTMpCpuIdFromSetIndex(int iCpu)
 {
-    return iCpu < NR_CPUS ? (RTCPUID)iCpu : NIL_RTCPUID;
+    return iCpu < VBOX_NR_CPUMASK_BITS ? (RTCPUID)iCpu : NIL_RTCPUID;
 }
 RT_EXPORT_SYMBOL(RTMpCpuIdFromSetIndex);
 
 
 RTDECL(RTCPUID) RTMpGetMaxCpuId(void)
 {
-    return NR_CPUS - 1; //???
+    return VBOX_NR_CPUMASK_BITS - 1; //???
 }
 RT_EXPORT_SYMBOL(RTMpGetMaxCpuId);
 
@@ -84,7 +89,7 @@ RT_EXPORT_SYMBOL(RTMpGetMaxCpuId);
 RTDECL(bool) RTMpIsCpuPossible(RTCPUID idCpu)
 {
 #if defined(CONFIG_SMP)
-    if (RT_UNLIKELY(idCpu >= NR_CPUS))
+    if (RT_UNLIKELY(idCpu >= VBOX_NR_CPUMASK_BITS))
         return false;
 
 # if defined(cpu_possible)
@@ -139,7 +144,7 @@ RT_EXPORT_SYMBOL(RTMpGetCount);
 RTDECL(bool) RTMpIsCpuOnline(RTCPUID idCpu)
 {
 #ifdef CONFIG_SMP
-    if (RT_UNLIKELY(idCpu >= NR_CPUS))
+    if (RT_UNLIKELY(idCpu >= VBOX_NR_CPUMASK_BITS))
         return false;
 # ifdef cpu_online
     return cpu_online(idCpu);
index fee3729782383ec6af94af8e2f846a075c6ad1d9..316673006ffb6bd4d3cd8a6e50d80862a14878f4 100644 (file)
@@ -1463,6 +1463,8 @@ static void vgdrvWaitFreeUnlocked(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTWAIT pWait
  *
  * All entries in the wake-up list gets signalled and moved to the woken-up
  * list.
+ * At least on Windows this function can be invoked concurrently from
+ * different VCPUs. So, be thread-safe.
  *
  * @param   pDevExt         The device extension.
  */
@@ -1477,6 +1479,9 @@ void VGDrvCommonWaitDoWakeUps(PVBOXGUESTDEVEXT pDevExt)
             PVBOXGUESTWAIT pWait = RTListGetFirst(&pDevExt->WakeUpList, VBOXGUESTWAIT, ListNode);
             if (!pWait)
                 break;
+            /* Prevent other threads from accessing pWait when spinlock is released. */
+            RTListNodeRemove(&pWait->ListNode);
+
             pWait->fPendingWakeUp = true;
             RTSpinlockRelease(pDevExt->EventSpinlock);
 
@@ -1484,12 +1489,11 @@ void VGDrvCommonWaitDoWakeUps(PVBOXGUESTDEVEXT pDevExt)
             AssertRC(rc);
 
             RTSpinlockAcquire(pDevExt->EventSpinlock);
+            Assert(pWait->ListNode.pNext == NULL && pWait->ListNode.pPrev == NULL);
+            RTListAppend(&pDevExt->WokenUpList, &pWait->ListNode);
             pWait->fPendingWakeUp = false;
-            if (!pWait->fFreeMe)
-            {
-                RTListNodeRemove(&pWait->ListNode);
-                RTListAppend(&pDevExt->WokenUpList, &pWait->ListNode);
-            }
+            if (RT_LIKELY(!pWait->fFreeMe))
+            { /* likely */ }
             else
             {
                 pWait->fFreeMe = false;
@@ -1555,9 +1559,13 @@ int vgdrvIoCtl_SetMouseNotifyCallback(PVBOXGUESTDEVEXT pDevExt, VBoxGuestMouseSe
 {
     LogFlow(("VBOXGUEST_IOCTL_SET_MOUSE_NOTIFY_CALLBACK: pfnNotify=%p pvUser=%p\n", pNotify->pfnNotify, pNotify->pvUser));
 
+#ifdef VBOXGUEST_MOUSE_NOTIFY_CAN_PREEMPT
+    VGDrvNativeSetMouseNotifyCallback(pDevExt, pNotify);
+#else
     RTSpinlockAcquire(pDevExt->EventSpinlock);
     pDevExt->MouseNotifyCallback = *pNotify;
     RTSpinlockRelease(pDevExt->EventSpinlock);
+#endif
     return VINF_SUCCESS;
 }
 #endif
@@ -3634,6 +3642,23 @@ static int vgdrvDispatchEventsLocked(PVBOXGUESTDEVEXT pDevExt, uint32_t fEvents)
 }
 
 
+/**
+ * Simply checks whether the IRQ is ours or not, does not do any interrupt
+ * procesing.
+ *
+ * @returns true if it was our interrupt, false if it wasn't.
+ * @param   pDevExt     The VBoxGuest device extension.
+ */
+bool VGDrvCommonIsOurIRQ(PVBOXGUESTDEVEXT pDevExt)
+{
+    RTSpinlockAcquire(pDevExt->EventSpinlock);
+    bool const fOurIrq = pDevExt->pVMMDevMemory->V.V1_04.fHaveEvents;
+    RTSpinlockRelease(pDevExt->EventSpinlock);
+
+    return fOurIrq;
+}
+
+
 /**
  * Common interrupt service routine.
  *
@@ -3684,7 +3709,7 @@ bool VGDrvCommonISR(PVBOXGUESTDEVEXT pDevExt)
             {
                 fMousePositionChanged = true;
                 fEvents &= ~VMMDEV_EVENT_MOUSE_POSITION_CHANGED;
-#ifndef RT_OS_WINDOWS
+#if !defined(RT_OS_WINDOWS) && !defined(VBOXGUEST_MOUSE_NOTIFY_CAN_PREEMPT)
                 if (pDevExt->MouseNotifyCallback.pfnNotify)
                     pDevExt->MouseNotifyCallback.pfnNotify(pDevExt->MouseNotifyCallback.pvUser);
 #endif
@@ -3730,6 +3755,16 @@ bool VGDrvCommonISR(PVBOXGUESTDEVEXT pDevExt)
 
     RTSpinlockRelease(pDevExt->EventSpinlock);
 
+    /*
+     * Execute the mouse notification callback here if it cannot be executed while
+     * holding the interrupt safe spinlock, see @bugref{8639}.
+     */
+#if defined(VBOXGUEST_MOUSE_NOTIFY_CAN_PREEMPT)
+    if (   fMousePositionChanged
+        && pDevExt->MouseNotifyCallback.pfnNotify)
+        pDevExt->MouseNotifyCallback.pfnNotify(pDevExt->MouseNotifyCallback.pvUser);
+#endif
+
 #if defined(VBOXGUEST_USE_DEFERRED_WAKE_UP) && !defined(RT_OS_DARWIN) && !defined(RT_OS_WINDOWS)
     /*
      * Do wake-ups.
index 98078729232f5030b461fc50143d856e8b72bdac..c5b652bbe7d7c33edabfcc049185c13ce4d96865 100644 (file)
 # define VBOXGUEST_USE_DEFERRED_WAKE_UP
 #endif
 
+/** @def VBOXGUEST_MOUSE_NOTIFY_CAN_PREEMPT
+ * The mouse notification callback can cause preemption and must not be invoked
+ * while holding a high-level spinlock.
+ */
+#if defined(RT_OS_SOLARIS) || defined(DOXYGEN_RUNNING)
+# define VBOXGUEST_MOUSE_NOTIFY_CAN_PREEMPT
+#endif
 
 /** Pointer to the VBoxGuest per session data. */
 typedef struct VBOXGUESTSESSION *PVBOXGUESTSESSION;
@@ -315,6 +322,7 @@ RT_C_DECLS_BEGIN
 
 int  VGDrvCommonInitDevExt(PVBOXGUESTDEVEXT pDevExt, uint16_t IOPortBase, void *pvMMIOBase, uint32_t cbMMIO,
                            VBOXOSTYPE enmOSType, uint32_t fEvents);
+bool VGDrvCommonIsOurIRQ(PVBOXGUESTDEVEXT pDevExt);
 bool VGDrvCommonISR(PVBOXGUESTDEVEXT pDevExt);
 void VGDrvCommonDeleteDevExt(PVBOXGUESTDEVEXT pDevExt);
 int  VGDrvCommonReinitDevExtAfterHibernation(PVBOXGUESTDEVEXT pDevExt, VBOXOSTYPE enmOSType);
@@ -345,6 +353,10 @@ void VGDrvNativeISRMousePollEvent(PVBOXGUESTDEVEXT pDevExt);
 int VGDrvNtIOCtl_DpcLatencyChecker(void);
 #endif
 
+#ifdef VBOXGUEST_MOUSE_NOTIFY_CAN_PREEMPT
+int VGDrvNativeSetMouseNotifyCallback(PVBOXGUESTDEVEXT pDevExt, VBoxGuestMouseSetNotifyCallback *pNotify);
+#endif
+
 RT_C_DECLS_END
 
 #endif
index fd8788088ecbf6b007c3e19099572aaace365506..9122f3e70de1f1c9e16c2ef7a6005763aba23aae 100644 (file)
@@ -1 +1 @@
-#define VBOX_SVN_REV 110634
+#define VBOX_SVN_REV 112026
index 9ae8588fc28cd685ef2ad0ee89830e42f048e96f..eabe4fb06ef3eac9dc6eb6e5f998f9b2ceb47327 100644 (file)
@@ -3,9 +3,9 @@
 
 #define VBOX_VERSION_MAJOR 5
 #define VBOX_VERSION_MINOR 1
-#define VBOX_VERSION_BUILD 6
-#define VBOX_VERSION_STRING_RAW "5.1.6"
-#define VBOX_VERSION_STRING "5.1.6_Ubuntu"
+#define VBOX_VERSION_BUILD 10
+#define VBOX_VERSION_STRING_RAW "5.1.10"
+#define VBOX_VERSION_STRING "5.1.10_Ubuntu"
 #define VBOX_API_VERSION_STRING "5_1"
 
 #define VBOX_PRIVATE_BUILD_DESC "Private build by root"
index 571f807e8ed3630be81987564a066f638d3cb1e5..0267b0b9fa63e9634f2df1a957097ed4570ffa27 100644 (file)
@@ -745,16 +745,29 @@ static int sf_rmdir(struct inode *parent, struct dentry *dentry)
  * @param old_dentry    old directory cache entry
  * @param new_parent    inode of the new parent directory
  * @param new_dentry    new directory cache entry
+ * @param flags         flags
  * @returns 0 on success, Linux error code otherwise
  */
 static int sf_rename(struct inode *old_parent, struct dentry *old_dentry,
-                     struct inode *new_parent, struct dentry *new_dentry)
+                     struct inode *new_parent, struct dentry *new_dentry
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+                     , unsigned flags
+#endif
+                     )
 {
     int err = 0, rc = VINF_SUCCESS;
     struct sf_glob_info *sf_g = GET_GLOB_INFO(old_parent->i_sb);
 
     TRACE();
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+    if (flags)
+    {
+        LogFunc(("rename with flags=%x\n", flags));
+        return -EINVAL;
+    }
+#endif
+
     if (sf_g != GET_GLOB_INFO(new_parent->i_sb))
     {
         LogFunc(("rename with different roots\n"));
index fd8788088ecbf6b007c3e19099572aaace365506..9122f3e70de1f1c9e16c2ef7a6005763aba23aae 100644 (file)
@@ -1 +1 @@
-#define VBOX_SVN_REV 110634
+#define VBOX_SVN_REV 112026
index 9ae8588fc28cd685ef2ad0ee89830e42f048e96f..eabe4fb06ef3eac9dc6eb6e5f998f9b2ceb47327 100644 (file)
@@ -3,9 +3,9 @@
 
 #define VBOX_VERSION_MAJOR 5
 #define VBOX_VERSION_MINOR 1
-#define VBOX_VERSION_BUILD 6
-#define VBOX_VERSION_STRING_RAW "5.1.6"
-#define VBOX_VERSION_STRING "5.1.6_Ubuntu"
+#define VBOX_VERSION_BUILD 10
+#define VBOX_VERSION_STRING_RAW "5.1.10"
+#define VBOX_VERSION_STRING "5.1.10_Ubuntu"
 #define VBOX_API_VERSION_STRING "5_1"
 
 #define VBOX_PRIVATE_BUILD_DESC "Private build by root"
index fd8788088ecbf6b007c3e19099572aaace365506..9122f3e70de1f1c9e16c2ef7a6005763aba23aae 100644 (file)
@@ -1 +1 @@
-#define VBOX_SVN_REV 110634
+#define VBOX_SVN_REV 112026
index 8a1cba5a1921e377360468f7d532d8169a1c25d3..91b9de5bc146552ac5618a2e27c05bde78cc7145 100644 (file)
@@ -241,6 +241,16 @@ static int vbox_master_set(struct drm_device *dev,
      * do not advertise dynamic modes on the first query and send a
      * tentative hotplug notification after that to see if they query again. */
     vbox->initial_mode_queried = false;
+    mutex_lock(&vbox->hw_mutex);
+    /* Disable VBVA when someone releases master in case the next person tries
+     * to do VESA. */
+    /** @todo work out if anyone is likely to and whether it will even work. */
+    /* Update: we also disable it because if the new master does not do dirty
+     * rectangle reporting (e.g. old versions of Plymouth) then at least the
+     * first screen will still be updated.  We enable it as soon as we
+     * receive a dirty rectangle report. */
+    vbox_disable_accel(vbox);
+    mutex_unlock(&vbox->hw_mutex);
     return 0;
 }
 
@@ -254,15 +264,9 @@ static void vbox_master_drop(struct drm_device *dev,
 #endif
 {
     struct vbox_private *vbox = dev->dev_private;
+    /* See vbox_master_set() */
     vbox->initial_mode_queried = false;
     mutex_lock(&vbox->hw_mutex);
-    /* Disable VBVA when someone releases master in case the next person tries
-     * to do VESA. */
-    /** @todo work out if anyone is likely to and whether it will even work. */
-    /* Update: we also disable it because if the new master does not do dirty
-     * rectangle reporting (e.g. old versions of Plymouth) then at least the
-     * first screen will still be updated.  We enable it as soon as we
-     * receive a dirty rectangle report. */
     vbox_disable_accel(vbox);
     mutex_unlock(&vbox->hw_mutex);
 }
@@ -303,8 +307,6 @@ static struct drm_driver driver =
 
 static int __init vbox_init(void)
 {
-    unsigned i;
-
 #ifdef CONFIG_VGA_CONSOLE
     if (vgacon_text_force() && vbox_modeset == -1)
         return -EINVAL;
@@ -313,12 +315,6 @@ static int __init vbox_init(void)
     if (vbox_modeset == 0)
         return -EINVAL;
 
-    /* Do not load if any of the virtual consoles is in graphics mode to be
-     * sure that we do not pick a fight with a user-mode driver or VESA. */
-    for (i = 0; i < MAX_NR_CONSOLES - 1; ++i)
-        if (vc_cons[i].d && vc_cons[i].d->vc_mode == KD_GRAPHICS)
-            return -EINVAL;
-
     return drm_pci_init(&driver, &vbox_pci_driver);
 }
 static void __exit vbox_exit(void)
index c3044ff11055a104d7d889b680917520877bc3c2..f47e11ac04480cf2d0aa550ff8a9931fc8b76626 100644 (file)
@@ -214,7 +214,7 @@ extern void vbox_mode_fini(struct drm_device *dev);
 
 void vbox_enable_accel(struct vbox_private *vbox);
 void vbox_disable_accel(struct vbox_private *vbox);
-void vbox_enable_caps(struct vbox_private *vbox);
+void vbox_report_caps(struct vbox_private *vbox);
 
 void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb,
                                        struct drm_clip_rect *rects,
index 86562de76a501783ac6f2e737bf404c0fc170ff8..b85e09191fb47a3d7694482d1c0f23784ea03034 100644 (file)
@@ -92,9 +92,9 @@ void vbox_disable_accel(struct vbox_private *vbox)
         VBoxVBVADisable(&vbox->vbva_info[i], &vbox->submit_info, i);
 }
 
-void vbox_enable_caps(struct vbox_private *vbox)
+void vbox_report_caps(struct vbox_private *vbox)
 {
-    uint32_t caps =   VBVACAPS_DISABLE_CURSOR_INTEGRATION
+    uint32_t caps =    VBVACAPS_DISABLE_CURSOR_INTEGRATION
                      | VBVACAPS_IRQ
                      | VBVACAPS_USE_VBVA_ONLY;
     if (vbox->initial_mode_queried)
index 031c8a5d9eb647da410070df8c467e2d73c075a0..ad8a717eaa97d6bd7a5d00654d9c4bb05be4fffd 100644 (file)
@@ -106,8 +106,6 @@ static void vbox_do_modeset(struct drm_crtc *crtc,
                                 crtc->x * bpp / 8 + crtc->y * pitch,
                                 pitch, width, height,
                                 vbox_crtc->blanked ? 0 : bpp, flags);
-    VBoxHGSMIReportFlagsLocation(&vbox->submit_info,   vbox->vram_map_start
-                                                     + vbox->host_flags_offset);
     LogFunc(("vboxvideo: %d\n", __LINE__));
 }
 
@@ -502,8 +500,20 @@ static int vbox_get_modes(struct drm_connector *connector)
     LogFunc(("vboxvideo: %d: connector=%p\n", __LINE__, connector));
     vbox_connector = to_vbox_connector(connector);
     vbox = connector->dev->dev_private;
+    /* Heuristic: we do not want to tell the host that we support dynamic
+     * resizing unless we feel confident that the user space client using
+     * the video driver can handle hot-plug events.  So the first time modes
+     * are queried after a "master" switch we tell the host that we do not,
+     * and immediately after we send the client a hot-plug notification as
+     * a test to see if they will respond and query again.
+     * That is also the reason why capabilities are reported to the host at
+     * this place in the code rather than elsewhere.
+     * We need to report the flags location before reporting the IRQ
+     * capability. */
+    VBoxHGSMIReportFlagsLocation(&vbox->submit_info,   vbox->vram_map_start
+                                                     + vbox->host_flags_offset);
     if (vbox_connector->vbox_crtc->crtc_id == 0)
-        vbox_enable_caps(vbox);
+        vbox_report_caps(vbox);
     if (!vbox->initial_mode_queried) {
         if (vbox_connector->vbox_crtc->crtc_id == 0) {
             vbox->initial_mode_queried = true;
@@ -720,7 +730,9 @@ static int vbox_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv,
         return ret;
     if (   caps & VMMDEV_MOUSE_HOST_CANNOT_HWPOINTER
         || !(caps & VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE))
-        return -EINVAL;
+        /* -EINVAL means cursor_set2() not supported, -EAGAIN means
+         * retry at once. */
+        return -EBUSY;
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
     obj = drm_gem_object_lookup(file_priv, handle);
index 74f9f5a7c3c7c59c3400b4068b8822a5a5f89830..0e23acdb7796e4734e06b7e22826e7343cbe4f87 100644 (file)
@@ -223,8 +223,10 @@ static int vbox_bo_move(struct ttm_buffer_object *bo,
     int r;
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
     r = ttm_bo_move_memcpy(bo, evict, no_wait_gpu, new_mem);
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
     r = ttm_bo_move_memcpy(bo, evict, interruptible, no_wait_gpu, new_mem);
+#else
+    r = ttm_bo_move_memcpy(bo, interruptible, no_wait_gpu, new_mem);
 #endif
     return r;
 }
index 9ae8588fc28cd685ef2ad0ee89830e42f048e96f..eabe4fb06ef3eac9dc6eb6e5f998f9b2ceb47327 100644 (file)
@@ -3,9 +3,9 @@
 
 #define VBOX_VERSION_MAJOR 5
 #define VBOX_VERSION_MINOR 1
-#define VBOX_VERSION_BUILD 6
-#define VBOX_VERSION_STRING_RAW "5.1.6"
-#define VBOX_VERSION_STRING "5.1.6_Ubuntu"
+#define VBOX_VERSION_BUILD 10
+#define VBOX_VERSION_STRING_RAW "5.1.10"
+#define VBOX_VERSION_STRING "5.1.10_Ubuntu"
 #define VBOX_API_VERSION_STRING "5_1"
 
 #define VBOX_PRIVATE_BUILD_DESC "Private build by root"