VirtualBox

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


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

CPU hotplug: Reduce the amount of AML code interpreted by the guest and the number of context switches during hot-add events

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

Legend:

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

    r26592 r26594  
    142142enum
    143143{
     144    CPU_EVENT_TYPE_ADD                  = 0x01, /**< Event type add */
     145    CPU_EVENT_TYPE_REMOVE               = 0x03  /**< Event type remove */
     146};
     147
     148enum
     149{
    144150    SYSTEM_INFO_INDEX_LOW_MEMORY_LENGTH = 0,
    145151    SYSTEM_INFO_INDEX_USE_IOAPIC        = 1,
     
    155161    SYSTEM_INFO_INDEX_CPU_LOCKED        = 11, /**< Contains a flag indicating whether the CPU is locked or not */
    156162    SYSTEM_INFO_INDEX_CPU_LOCK_CHECK    = 12, /**< For which CPU the lock status should be checked */
     163    SYSTEM_INFO_INDEX_CPU_EVENT_TYPE    = 13, /**< Type of the CPU hot-plug event */
     164    SYSTEM_INFO_INDEX_CPU_EVENT         = 14, /**< The CPU id the event is for */
    157165    SYSTEM_INFO_INDEX_END               = 15,
    158166    SYSTEM_INFO_INDEX_INVALID           = 0x80,
     
    242250    /** Mask of locked CPUs (used by the guest) */
    243251    VMCPUSET            CpuSetLocked;
     252    /** The CPU event type */
     253    uint32_t            u32CpuEventType;
     254    /** The CPU id affected */
     255    uint32_t            u32CpuEvent;
    244256    /** Flag whether CPU hot plugging is enabled */
    245257    bool                fCpuHotPlug;
     
    14911503                }
    14921504
     1505                case SYSTEM_INFO_INDEX_CPU_EVENT_TYPE:
     1506                {
     1507                    *pu32 = s->u32CpuEventType;
     1508                    break;
     1509                }
     1510
     1511                case SYSTEM_INFO_INDEX_CPU_EVENT:
     1512                {
     1513                    *pu32 = s->u32CpuEvent;
     1514                    break;
     1515                }
     1516
    14931517                /* Solaris 9 tries to read from this index */
    14941518                case SYSTEM_INFO_INDEX_INVALID:
     
    21872211         */
    21882212        VMCPUSET_ADD(&s->CpuSetLocked, iLUN);
     2213        s->u32CpuEventType = CPU_EVENT_TYPE_ADD;
     2214        s->u32CpuEvent     = iLUN;
    21892215        /* Notify the guest */
    21902216        update_gpe0(s, s->gpe0_sts | 0x2, s->gpe0_en);
     
    23562382    VMCPUSET_EMPTY(&s->CpuSetLocked);
    23572383    s->idCpuLockCheck = UINT32_C(0xffffffff);
     2384    s->u32CpuEventType = 0;
     2385    s->u32CpuEvent     = UINT32_C(0xffffffff);
    23582386
    23592387    /* The first CPU can't be attached/detached */
  • trunk/src/VBox/Devices/PC/vbox-cpuhotplug.dsl

    r26593 r26594  
    2222    External(\_SB.CPUC)
    2323    External(\_SB.CPUL)
     24    External(\_SB.CPEV)
     25    External(\_SB.CPET)
    2426
    2527    // Method to check for the CPU status
     
    131133    {
    132134
    133 #define CHECK_CPU(cpu, sck)    \
    134     IF (CPCK(cpu))             \
    135     {                          \
    136         Notify (\_SB.sck, 0x1) \
    137     }                          \
     135#define CHECK_CPU(cpu, sck)          \
     136    IF (LEqual(Local0, cpu))      \
     137    {                                \
     138        Notify (\_SB.sck, Local1) \
     139    }                                \
    138140
    139141        // GPE bit 1 handler
     
    143145        Method (_L01, 0, NotSerialized)
    144146        {
    145             /*Store(\_SB.CPET, Local0)*/
    146             /*Store(\_SB.CPEV, Local1)*/
     147            Store(\_SB.CPEV, Local0)
     148            Store(\_SB.CPET, Local1)
    147149
    148150            CHECK_CPU(0x01, SCK1)
  • trunk/src/VBox/Devices/PC/vbox.dsl

    r26183 r26594  
    146146            CPUL,  32,
    147147            CPUC,  32,
     148            CPET,  32,
     149            CPEV,  32,
    148150            Offset (0x80),
    149151            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