VirtualBox

Changeset 74660 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Oct 8, 2018 6:39:49 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
125554
Message:

VMM/IEM, CPUM: Nested VMX: bugref:9180 VM-exit bits; I/O exit prep work. Also add missing allocation/de-allocation for the shadow VMCS during CPUM init.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r74648 r74660  
    934934            pVCpu->cpum.s.Guest.hwvirt.vmx.pVmcsR3 = NULL;
    935935        }
     936        if (pVCpu->cpum.s.Guest.hwvirt.vmx.pShadowVmcsR3)
     937        {
     938            SUPR3PageFreeEx(pVCpu->cpum.s.Guest.hwvirt.vmx.pShadowVmcsR3, VMX_V_VMCS_PAGES);
     939            pVCpu->cpum.s.Guest.hwvirt.vmx.pShadowVmcsR3 = NULL;
     940        }
    936941        if (pVCpu->cpum.s.Guest.hwvirt.vmx.pvVirtApicPageR3)
    937942        {
     
    958963            SUPR3PageFreeEx(pVCpu->cpum.s.Guest.hwvirt.vmx.pvMsrBitmapR3, VMX_V_MSR_BITMAP_PAGES);
    959964            pVCpu->cpum.s.Guest.hwvirt.vmx.pvMsrBitmapR3 = NULL;
     965        }
     966        if (pVCpu->cpum.s.Guest.hwvirt.vmx.pvIoBitmapR3)
     967        {
     968            SUPR3PageFreeEx(pVCpu->cpum.s.Guest.hwvirt.vmx.pvIoBitmapR3, VMX_V_IO_BITMAP_A_PAGES + VMX_V_IO_BITMAP_B_PAGES);
     969            pVCpu->cpum.s.Guest.hwvirt.vmx.pvIoBitmapR3 = NULL;
    960970        }
    961971    }
     
    9951005
    9961006        /*
     1007         * Allocate the nested-guest shadow VMCS.
     1008         */
     1009        Assert(VMX_V_VMCS_PAGES == 1);
     1010        Assert(!pVCpu->cpum.s.Guest.hwvirt.vmx.pShadowVmcsR3);
     1011        rc = SUPR3PageAllocEx(VMX_V_VMCS_PAGES, 0 /* fFlags */, (void **)&pVCpu->cpum.s.Guest.hwvirt.vmx.pShadowVmcsR3,
     1012                              &pVCpu->cpum.s.Guest.hwvirt.vmx.pShadowVmcsR0, NULL /* paPages */);
     1013        if (RT_FAILURE(rc))
     1014        {
     1015            Assert(!pVCpu->cpum.s.Guest.hwvirt.vmx.pShadowVmcsR3);
     1016            LogRel(("CPUM%u: Failed to alloc %u pages for the nested-guest's shadow VMCS\n", pVCpu->idCpu, VMX_V_VMCS_PAGES));
     1017            break;
     1018        }
     1019
     1020        /*
    9971021         * Allocate the Virtual-APIC page.
    9981022         */
     
    10621086            LogRel(("CPUM%u: Failed to alloc %u pages for the nested-guest's MSR bitmap\n", pVCpu->idCpu,
    10631087                    VMX_V_MSR_BITMAP_PAGES));
     1088            break;
     1089        }
     1090
     1091        /*
     1092         * Allocate the I/O bitmaps (A and B).
     1093         */
     1094        Assert(!pVCpu->cpum.s.Guest.hwvirt.vmx.pvIoBitmapR3);
     1095        rc = SUPR3PageAllocEx(VMX_V_IO_BITMAP_A_PAGES + VMX_V_IO_BITMAP_B_PAGES, 0 /* fFlags */,
     1096                              (void **)&pVCpu->cpum.s.Guest.hwvirt.vmx.pvIoBitmapR3,
     1097                              &pVCpu->cpum.s.Guest.hwvirt.vmx.pvIoBitmapR0, NULL /* paPages */);
     1098        if (RT_FAILURE(rc))
     1099        {
     1100            Assert(!pVCpu->cpum.s.Guest.hwvirt.vmx.pvIoBitmapR3);
     1101            LogRel(("CPUM%u: Failed to alloc %u pages for the nested-guest's I/O bitmaps\n", pVCpu->idCpu,
     1102                    VMX_V_IO_BITMAP_A_PAGES + VMX_V_IO_BITMAP_B_PAGES));
    10641103            break;
    10651104        }
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