VirtualBox

Changeset 91292 in vbox


Ignore:
Timestamp:
Sep 17, 2021 12:06:15 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146952
Message:

VMM/CPUM: Use SVM_???_PAGES constants to size the big CPUMCTX fields. bugref:10093

Location:
trunk
Files:
2 edited

Legend:

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

    r91291 r91292  
    507507                 * HMPHYSCPU while executing the nested-guest using hardware-assisted SVM.
    508508                 * This one is just used for caching the bitmap from guest physical memory. */
    509                 uint8_t                 abMsrBitmap[0x2000];
     509                uint8_t                 abMsrBitmap[SVM_MSRPM_PAGES * X86_PAGE_SIZE];
    510510                /** 0x7000 - The IOPM (IO Permission bitmap).
    511511                 *
     
    516516                 * This one is just used for caching the IOPM from guest physical memory in
    517517                 * case the guest hypervisor allows direct access to some IO ports. */
    518                 uint8_t                 abIoBitmap[0x3000];
     518                uint8_t                 abIoBitmap[SVM_IOPM_PAGES * X86_PAGE_SIZE];
    519519
    520520                /** 0xa000 - MSR holding physical address of the Guest's Host-state. */
     
    843843AssertCompileMembersAtSameOffset(CPUMCTX, CPUM_UNION_STRUCT_NM(s,n.) gs,   CPUMCTX, CPUM_UNION_NM(s.) aSRegs[X86_SREG_GS]);
    844844# endif
    845 AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.Vmcb,                  4096);
    846 AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.abMsrBitmap,           4096);
    847 AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.abIoBitmap,            4096);
     845AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.Vmcb,                  X86_PAGE_SIZE);
     846AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.abMsrBitmap,           X86_PAGE_SIZE);
     847AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.abIoBitmap,            X86_PAGE_SIZE);
    848848AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) vmx.pVmcsR0,               8);
    849849AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) vmx.pShadowVmcsR0,         8);
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r91291 r91292  
    10401040        pVCpu->cpum.s.Guest.hwvirt.enmHwvirt = CPUMHWVIRT_SVM;
    10411041
    1042         AssertCompile(SVM_VMCB_PAGES * X86_PAGE_SIZE == sizeof(pVCpu->cpum.s.Guest.hwvirt.svm.Vmcb));
     1042        AssertCompile(SVM_VMCB_PAGES  * X86_PAGE_SIZE == sizeof(pVCpu->cpum.s.Guest.hwvirt.svm.Vmcb));
    10431043        AssertCompile(SVM_MSRPM_PAGES * X86_PAGE_SIZE == sizeof(pVCpu->cpum.s.Guest.hwvirt.svm.abMsrBitmap));
    1044         AssertCompile(SVM_IOPM_PAGES * X86_PAGE_SIZE == sizeof(pVCpu->cpum.s.Guest.hwvirt.svm.abIoBitmap));
     1044        AssertCompile(SVM_IOPM_PAGES  * X86_PAGE_SIZE == sizeof(pVCpu->cpum.s.Guest.hwvirt.svm.abIoBitmap));
    10451045    }
    10461046
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