VirtualBox

Changeset 49549 in vbox


Ignore:
Timestamp:
Nov 19, 2013 1:28:01 PM (11 years ago)
Author:
vboxsync
Message:

VMM/CPUM/MSRs: when returning the APIC base, don't rely upon the CPUID feature bits but check if a Local APIC is present

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmapi.h

    r46915 r49549  
    4343VMMDECL(int)            PDMGetInterrupt(PVMCPU pVCpu, uint8_t *pu8Interrupt);
    4444VMMDECL(int)            PDMIsaSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level, uint32_t uTagSrc);
     45VMM_INT_DECL(bool)      PDMHasIoApic(PVM pVM);
    4546VMM_INT_DECL(int)       PDMIoApicSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level, uint32_t uTagSrc);
    4647VMM_INT_DECL(int)       PDMIoApicSendMsi(PVM pVM, RTGCPHYS GCAddr, uint32_t uValue, uint32_t uTagSrc);
    47 VMM_INT_DECL(bool)      PDMHasIoApic(PVM pVM);
     48VMM_INT_DECL(bool)      PDMHasApic(PVM pVM);
    4849VMM_INT_DECL(int)       PDMApicHasPendingIrq(PVM pVM, bool *pfPending);
    4950VMMDECL(int)            PDMApicSetBase(PVMCPU pVCpu, uint64_t u64Base);
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r49479 r49549  
    902902        case MSR_IA32_APICBASE:
    903903        {
     904            /* See @bugref{7097} comment 6. */
    904905            PVM pVM = pVCpu->CTX_SUFF(pVM);
    905             if (   (    pVM->cpum.s.aGuestCpuIdStd[0].eax >= 1                                  /* APIC Std feature */
    906                     && (pVM->cpum.s.aGuestCpuIdStd[1].edx & X86_CPUID_FEATURE_EDX_APIC))
    907                 || (   pVM->cpum.s.aGuestCpuIdExt[0].eax >= 0x80000001                          /* APIC Ext feature (AMD) */
    908                     && pVM->cpum.s.enmGuestCpuVendor == CPUMCPUVENDOR_AMD
    909                     && (pVM->cpum.s.aGuestCpuIdExt[1].edx & X86_CPUID_AMD_FEATURE_EDX_APIC))
    910                 || (    pVM->cpum.s.aGuestCpuIdStd[0].eax >= 1                                  /* x2APIC */
    911                     && (pVM->cpum.s.aGuestCpuIdStd[1].ecx & X86_CPUID_FEATURE_ECX_X2APIC)))
    912             {
     906            if (PDMHasApic(pVM))
    913907                *puValue = pVCpu->cpum.s.Guest.msrApicBase;
    914             }
    915908            else
    916909            {
     910                rc = VERR_CPUM_RAISE_GP_0;
    917911                *puValue = 0;
    918                 rc = VERR_CPUM_RAISE_GP_0;
    919912            }
    920913            break;
  • trunk/src/VBox/VMM/VMMAll/PDMAll.cpp

    r47280 r49549  
    212212
    213213/**
     214 * Returns presence of an IO-APIC
     215 *
     216 * @returns VBox true if IO-APIC is present
     217 * @param   pVM             Pointer to the VM.
     218 */
     219VMM_INT_DECL(bool) PDMHasApic(PVM pVM)
     220{
     221    return pVM->pdm.s.Apic.CTX_SUFF(pDevIns) != NULL;
     222}
     223
     224
     225/**
    214226 * Set the APIC base.
    215227 *
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