Index: trunk/src/VBox/Devices/PC/ACPI/VBoxAcpi.cpp
===================================================================
--- trunk/src/VBox/Devices/PC/ACPI/VBoxAcpi.cpp	(revision 20463)
+++ trunk/src/VBox/Devices/PC/ACPI/VBoxAcpi.cpp	(revision 20464)
@@ -40,9 +40,26 @@
 
 #ifdef VBOX_WITH_DYNAMIC_DSDT
+
 static int prepareDynamicDsdt(PPDMDEVINS pDevIns,  
                               void*      *ppPtr, 
                               size_t     *puDsdtLen)
 {
-    //LogRel(("file is %s\n", g_abVboxDslSource));
+    ACPI_STATUS Status = AdInitialize();
+    if (ACPI_FAILURE (Status))
+    {
+        AssertFailed();
+        return VERR_INVALID_PARAMETER;
+    }
+
+    Status = CmDoCompile();
+    AcpiTerminate();
+
+    if (Gbl_ExceptionCount[ASL_ERROR] > 0)
+    {
+        AssertFailed();
+        return VERR_INVALID_PARAMETER;
+    }
+
+    LogRel(("OK file is %s\n", g_abVboxDslSource));
     *ppPtr = NULL;
     *puDsdtLen = 0;
@@ -55,4 +72,74 @@
     return 0;
 }
+
+#else
+static int patchAml(PPDMDEVINS pDevIns, uint8_t* pAml, size_t uAmlLen)
+{
+    uint16_t cNumCpus;
+    int rc;
+    
+    rc = CFGMR3QueryU16Def(pDevIns->pCfgHandle, "NumCPUs", &cNumCpus, 1);
+   
+    if (RT_FAILURE(rc))
+        return rc;
+    
+    /** 
+     * Now search AML for:
+     *  AML_PROCESSOR_OP            (UINT16) 0x5b83
+     * and replace whole block with
+     *  AML_NOOP_OP                 (UINT16) 0xa3 
+     * for VCPU not configured
+     */
+    uint16_t cAcpiCpus = 0;
+    for (uint32_t i = 0; i < uAmlLen - 5; i++)
+    {
+        /*
+         * AML_PROCESSOR_OP 
+         *
+         * DefProcessor := ProcessorOp PkgLength NameString ProcID 
+                             PblkAddr PblkLen ObjectList
+         * ProcessorOp  := ExtOpPrefix 0x83
+         * ProcID       := ByteData
+         * PblkAddr     := DwordData
+         * PblkLen      := ByteData
+         */
+        if ((pAml[i] == 0x5b) && (pAml[i+1] == 0x83))
+        {
+            if ((pAml[i+3] != 'C') || (pAml[i+4] != 'P'))
+                /* false alarm, not named starting CP */
+                continue;
+            
+            /* Maybe use ProcID instead? */
+            cAcpiCpus++;
+            if (cAcpiCpus <= cNumCpus)
+                continue;
+
+            /* Will fill unwanted CPU block with NOOPs */
+            /* 
+             * See 18.2.4 Package Length Encoding in ACPI spec 
+             * for full format 
+             */
+            uint32_t cBytes = pAml[i + 2];
+            AssertReleaseMsg((cBytes >> 6) == 0, 
+                             ("So far, we only understand simple package length"));
+                
+            /* including AML_PROCESSOR_OP itself */
+            for (uint32_t j = 0; j < cBytes + 2; j++)
+                pAml[i+j] = 0xa3;
+
+            /* Can increase i by cBytes + 1, but not really worth it */
+        }
+    }
+
+        
+    /* now recompute checksum, whole file byte sum must be 0 */
+    pAml[9] = 0;
+    signed char         Sum;
+    for (uint32_t i = 0; i < uAmlLen; i++)
+         Sum = (signed char) (Sum + pAml[i]);
+    pAml[9] = (uint8_t) (0 - Sum);
+
+    return 0;
+}
 #endif
 
@@ -63,6 +150,13 @@
     return prepareDynamicDsdt(pDevIns, ppPtr, puDsdtLen);
 #else
-    *ppPtr = AmlCode;
+    int rc;
+    
+    rc = patchAml(pDevIns, &AmlCode[0], sizeof(AmlCode));
+    if (RT_FAILURE(rc))
+        return rc;
+
+    *ppPtr = &AmlCode[0];
     *puDsdtLen = sizeof(AmlCode);
+
     return 0;
 #endif
Index: trunk/src/VBox/Devices/PC/vbox.dsl
===================================================================
--- trunk/src/VBox/Devices/PC/vbox.dsl	(revision 20463)
+++ trunk/src/VBox/Devices/PC/vbox.dsl	(revision 20464)
@@ -126,4 +126,7 @@
     // if by accident Windows guest seen enabled CPU object, just boot from latest
     // known good configuration, as it remembers state, even if ACPI object gets disabled.
+    // WARNING: processor objects _MUST_ be named starting from "CP"
+    // and processor block should not be too long, otherwise 
+    // patching in VBoxAcpi.cpp will fail
     Scope (\_PR)
     {
@@ -142,5 +145,4 @@
                    )
         {
-           Method (_STA) { Return(\_SB.UCP1) }
         }
         Processor (CPU2, /* Name */
@@ -150,5 +152,4 @@
                    )
         {
-           Method (_STA) { Return(\_SB.UCP2) }
         }
         Processor (CPU3, /* Name */
@@ -158,5 +159,88 @@
                    )
         {
-           Method (_STA) { Return(\_SB.UCP3) }
+        }
+        Processor (CPU4, /* Name */
+                   0x04, /* Id */
+                   0x0,  /* Processor IO ports range start */
+                   0x0   /* Processor IO ports range length */
+                   )
+        {
+        }
+        Processor (CPU5, /* Name */
+                   0x05, /* Id */
+                   0x0,  /* Processor IO ports range start */
+                   0x0   /* Processor IO ports range length */
+                   )
+        {
+        }
+        Processor (CPU6, /* Name */
+                   0x06, /* Id */
+                   0x0,  /* Processor IO ports range start */
+                   0x0   /* Processor IO ports range length */
+                   )
+        {
+        }
+        Processor (CPU7, /* Name */
+                   0x07, /* Id */
+                   0x0,  /* Processor IO ports range start */
+                   0x0   /* Processor IO ports range length */
+                   )
+        {
+        }
+        Processor (CPU8, /* Name */
+                   0x08, /* Id */
+                   0x0,  /* Processor IO ports range start */
+                   0x0   /* Processor IO ports range length */
+                   )
+        {
+        }
+        Processor (CPU9, /* Name */
+                   0x09, /* Id */
+                   0x0,  /* Processor IO ports range start */
+                   0x0   /* Processor IO ports range length */
+                   )
+        {
+        }
+        Processor (CPUA, /* Name */
+                   0x0A, /* Id */
+                   0x0,  /* Processor IO ports range start */
+                   0x0   /* Processor IO ports range length */
+                   )
+        {
+        }
+        Processor (CPUB, /* Name */
+                   0x0B, /* Id */
+                   0x0,  /* Processor IO ports range start */
+                   0x0   /* Processor IO ports range length */
+                   )
+        {
+        }
+        Processor (CPUC, /* Name */
+                   0x0C, /* Id */
+                   0x0,  /* Processor IO ports range start */
+                   0x0   /* Processor IO ports range length */
+                   )
+        {
+        }
+        Processor (CPUD, /* Name */
+                   0x0D, /* Id */
+                   0x0,  /* Processor IO ports range start */
+                   0x0   /* Processor IO ports range length */
+                   )
+        {
+        }
+        Processor (CPUE, /* Name */
+                   0x0E, /* Id */
+                   0x0,  /* Processor IO ports range start */
+                   0x0   /* Processor IO ports range length */
+                   )
+        {
+        }
+        Processor (CPUF, /* Name */
+                   0x0F, /* Id */
+                   0x0,  /* Processor IO ports range start */
+                   0x0   /* Processor IO ports range length */
+                   )
+        {
         }
     }
@@ -180,7 +264,4 @@
             // @todo: maybe make it bitmask instead?
             UCP0,  32,
-            UCP1,  32,
-            UCP2,  32,
-            UCP3,  32,
             MEMH,  32,
             URTC,  32,
