VirtualBox

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


Ignore:
Timestamp:
Dec 12, 2017 5:42:25 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119615
Message:

VMM/CPUM: Raise #GP(0) like a physical CPU would when a nested-hypervisor doesn't intercept GIM MSRs.

File:
1 edited

Legend:

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

    r70056 r70071  
    48984898static DECLCALLBACK(VBOXSTRICTRC) cpumMsrRd_Gim(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
    48994899{
     4900#ifdef VBOX_WITH_NESTED_HWVIRT
     4901    /* Raise #GP(0) like a physical CPU would since the nested-hypervisor hasn't intercept these MSRs. */
     4902    PCCPUMCTX pCtx = &pVCpu->cpum.s.Guest;
     4903    if (CPUMIsGuestInNestedHwVirtMode(pCtx))
     4904        return VERR_CPUM_RAISE_GP_0;
     4905#endif
    49004906    return GIMReadMsr(pVCpu, idMsr, pRange, puValue);
    49014907}
     
    49054911static DECLCALLBACK(VBOXSTRICTRC) cpumMsrWr_Gim(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t uValue, uint64_t uRawValue)
    49064912{
     4913#ifdef VBOX_WITH_NESTED_HWVIRT
     4914    /* Raise #GP(0) like a physical CPU would since the nested-hypervisor hasn't intercept these MSRs. */
     4915    PCCPUMCTX pCtx = &pVCpu->cpum.s.Guest;
     4916    if (CPUMIsGuestInNestedHwVirtMode(pCtx))
     4917        return VERR_CPUM_RAISE_GP_0;
     4918#endif
    49074919    return GIMWriteMsr(pVCpu, idMsr, pRange, uValue, uRawValue);
    49084920}
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