VirtualBox

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


Ignore:
Timestamp:
Oct 1, 2008 3:11:15 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
37263
Message:

fixed Ubuntu crash in debug VBox (although true reason why we're
getting bogus values into MMIO writes sometimes is still unclear)

File:
1 edited

Legend:

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

    r12667 r12869  
    789789    memset(s->tmr, 0, sizeof(s->tmr));
    790790    memset(s->irr, 0, sizeof(s->irr));
    791     for(i = 0; i < APIC_LVT_NB; i++)
    792         s->lvt[i] = 1 << 16; /* mask LVT */
    793791    s->esr = 0;
    794792    memset(s->icr, 0, sizeof(s->icr));
     
    15611559            default:
    15621560                index = (s->ioregsel - 0x10) >> 1;
    1563                 if (index >= 0 && index < IOAPIC_NUM_PINS) {
     1561                if (index >= 0 && index < IOAPIC_NUM_PINS) {                   
    15641562                    if (s->ioregsel & 1) {
    15651563                        s->ioredtbl[index] &= 0xffffffff;
    15661564                        s->ioredtbl[index] |= (uint64_t)val << 32;
    15671565                    } else {
    1568                         s->ioredtbl[index] &= ~0xffffffffULL;
    1569                         s->ioredtbl[index] |= val;
     1566#ifdef VBOX
     1567                        /* According to IOAPIC spec, vectors should be from 0x10 to 0xfe */
     1568                        uint8_t vec = val & 0xff;
     1569                        if ((vec >= 0x10) && (vec < 0xff))
     1570                        {
     1571                            s->ioredtbl[index] &= ~0xffffffffULL;
     1572                            s->ioredtbl[index] |= val;
     1573                        }
     1574                        else
     1575                        {
     1576                            LogRel(("IOAPIC BUG: bad vector writing %x(sel=%x) to %d\n", val, s->ioregsel, index));
     1577                        }
    15701578                    }
     1579#else
     1580                    s->ioredtbl[index] &= ~0xffffffffULL;
     1581                    s->ioredtbl[index] |= val;
     1582#endif
    15711583                    ioapic_service(s);
    15721584                }
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