Index: /trunk/src/VBox/Devices/PC/DevPit-i8254.cpp
===================================================================
--- /trunk/src/VBox/Devices/PC/DevPit-i8254.cpp	(revision 35177)
+++ /trunk/src/VBox/Devices/PC/DevPit-i8254.cpp	(revision 35178)
@@ -88,4 +88,6 @@
 #endif
 
+/** The effective counter mode - if bit 1 is set, bit 2 is ignored. */
+#define EFFECTIVE_MODE(x)   ((x) & ~(((x) & 2) << 1))
 
 /*******************************************************************************
@@ -188,5 +190,5 @@
     PTMTIMER pTimer = s->CTX_SUFF(pPit)->channels[0].CTX_SUFF(pTimer);
 
-    if (s->mode == 2)
+    if (EFFECTIVE_MODE(s->mode) == 2)
     {
         if (s->u64NextTS == UINT64_MAX)
@@ -205,5 +207,5 @@
     }
     d = ASMMultU64ByU32DivByU32(TMTimerGet(pTimer) - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));
-    switch(s->mode) {
+    switch(EFFECTIVE_MODE(s->mode)) {
     case 0:
     case 1:
@@ -232,5 +234,5 @@
 
     d = ASMMultU64ByU32DivByU32(current_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));
-    switch(s->mode) {
+    switch(EFFECTIVE_MODE(s->mode)) {
     default:
     case 0:
@@ -293,5 +295,5 @@
     Assert((val & 1) == val);
 
-    switch(s->mode) {
+    switch(EFFECTIVE_MODE(s->mode)) {
     default:
     case 0:
@@ -357,5 +359,5 @@
 
     d = ASMMultU64ByU32DivByU32(current_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));
-    switch(s->mode) {
+    switch(EFFECTIVE_MODE(s->mode)) {
     default:
     case 0:
@@ -436,5 +438,5 @@
         pDevIns = s->CTX_SUFF(pPit)->pDevIns;
 
-        if (s->mode == 2)
+        if (EFFECTIVE_MODE(s->mode) == 2)
         {
             /* We just flip-flop the irq level to save that extra timer call, which isn't generally required (we haven't served it for years). */
