Index: /trunk/include/VBox/sup.h
===================================================================
--- /trunk/include/VBox/sup.h	(revision 106634)
+++ /trunk/include/VBox/sup.h	(revision 106635)
@@ -780,5 +780,5 @@
 
 
-#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) || defined(RT_ARCH_ARM64) ||defined(RT_ARCH_ARM32)
+#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) || defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32)
 
 /** @internal */
@@ -793,15 +793,11 @@
 DECLINLINE(uint64_t) SUPReadTsc(void)
 {
-# if defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32)  /** @todo portme: ring-0 arm. */
-    return ASMReadTSC();
-# else
     PSUPGLOBALINFOPAGE pGip = g_pSUPGlobalInfoPage;
     if (!pGip || pGip->enmUseTscDelta <= SUPGIPUSETSCDELTA_ROUGHLY_ZERO)
         return ASMReadTSC();
     return SUPReadTscWithDelta(pGip);
-# endif
 }
 
-#endif /* X86 || AMD64 || ARM */
+#endif /* X86 || AMD64 || ARM64 || ARM32 */
 
 /** @internal */
Index: /trunk/src/VBox/HostDrivers/Support/Makefile.kmk
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/Makefile.kmk	(revision 106634)
+++ /trunk/src/VBox/HostDrivers/Support/Makefile.kmk	(revision 106635)
@@ -764,4 +764,6 @@
    	$(PATH_SDK_$(VBOX_WINDDK)_LIB)/BufferOverflowK.lib
   endif
+  VBoxDrv_LIBS.win.arm64  = \
+  	$(PATH_SDK_$(VBOX_WINDDK)_LIB)/BufferOverflowFastFailK.lib
 
   #VBoxDrv_LDFLAGS.darwin   = -Wl,-sectcreate,__TEXT,__info_plist,$(VBoxDrv.kext_0_OUTDIR)/Info.plist
Index: /trunk/src/VBox/HostDrivers/Support/SUPLibAll.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/SUPLibAll.cpp	(revision 106634)
+++ /trunk/src/VBox/HostDrivers/Support/SUPLibAll.cpp	(revision 106635)
@@ -49,4 +49,6 @@
 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
 # include <iprt/asm-amd64-x86.h>
+#elif defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32)
+# include <iprt/asm-arm.h>
 #endif
 #include <iprt/errcore.h>
@@ -57,5 +59,5 @@
 
 
-#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
+#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) || defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32)
 /**
  * The slow case for SUPReadTsc where we need to apply deltas.
@@ -83,5 +85,6 @@
      * Read the TSC and get the corresponding aCPUs index.
      */
-#ifdef IN_RING3
+# ifdef IN_RING3
+#  if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
     if (pGip->fGetGipCpu & SUPGIPGETCPU_RDTSCP_MASK_MAX_SET_CPUS)
     {
@@ -163,5 +166,5 @@
         for (;;)
         {
-            uint8_t idApic = ASMGetApicId();
+            uint8_t const idApic = ASMGetApicId();
             uTsc = ASMReadTSC();
             if (RT_LIKELY(ASMGetApicId() == idApic))
@@ -178,4 +181,49 @@
         }
     }
+
+#  else /* !AMD64 || !X86 */
+#   if defined(RT_OS_WINDOWS)
+    /* Use TPIDRRO_EL0 (=cpu number) before and after reading the TSC. */
+    uint32_t cTries = 0;
+    for (;;)
+    {
+        RTCCUINTREG const idApic = ASMGetThreadIdRoEL0();
+        uTsc = ASMReadTSC();
+        if (RT_LIKELY(ASMGetThreadIdRoEL0() == idApic))
+        {
+            AssertBreakStmt(idApic < RT_ELEMENTS(pGip->aiCpuFromApicId), iGipCpu = UINT16_MAX);
+            iGipCpu = pGip->aiCpuFromApicId[idApic & 0xffff];
+            break;
+        }
+        if (cTries >= 16)
+        {
+            iGipCpu = UINT16_MAX;
+            break;
+        }
+        cTries++;
+    }
+#   else
+    /* Use RTMpCpuId before and after reading the TSC. */
+    uint32_t cTries = 0;
+    for (;;)
+    {
+        RTCPUID const idCpu = RTMpCpuId();
+        uTsc = ASMReadTSC();
+        if (RT_LIKELY(RTMpCpuId() == idCpu))
+        {
+            int const iCpuSet = RTMpCpuIdToSetIndex(idCpu);
+            iGipCpu = pGip->aiCpuFromCpuSetIdx[iCpuSet];
+            break;
+        }
+        if (cTries >= 16)
+        {
+            iGipCpu = UINT16_MAX;
+            break;
+        }
+        cTries++;
+    }
+#   endif
+#  endif /* !AMD64 || !X86 */
+
 #elif defined(IN_RING0)
     /* Ring-0: Use use RTMpCpuId(), no loops. */
@@ -234,5 +282,5 @@
 SUPR0_EXPORT_SYMBOL(SUPReadTscWithDelta);
 # endif
-#endif /* RT_ARCH_AMD64 || RT_ARCH_X86 */
+#endif /* defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) || defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32) */
 
 
Index: /trunk/src/VBox/Runtime/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Runtime/Makefile.kmk	(revision 106634)
+++ /trunk/src/VBox/Runtime/Makefile.kmk	(revision 106635)
@@ -3712,11 +3712,15 @@
 	VBox/RTLogWriteVmm-amd64-x86.asm
 RuntimeR0Drv_SOURCES.arm32 += \
-	common/string/RTStrEnd.cpp
+	common/string/RTStrEnd.cpp \
+	common/asm/ASMMultU64ByU32DivByU32-generic.cpp
 RuntimeR0Drv_SOURCES.arm64 += \
-	common/string/RTStrEnd.cpp
+	common/string/RTStrEnd.cpp \
+	common/asm/ASMMultU64ByU32DivByU32-generic.cpp
 RuntimeR0Drv_SOURCES.sparc32 += \
-	common/string/RTStrEnd.cpp
+	common/string/RTStrEnd.cpp \
+	common/asm/ASMMultU64ByU32DivByU32-generic.cpp
 RuntimeR0Drv_SOURCES.sparc64 += \
-	common/string/RTStrEnd.cpp
+	common/string/RTStrEnd.cpp \
+	common/asm/ASMMultU64ByU32DivByU32-generic.cpp
 
 RuntimeR0Drv_SOURCES.linux = \
