VirtualBox

Changeset 74479 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Sep 26, 2018 2:28:55 PM (6 years ago)
Author:
vboxsync
Message:

VMM/CPUM: Nested VMX: bugref:9180 Rather than dereference pVCpu or pass yet another pVM pointer to all the inline nested hwvirt.
helper functions in cpum.h, we cache the hwvirt type in the CPUMCTX structure itself.

Location:
trunk/include/VBox/vmm
Files:
2 edited

Legend:

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

    r74421 r74479  
    280280    alignb 8
    281281    .hwvirt.svm.HCPhysVmcb             RTHCPHYS_RES  1
     282    .hwvirt.enmHwvirt                  resd          1
    282283    .hwvirt.fLocalForcedActions        resd          1
    283284    .hwvirt.fGif                       resb          1
  • trunk/include/VBox/vmm/cpumctx.h

    r74421 r74479  
    320320AssertCompileSizeAlignment(SVMHOSTSTATE, 8);
    321321AssertCompileSize(SVMHOSTSTATE, 184);
     322#endif
     323
     324
     325/**
     326 * CPU hardware virtualization types.
     327 */
     328typedef enum
     329{
     330    CPUMHWVIRT_NONE = 0,
     331    CPUMHWVIRT_VMX,
     332    CPUMHWVIRT_SVM,
     333    CPUMHWVIRT_32BIT_HACK = 0x7fffffff
     334} CPUMHWVIRT;
     335#ifndef VBOX_FOR_DTRACE_LIB
     336AssertCompileSize(CPUMHWVIRT, 4);
    322337#endif
    323338
     
    624639        } CPUM_UNION_NM(s);
    625640
    626         /** 0x3f0 - A subset of guest force flags that are saved while running the
     641        /** 0x3f0 - Hardware virtualization type currently in use. */
     642        CPUMHWVIRT              enmHwvirt;
     643        /** 0x3f4 - A subset of guest force flags that are saved while running the
    627644         *  nested-guest. */
    628645        uint32_t                fLocalForcedActions;
    629         /** 0x3f4 - Global interrupt flag - AMD only (always true on Intel). */
     646        /** 0x3f8 - Global interrupt flag - AMD only (always true on Intel). */
    630647        bool                    fGif;
    631         /** 0x3f8 - Padding. */
    632         uint8_t                 abPadding1[11];
     648        /** 0x3fc - Padding. */
     649        uint8_t                 abPadding1[7];
    633650    } hwvirt;
    634651    /** @} */
     
    724741AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) vmx.pvVmwriteBitmapR0, 8);
    725742AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) vmx.pAutoMsrAreaR0,    8);
    726 AssertCompileMemberOffset(CPUMCTX, hwvirt.fLocalForcedActions, 0x3f0);
    727 AssertCompileMemberOffset(CPUMCTX, hwvirt.fGif,                0x3f4);
     743AssertCompileMemberOffset(CPUMCTX, hwvirt.enmHwvirt,           0x3f0);
     744AssertCompileMemberOffset(CPUMCTX, hwvirt.fLocalForcedActions, 0x3f4);
     745AssertCompileMemberOffset(CPUMCTX, hwvirt.fGif,                0x3f8);
    728746AssertCompileMembersAtSameOffset(CPUMCTX, CPUM_UNION_STRUCT_NM(g,qw.) rax, CPUMCTX, CPUM_UNION_NM(g.) aGRegs);
    729747AssertCompileMembersAtSameOffset(CPUMCTX, CPUM_UNION_STRUCT_NM(g,qw.) rax, CPUMCTX, CPUM_UNION_STRUCT_NM(g,qw2.)  r0);
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