VirtualBox

Changeset 97150 in vbox


Ignore:
Timestamp:
Oct 14, 2022 7:12:10 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154123
Message:

VMM/CPUM: Nested VMX: bugref:10092 We access the virtual-APIC page directly from guest's memory. Removed it from CPUMCTX.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum.mac

    r96407 r97150  
    300300    .hwvirt.vmx.abMsrBitmap             resb        0x1000
    301301    .hwvirt.vmx.abIoBitmap              resb        0x1000+0x1000
    302     .hwvirt.vmx.abVirtApicPage          resb        0x1000
    303302    alignb 8
    304303    .hwvirt.vmx.GCPhysVmxon             resq        1
  • trunk/include/VBox/vmm/cpumctx.h

    r97069 r97150  
    586586                 *       access the guest memory directly as needed? */
    587587                uint8_t                 abIoBitmap[VMX_V_IO_BITMAP_A_SIZE + VMX_V_IO_BITMAP_B_SIZE];
    588                 /** 0x11000 - The virtual-APIC page.
    589                  * @note This is used by VT-x hardware... */
    590                 uint8_t                 abVirtApicPage[VMX_V_VIRT_APIC_SIZE];
    591 
    592                 /** 0x12000 - Guest physical address of the VMXON region. */
     588
     589                /** 0x11000 - Guest physical address of the VMXON region. */
    593590                RTGCPHYS                GCPhysVmxon;
    594                 /** 0x12008 - Guest physical address of the current VMCS pointer. */
     591                /** 0x11008 - Guest physical address of the current VMCS pointer. */
    595592                RTGCPHYS                GCPhysVmcs;
    596                 /** 0x12010 - Guest physical address of the shadow VMCS pointer. */
     593                /** 0x11010 - Guest physical address of the shadow VMCS pointer. */
    597594                RTGCPHYS                GCPhysShadowVmcs;
    598                 /** 0x12018 - Last emulated VMX instruction/VM-exit diagnostic. */
     595                /** 0x11018 - Last emulated VMX instruction/VM-exit diagnostic. */
    599596                VMXVDIAG                enmDiag;
    600                 /** 0x1201c - VMX abort reason. */
     597                /** 0x1101c - VMX abort reason. */
    601598                VMXABORT                enmAbort;
    602                 /** 0x12020 - Last emulated VMX instruction/VM-exit diagnostic auxiliary info.
     599                /** 0x11020 - Last emulated VMX instruction/VM-exit diagnostic auxiliary info.
    603600                 *  (mainly used for info. that's not part of the VMCS). */
    604601                uint64_t                uDiagAux;
    605                 /** 0x12028 - VMX abort auxiliary info. */
     602                /** 0x11028 - VMX abort auxiliary info. */
    606603                uint32_t                uAbortAux;
    607                 /** 0x1202c - Whether the guest is in VMX root mode. */
     604                /** 0x1102c - Whether the guest is in VMX root mode. */
    608605                bool                    fInVmxRootMode;
    609                 /** 0x1202d - Whether the guest is in VMX non-root mode. */
     606                /** 0x1102d - Whether the guest is in VMX non-root mode. */
    610607                bool                    fInVmxNonRootMode;
    611                 /** 0x1202e - Whether the injected events are subjected to event intercepts.  */
     608                /** 0x1102e - Whether the injected events are subjected to event intercepts.  */
    612609                bool                    fInterceptEvents;
    613                 /** 0x1202f - Whether blocking of NMI (or virtual-NMIs) was in effect in VMX
     610                /** 0x1102f - Whether blocking of NMI (or virtual-NMIs) was in effect in VMX
    614611                 *  non-root mode before execution of IRET. */
    615612                bool                    fNmiUnblockingIret;
    616                 /** 0x12030 - Guest TSC timestamp of the first PAUSE instruction that is
     613                /** 0x11030 - Guest TSC timestamp of the first PAUSE instruction that is
    617614                 *  considered to be the first in a loop. */
    618615                uint64_t                uFirstPauseLoopTick;
    619                 /** 0x12038 - Guest TSC timestamp of the previous PAUSE instruction. */
     616                /** 0x11038 - Guest TSC timestamp of the previous PAUSE instruction. */
    620617                uint64_t                uPrevPauseTick;
    621                 /** 0x12040 - Guest TSC timestamp of VM-entry (used for VMX-preemption
     618                /** 0x11040 - Guest TSC timestamp of VM-entry (used for VMX-preemption
    622619                 *  timer). */
    623620                uint64_t                uEntryTick;
    624                 /** 0x12048 - Virtual-APIC write offset (until trap-like VM-exit). */
     621                /** 0x11048 - Virtual-APIC write offset (until trap-like VM-exit). */
    625622                uint16_t                offVirtApicWrite;
    626                 /** 0x1204a - Whether virtual-NMI blocking is in effect. */
     623                /** 0x1104a - Whether virtual-NMI blocking is in effect. */
    627624                bool                    fVirtNmiBlocking;
    628                 /** 0x1204b - Padding. */
     625                /** 0x1104b - Padding. */
    629626                uint8_t                 abPadding0[5];
    630                 /** 0x12050 - Guest VMX MSRs. */
     627                /** 0x11050 - Guest VMX MSRs. */
    631628                VMXMSRS                 Msrs;
    632629            } vmx;
    633630        } CPUM_UNION_NM(s);
    634631
    635         /** 0x12130 - Hardware virtualization type currently in use. */
     632        /** 0x11130 - Hardware virtualization type currently in use. */
    636633        CPUMHWVIRT              enmHwvirt;
    637         /** 0x12134 - Global interrupt flag - AMD only (always true on Intel). */
     634        /** 0x11134 - Global interrupt flag - AMD only (always true on Intel). */
    638635        bool                    fGif;
    639636        bool                    afPadding1[3];
    640         /** 0x12138 - A subset of guest force flags that are saved while running the
     637        /** 0x11138 - A subset of guest force flags that are saved while running the
    641638         *  nested-guest. */
    642639#ifdef VMCPU_WITH_64_BIT_FFS
     
    647644#endif
    648645#if 0
    649         /** 0x12140 - Pad to 64 byte boundary. */
     646        /** 0x11140 - Pad to 64 byte boundary. */
    650647        uint8_t                 abPadding0[8+16+32];
    651648#endif
     
    721718AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) vmx.abMsrBitmap,           X86_PAGE_SIZE);
    722719AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) vmx.abIoBitmap,            X86_PAGE_SIZE);
    723 AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) vmx.abVirtApicPage,        X86_PAGE_SIZE);
    724720AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) vmx.Msrs,                  8);
    725721AssertCompileMemberOffset(CPUMCTX,    hwvirt.CPUM_UNION_NM(s.) svm.abIoBitmap,            0x7000);
    726722AssertCompileMemberOffset(CPUMCTX,    hwvirt.CPUM_UNION_NM(s.) svm.fInterceptEvents,      0xa0d4);
    727723AssertCompileMemberOffset(CPUMCTX,    hwvirt.CPUM_UNION_NM(s.) vmx.abIoBitmap,            0xf000);
    728 AssertCompileMemberOffset(CPUMCTX,    hwvirt.CPUM_UNION_NM(s.) vmx.fVirtNmiBlocking,      0x1204a);
    729 AssertCompileMemberOffset(CPUMCTX,    hwvirt.enmHwvirt,                                   0x12130);
    730 AssertCompileMemberOffset(CPUMCTX,    hwvirt.fGif,                                        0x12134);
    731 AssertCompileMemberOffset(CPUMCTX,    hwvirt.fLocalForcedActions,                         0x12138);
     724AssertCompileMemberOffset(CPUMCTX,    hwvirt.CPUM_UNION_NM(s.) vmx.fVirtNmiBlocking,      0x1104a);
     725AssertCompileMemberOffset(CPUMCTX,    hwvirt.enmHwvirt,                                   0x11130);
     726AssertCompileMemberOffset(CPUMCTX,    hwvirt.fGif,                                        0x11134);
     727AssertCompileMemberOffset(CPUMCTX,    hwvirt.fLocalForcedActions,                         0x11138);
    732728AssertCompileMembersAtSameOffset(CPUMCTX, CPUM_UNION_STRUCT_NM(g,qw.) rax, CPUMCTX, CPUM_UNION_NM(g.) aGRegs);
    733729AssertCompileMembersAtSameOffset(CPUMCTX, CPUM_UNION_STRUCT_NM(g,qw.) rax, CPUMCTX, CPUM_UNION_STRUCT_NM(g,qw2.)  r0);
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r97146 r97150  
    11141114        AssertCompile(sizeof(pCtx->hwvirt.vmx.abIoBitmap) == (VMX_V_IO_BITMAP_A_PAGES + VMX_V_IO_BITMAP_B_PAGES) * X86_PAGE_SIZE);
    11151115        AssertCompile(sizeof(pCtx->hwvirt.vmx.abIoBitmap) == VMX_V_IO_BITMAP_A_SIZE + VMX_V_IO_BITMAP_B_SIZE);
    1116         AssertCompile(sizeof(pCtx->hwvirt.vmx.abVirtApicPage) == VMX_V_VIRT_APIC_PAGES * X86_PAGE_SIZE);
    1117         AssertCompile(sizeof(pCtx->hwvirt.vmx.abVirtApicPage) == VMX_V_VIRT_APIC_SIZE);
    11181116
    11191117        /* Initialize non-zero values. */
     
    11441142    RT_ZERO(pCtx->hwvirt.vmx.abMsrBitmap);
    11451143    RT_ZERO(pCtx->hwvirt.vmx.abIoBitmap);
    1146     RT_ZERO(pCtx->hwvirt.vmx.abVirtApicPage);
    11471144
    11481145    pCtx->hwvirt.vmx.GCPhysVmxon       = NIL_RTGCPHYS;
  • trunk/src/VBox/VMM/include/CPUMInternal.mac

    r96407 r97150  
    267267    .Guest.hwvirt.vmx.abMsrBitmap           resb        0x1000
    268268    .Guest.hwvirt.vmx.abIoBitmap            resb        0x1000+0x1000
    269     .Guest.hwvirt.vmx.abVirtApicPage        resb        0x1000
    270269    alignb 8
    271270    .Guest.hwvirt.vmx.GCPhysVmxon           resq        1
  • trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp

    r96979 r97150  
    272272    CHECK_MEMBER_ALIGNMENT(VMCPU, cpum.s.Guest.hwvirt.vmx.abMsrBitmap, 4096);
    273273    CHECK_MEMBER_ALIGNMENT(VMCPU, cpum.s.Guest.hwvirt.vmx.abIoBitmap, 4096);
    274     CHECK_MEMBER_ALIGNMENT(VMCPU, cpum.s.Guest.hwvirt.vmx.abVirtApicPage, 4096);
    275274
    276275    PVM pVM = NULL; NOREF(pVM);
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