VirtualBox

Changeset 2541 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
May 8, 2007 4:15:28 PM (18 years ago)
Author:
vboxsync
Message:

Don't enable the Local APIC on non-{Intel,AMD} cpus. The Linux code gets confused otherwise. This is a bug in the Linux code but Windows is also known for such assumptions. This makes, for instance, DSL boot in VIA CPUs boot again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r2299 r2541  
    900900         */
    901901        case CPUMCPUIDFEATURE_APIC:
    902             if (pVM->cpum.s.aGuestCpuIdStd[0].eax >= 1)
     902            /* Don't enable the Local APIC for non-{Intel,AMD} CPUs. Linux (checked with 2.4.26
     903             * and 2.6.21, see apic.c, detect_init_APIC()) gets confused otherwiese. Of course
     904             * this is a bug in the Linux code (it should trust the CPUID instruction) but Windows
     905             * is also known for such assumptions.
     906             * On the other hand we could depend on the APIC set in the host's CPUID but this APIC
     907             * might be (soft) disabled and we want to provide an APIC to the guest if possible. */
     908            if (  (   (   pVM->cpum.s.aGuestCpuIdStd[0].ebx == 0x756e6547 /* Genu */
     909                       && pVM->cpum.s.aGuestCpuIdStd[0].ecx == 0x6c65746e /* ineI */
     910                       && pVM->cpum.s.aGuestCpuIdStd[0].edx == 0x49656e69 /* ntel */)
     911                   || (   pVM->cpum.s.aGuestCpuIdStd[0].ebx == 0x68747541 /* Auth */
     912                       && pVM->cpum.s.aGuestCpuIdStd[0].ebx == 0x69746e65 /* enti */
     913                       && pVM->cpum.s.aGuestCpuIdStd[0].ebx == 0x444d4163 /* cAMD */))
     914                && pVM->cpum.s.aGuestCpuIdStd[0].eax >= 1)
    903915                pVM->cpum.s.aGuestCpuIdStd[1].edx |= X86_CPUID_FEATURE_EDX_APIC;
    904916            if (    pVM->cpum.s.aGuestCpuIdExt[0].eax >= 0x80000001
Note: See TracChangeset for help on using the changeset viewer.

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