VirtualBox

Changeset 26115 in vbox for trunk/src/VBox/Devices/PC


Ignore:
Timestamp:
Feb 1, 2010 11:19:57 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57104
Message:

ACPI: reverted hotplug changes until they get fixed (r57068, r57069, r57071)

Location:
trunk/src/VBox/Devices/PC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/ACPI/VBoxAcpi.cpp

    r26095 r26115  
    4242/* Statically compiled AML */
    4343# include <vboxaml.hex>
    44 # include <vboxssdt-standard.hex>
    45 # include <vboxssdt-cpuhotplug.hex>
    4644#endif
    4745
     
    139137#endif
    140138
    141 /**
    142  * Loads an AML file if present in CFGM
    143  *
    144  * @returns VBox status code
    145  * @param   pDevIns        The device instance
    146  * @param   pcszCfgName    The configuration key holding the file path
    147  * @param   pcszSignature  The signature to check for
    148  * @param   ppbAmlCode     Where to store the pointer to the AML code on success.
    149  * @param   pcbAmlCode     Where to store the number of bytes of the AML code on success.
    150  */
    151 static int acpiAmlLoadExternal(PPDMDEVINS pDevIns, const char *pcszCfgName, const char *pcszSignature, uint8_t **ppbAmlCode, size_t *pcbAmlCode)
    152 {
     139/* Two only public functions */
     140int acpiPrepareDsdt(PPDMDEVINS pDevIns,  void * *ppPtr, size_t *puDsdtLen)
     141{
     142#ifdef VBOX_WITH_DYNAMIC_DSDT
     143    return prepareDynamicDsdt(pDevIns, ppPtr, puDsdtLen);
     144#else
    153145    uint8_t *pbAmlCode = NULL;
    154146    size_t cbAmlCode = 0;
    155147    char *pszAmlFilePath = NULL;
    156     int rc = CFGMR3QueryStringAlloc(pDevIns->pCfgHandle, pcszCfgName, &pszAmlFilePath);
    157 
     148    int rc = CFGMR3QueryStringAlloc(pDevIns->pCfgHandle, "AmlFilePath", &pszAmlFilePath);
    158149    if (RT_SUCCESS(rc))
    159150    {
     
    187178                     */
    188179                    if (   RT_FAILURE(rc)
    189                         || strncmp((const char *)pbAmlCode, pcszSignature, 4))
     180                        || strncmp((const char *)pbAmlCode, "DSDT", 4))
    190181                    {
    191182                        RTMemFree(pbAmlCode);
     
    195186                        if (RT_SUCCESS(rc))
    196187                            rc = VERR_PARSE_ERROR;
    197                     }
    198                     else
    199                     {
    200                         *ppbAmlCode = pbAmlCode;
    201                         *pcbAmlCode = cbAmlCode;
    202                         rc = VINF_SUCCESS;
    203188                    }
    204189                }
     
    211196        MMR3HeapFree(pszAmlFilePath);
    212197    }
    213 
    214     return rc;
    215 }
    216 
    217 /* Two only public functions */
    218 int acpiPrepareDsdt(PPDMDEVINS pDevIns,  void * *ppPtr, size_t *puDsdtLen)
    219 {
    220 #ifdef VBOX_WITH_DYNAMIC_DSDT
    221     return prepareDynamicDsdt(pDevIns, ppPtr, puDsdtLen);
    222 #else
    223     uint8_t *pbAmlCodeDsdt = NULL;
    224     size_t cbAmlCodeDsdt = 0;
    225     int rc = acpiAmlLoadExternal(pDevIns, "DsdtFilePath", "DSDT", &pbAmlCodeDsdt, &cbAmlCodeDsdt);
    226 
    227     if (rc == VERR_CFGM_VALUE_NOT_FOUND)
     198    else if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    228199    {
    229200        rc = VINF_SUCCESS;
    230201
    231202        /* Use the compiled in AML code */
    232         cbAmlCodeDsdt = sizeof(AmlCode);
    233         pbAmlCodeDsdt = (uint8_t *)RTMemAllocZ(cbAmlCodeDsdt);
    234         if (pbAmlCodeDsdt)
    235             memcpy(pbAmlCodeDsdt, AmlCode, cbAmlCodeDsdt);
     203        cbAmlCode = sizeof(AmlCode);
     204        pbAmlCode = (uint8_t *)RTMemAllocZ(cbAmlCode);
     205        if (pbAmlCode)
     206            memcpy(pbAmlCode, AmlCode, cbAmlCode);
    236207        else
    237208            rc = VERR_NO_MEMORY;
     
    239210    else if (RT_FAILURE(rc))
    240211        return PDMDEV_SET_ERROR(pDevIns, rc,
    241                                 N_("Configuration error: Failed to read \"DsdtFilePath\""));
     212                                N_("Configuration error: Failed to read \"AmlFilePath\""));
    242213
    243214    if (RT_SUCCESS(rc))
    244215    {
    245         patchAml(pDevIns, pbAmlCodeDsdt, cbAmlCodeDsdt);
    246         *ppPtr = pbAmlCodeDsdt;
    247         *puDsdtLen = cbAmlCodeDsdt;
     216        patchAml(pDevIns, pbAmlCode, cbAmlCode);
     217        *ppPtr = pbAmlCode;
     218        *puDsdtLen = cbAmlCode;
    248219    }
    249220    return rc;
     
    262233}
    263234
    264 int acpiPrepareSsdt(PPDMDEVINS pDevIns, void* *ppPtr, size_t *puSsdtLen)
    265 {
    266     uint8_t *pbAmlCodeSsdt = NULL;
    267     size_t   cbAmlCodeSsdt = 0;
    268     int rc = acpiAmlLoadExternal(pDevIns, "SsdtFilePath", "SSDT", &pbAmlCodeSsdt, &cbAmlCodeSsdt);
    269 
    270     if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    271     {
    272         bool fCpuHotPlug = false;
    273         uint8_t *pbAmlCode = NULL;
    274         rc = CFGMR3QueryBoolDef(pDevIns->pCfgHandle, "CpuHotPlug", &fCpuHotPlug, false);
    275 
    276         if (RT_FAILURE(rc))
    277             return rc;
    278 
    279         if (fCpuHotPlug)
    280         {
    281             pbAmlCode     = AmlCodeSsdtCpuHotPlug;
    282             cbAmlCodeSsdt = sizeof(AmlCodeSsdtCpuHotPlug);
    283         }
    284         else
    285         {
    286             pbAmlCode     = AmlCodeSsdtStandard;
    287             cbAmlCodeSsdt = sizeof(AmlCodeSsdtStandard);
    288         }
    289 
    290         pbAmlCodeSsdt = (uint8_t *)RTMemAllocZ(cbAmlCodeSsdt);
    291         if (pbAmlCodeSsdt)
    292             memcpy(pbAmlCodeSsdt, pbAmlCode, cbAmlCodeSsdt);
    293         else
    294             rc = VERR_NO_MEMORY;
    295     }
    296     else if (RT_FAILURE(rc))
    297         return PDMDEV_SET_ERROR(pDevIns, rc,
    298                                 N_("Configuration error: Failed to read \"SsdtFilePath\""));
    299 
    300     if (RT_SUCCESS(rc))
    301     {
    302         patchAml(pDevIns, pbAmlCodeSsdt, cbAmlCodeSsdt);
    303         *ppPtr = pbAmlCodeSsdt;
    304         *puSsdtLen = cbAmlCodeSsdt;
    305     }
    306 
    307     return VINF_SUCCESS;
    308 }
    309 
    310 int acpiCleanupSsdt(PPDMDEVINS pDevIns, void* pPtr)
    311 {
    312     if (pPtr)
    313         RTMemFree(pPtr);
    314     return VINF_SUCCESS;
    315 }
    316 
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r26095 r26115  
    4545int acpiPrepareDsdt(PPDMDEVINS pDevIns, void* *ppPtr, size_t *puDsdtLen);
    4646int acpiCleanupDsdt(PPDMDEVINS pDevIns, void* pPtr);
    47 
    48 int acpiPrepareSsdt(PPDMDEVINS pDevIns, void* *ppPtr, size_t *puSsdtLen);
    49 int acpiCleanupSsdt(PPDMDEVINS pDevIns, void* pPtr);
    5047#endif /* !IN_RING3 */
    5148
     
    685682}
    686683
    687 /** Secondary System Description Table (SSDT) */
    688 
    689 static void acpiSetupSSDT(ACPIState *s, RTGCPHYS32 addr,
    690                             void* pPtr, size_t uSsdtLen)
    691 {
    692     acpiPhyscpy(s, addr, pPtr, uSsdtLen);
    693 }
    694 
    695684/** Firmware ACPI Control Structure (FACS) */
    696685static void acpiSetupFACS(ACPIState *s, RTGCPHYS32 addr)
     
    19511940    int        rc;
    19521941    RTGCPHYS32 GCPhysCur, GCPhysRsdt, GCPhysXsdt, GCPhysFadtAcpi1, GCPhysFadtAcpi2, GCPhysFacs, GCPhysDsdt;
    1953     RTGCPHYS32 GCPhysHpet = 0, GCPhysApic = 0, GCPhysSsdt = 0;
     1942    RTGCPHYS32 GCPhysHpet = 0, GCPhysApic = 0;
    19541943    uint32_t   addend = 0;
    19551944    RTGCPHYS32 aGCPhysRsdt[4];
    19561945    RTGCPHYS32 aGCPhysXsdt[4];
    1957     uint32_t   cAddr, iMadt = 0, iHpet = 0, iSsdt = 0;
     1946    uint32_t   cAddr, iMadt = 0, iHpet = 0;
    19581947    size_t     cbRsdt = sizeof(ACPITBLHEADER);
    19591948    size_t     cbXsdt = sizeof(ACPITBLHEADER);
     
    19651954    if (s->fUseHpet)
    19661955        iHpet = cAddr++;        /* HPET */
    1967 
    1968     iSsdt = cAddr++;            /* SSDT */
    19691956
    19701957    cbRsdt += cAddr*sizeof(uint32_t);  /* each entry: 32 bits phys. address. */
     
    20222009        GCPhysCur = RT_ALIGN_32(GCPhysCur + sizeof(ACPITBLHPET), 16);
    20232010    }
    2024 
    2025     void*  pSsdtCode = NULL;
    2026     size_t cbSsdtSize = 0;
    2027     rc = acpiPrepareSsdt(s->pDevIns, &pSsdtCode, &cbSsdtSize);
    2028     if (RT_FAILURE(rc))
    2029         return rc;
    2030 
    2031     GCPhysSsdt = GCPhysCur;
    2032     GCPhysCur = RT_ALIGN_32(GCPhysCur + cbSsdtSize, 16);
    2033 
    20342011    GCPhysDsdt = GCPhysCur;
    20352012
     
    20412018
    20422019    GCPhysCur = RT_ALIGN_32(GCPhysCur + cbDsdtSize, 16);
    2043 
    20442020    if (GCPhysCur > 0x10000)
    20452021        return PDMDEV_SET_ERROR(s->pDevIns, VERR_TOO_MUCH_DATA,
     
    20552031    if (s->fUseHpet)
    20562032        Log((" HPET 0x%08X", GCPhysHpet + addend));
    2057     Log((" SSDT 0x%08X", GCPhysSsdt + addend));
    20582033    Log(("\n"));
    20592034
     
    20782053        aGCPhysXsdt[iHpet] = GCPhysHpet + addend;
    20792054    }
    2080     acpiSetupSSDT(s, GCPhysSsdt + addend, pSsdtCode, cbSsdtSize);
    2081     acpiCleanupSsdt(s->pDevIns, pSsdtCode);
    2082     aGCPhysRsdt[iSsdt] = GCPhysSsdt + addend;
    2083     aGCPhysXsdt[iSsdt] = GCPhysSsdt + addend;
    20842055
    20852056    rc = acpiSetupRSDT(s, GCPhysRsdt + addend, cAddr, aGCPhysRsdt);
  • trunk/src/VBox/Devices/PC/vbox.dsl

    r26095 r26115  
    121121    }
    122122
     123    // Processor object
     124    // #1463: Showing the CPU can make the guest do bad things on it like SpeedStep.
     125    // In this case, XP SP2 contains this buggy Intelppm.sys driver which wants to mess
     126    // with SpeedStep if it finds a CPU object and when it finds out that it can't, it
     127    // tries to unload and crashes (MS probably never tested this code path).
     128    // So we enable this ACPI object only for certain guests, which do need it,
     129    // if by accident Windows guest seen enabled CPU object, just boot from latest
     130    // known good configuration, as it remembers state, even if ACPI object gets disabled.
     131    Scope (\_PR)
     132    {
     133        Processor (CPU0, /* Name */
     134                   0x00, /* Id */
     135                   0x0,  /* Processor IO ports range start */
     136                   0x0   /* Processor IO ports range length */
     137                   )
     138        {
     139        }
     140        Processor (CPU1, /* Name */
     141                   0x01, /* Id */
     142                   0x0,  /* Processor IO ports range start */
     143                   0x0   /* Processor IO ports range length */
     144                   )
     145        {
     146        }
     147        Processor (CPU2, /* Name */
     148                   0x02, /* Id */
     149                   0x0,  /* Processor IO ports range start */
     150                   0x0   /* Processor IO ports range length */
     151                   )
     152        {
     153        }
     154        Processor (CPU3, /* Name */
     155                   0x03, /* Id */
     156                   0x0,  /* Processor IO ports range start */
     157                   0x0   /* Processor IO ports range length */
     158                   )
     159        {
     160        }
     161        Processor (CPU4, /* Name */
     162                   0x04, /* Id */
     163                   0x0,  /* Processor IO ports range start */
     164                   0x0   /* Processor IO ports range length */
     165                   )
     166        {
     167        }
     168        Processor (CPU5, /* Name */
     169                   0x05, /* Id */
     170                   0x0,  /* Processor IO ports range start */
     171                   0x0   /* Processor IO ports range length */
     172                   )
     173        {
     174        }
     175        Processor (CPU6, /* Name */
     176                   0x06, /* Id */
     177                   0x0,  /* Processor IO ports range start */
     178                   0x0   /* Processor IO ports range length */
     179                   )
     180        {
     181        }
     182        Processor (CPU7, /* Name */
     183                   0x07, /* Id */
     184                   0x0,  /* Processor IO ports range start */
     185                   0x0   /* Processor IO ports range length */
     186                   )
     187        {
     188        }
     189        Processor (CPU8, /* Name */
     190                   0x08, /* Id */
     191                   0x0,  /* Processor IO ports range start */
     192                   0x0   /* Processor IO ports range length */
     193                   )
     194        {
     195        }
     196        Processor (CPU9, /* Name */
     197                   0x09, /* Id */
     198                   0x0,  /* Processor IO ports range start */
     199                   0x0   /* Processor IO ports range length */
     200                   )
     201        {
     202        }
     203        Processor (CPUA, /* Name */
     204                   0x0a, /* Id */
     205                   0x0,  /* Processor IO ports range start */
     206                   0x0   /* Processor IO ports range length */
     207                   )
     208        {
     209        }
     210        Processor (CPUB, /* Name */
     211                   0x0b, /* Id */
     212                   0x0,  /* Processor IO ports range start */
     213                   0x0   /* Processor IO ports range length */
     214                   )
     215        {
     216        }
     217        Processor (CPUC, /* Name */
     218                   0x0c, /* Id */
     219                   0x0,  /* Processor IO ports range start */
     220                   0x0   /* Processor IO ports range length */
     221                   )
     222        {
     223        }
     224        Processor (CPUD, /* Name */
     225                   0x0d, /* Id */
     226                   0x0,  /* Processor IO ports range start */
     227                   0x0   /* Processor IO ports range length */
     228                   )
     229        {
     230        }
     231        Processor (CPUE, /* Name */
     232                   0x0e, /* Id */
     233                   0x0,  /* Processor IO ports range start */
     234                   0x0   /* Processor IO ports range length */
     235                   )
     236        {
     237        }
     238        Processor (CPUF, /* Name */
     239                   0x0f, /* Id */
     240                   0x0,  /* Processor IO ports range start */
     241                   0x0   /* Processor IO ports range length */
     242                   )
     243        {
     244        }
     245        Processor (CPUG, /* Name */
     246                   0x10, /* Id */
     247                   0x0,  /* Processor IO ports range start */
     248                   0x0   /* Processor IO ports range length */
     249                   )
     250        {
     251        }
     252        Processor (CPUH, /* Name */
     253                   0x11, /* Id */
     254                   0x0,  /* Processor IO ports range start */
     255                   0x0   /* Processor IO ports range length */
     256                   )
     257        {
     258        }
     259        Processor (CPUI, /* Name */
     260                   0x12, /* Id */
     261                   0x0,  /* Processor IO ports range start */
     262                   0x0   /* Processor IO ports range length */
     263                   )
     264        {
     265        }
     266        Processor (CPUJ, /* Name */
     267                   0x13, /* Id */
     268                   0x0,  /* Processor IO ports range start */
     269                   0x0   /* Processor IO ports range length */
     270                   )
     271        {
     272        }
     273        Processor (CPUK, /* Name */
     274                   0x14, /* Id */
     275                   0x0,  /* Processor IO ports range start */
     276                   0x0   /* Processor IO ports range length */
     277                   )
     278        {
     279        }
     280        Processor (CPUL, /* Name */
     281                   0x15, /* Id */
     282                   0x0,  /* Processor IO ports range start */
     283                   0x0   /* Processor IO ports range length */
     284                   )
     285        {
     286        }
     287        Processor (CPUM, /* Name */
     288                   0x16, /* Id */
     289                   0x0,  /* Processor IO ports range start */
     290                   0x0   /* Processor IO ports range length */
     291                   )
     292        {
     293        }
     294        Processor (CPUN, /* Name */
     295                   0x17, /* Id */
     296                   0x0,  /* Processor IO ports range start */
     297                   0x0   /* Processor IO ports range length */
     298                   )
     299        {
     300        }
     301        Processor (CPUO, /* Name */
     302                   0x18, /* Id */
     303                   0x0,  /* Processor IO ports range start */
     304                   0x0   /* Processor IO ports range length */
     305                   )
     306        {
     307        }
     308        Processor (CPUP, /* Name */
     309                   0x19, /* Id */
     310                   0x0,  /* Processor IO ports range start */
     311                   0x0   /* Processor IO ports range length */
     312                   )
     313        {
     314        }
     315        Processor (CPUQ, /* Name */
     316                   0x1a, /* Id */
     317                   0x0,  /* Processor IO ports range start */
     318                   0x0   /* Processor IO ports range length */
     319                   )
     320        {
     321        }
     322        Processor (CPUR, /* Name */
     323                   0x1b, /* Id */
     324                   0x0,  /* Processor IO ports range start */
     325                   0x0   /* Processor IO ports range length */
     326                   )
     327        {
     328        }
     329        Processor (CPUS, /* Name */
     330                   0x1c, /* Id */
     331                   0x0,  /* Processor IO ports range start */
     332                   0x0   /* Processor IO ports range length */
     333                   )
     334        {
     335        }
     336        Processor (CPUT, /* Name */
     337                   0x1d, /* Id */
     338                   0x0,  /* Processor IO ports range start */
     339                   0x0   /* Processor IO ports range length */
     340                   )
     341        {
     342        }
     343        Processor (CPUU, /* Name */
     344                   0x1e, /* Id */
     345                   0x0,  /* Processor IO ports range start */
     346                   0x0   /* Processor IO ports range length */
     347                   )
     348        {
     349        }
     350        Processor (CPUV, /* Name */
     351                   0x1f, /* Id */
     352                   0x0,  /* Processor IO ports range start */
     353                   0x0   /* Processor IO ports range length */
     354                   )
     355        {
     356        }
     357       
     358    }
     359
    123360    Scope (\_SB)
    124361    {
     
    139376            // @todo: maybe make it bitmask instead?
    140377            UCP0,  32,
    141             UCP1,  32,
    142             UCP2,  32,
    143             UCP3,  32,
     378            UCP1,  32, 
     379            UCP2,  32, 
     380            UCP3,  32, 
    144381            MEMH,  32,
    145382            URTC,  32,
    146             CPUL,  32,
    147             CPUC,  32,
    148383            Offset (0x80),
    149384            ININ, 32,
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette