VirtualBox

Changeset 49664 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Nov 26, 2013 3:53:35 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
90919
Message:

VMM/HMVMXR0: MSR optimizations for world-switch of 64-bit guests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/HMInternal.h

    r49532 r49664  
    8484#define HM_CHANGED_GUEST_SYSENTER_EIP_MSR        RT_BIT(14)
    8585#define HM_CHANGED_GUEST_SYSENTER_ESP_MSR        RT_BIT(15)
     86#define HM_CHANGED_GUEST_LAZY_MSRS               RT_BIT(16)     /* Shared */
    8687/* VT-x specific state. */
    87 #define HM_CHANGED_VMX_GUEST_AUTO_MSRS           RT_BIT(16)
    88 #define HM_CHANGED_VMX_GUEST_ACTIVITY_STATE      RT_BIT(17)
    89 #define HM_CHANGED_VMX_GUEST_APIC_STATE          RT_BIT(18)
    90 #define HM_CHANGED_VMX_ENTRY_CTLS                RT_BIT(19)
    91 #define HM_CHANGED_VMX_EXIT_CTLS                 RT_BIT(20)
     88#define HM_CHANGED_VMX_GUEST_AUTO_MSRS           RT_BIT(17)
     89#define HM_CHANGED_VMX_GUEST_ACTIVITY_STATE      RT_BIT(18)
     90#define HM_CHANGED_VMX_GUEST_APIC_STATE          RT_BIT(19)
     91#define HM_CHANGED_VMX_ENTRY_CTLS                RT_BIT(20)
     92#define HM_CHANGED_VMX_EXIT_CTLS                 RT_BIT(21)
    9293/* AMD-V specific state. */
    93 #define HM_CHANGED_SVM_GUEST_EFER_MSR            RT_BIT(16)
    94 #define HM_CHANGED_SVM_GUEST_APIC_STATE          RT_BIT(17)
    95 #define HM_CHANGED_SVM_RESERVED1                 RT_BIT(18)
    96 #define HM_CHANGED_SVM_RESERVED2                 RT_BIT(19)
    97 #define HM_CHANGED_SVM_RESERVED3                 RT_BIT(20)
     94#define HM_CHANGED_SVM_GUEST_EFER_MSR            RT_BIT(17)
     95#define HM_CHANGED_SVM_GUEST_APIC_STATE          RT_BIT(18)
     96#define HM_CHANGED_SVM_RESERVED1                 RT_BIT(19)
     97#define HM_CHANGED_SVM_RESERVED2                 RT_BIT(20)
     98#define HM_CHANGED_SVM_RESERVED3                 RT_BIT(21)
    9899
    99100#define HM_CHANGED_ALL_GUEST                     (  HM_CHANGED_GUEST_CR0                \
     
    113114                                                  | HM_CHANGED_GUEST_SYSENTER_EIP_MSR   \
    114115                                                  | HM_CHANGED_GUEST_SYSENTER_ESP_MSR   \
     116                                                  | HM_CHANGED_GUEST_LAZY_MSRS          \
    115117                                                  | HM_CHANGED_VMX_GUEST_AUTO_MSRS      \
    116118                                                  | HM_CHANGED_VMX_GUEST_ACTIVITY_STATE \
     
    119121                                                  | HM_CHANGED_VMX_EXIT_CTLS)
    120122
    121 #define HM_CHANGED_HOST_CONTEXT                  RT_BIT(21)
     123#define HM_CHANGED_HOST_CONTEXT                  RT_BIT(22)
    122124
    123125/* Bits shared between host and guest. */
    124126#define HM_CHANGED_HOST_GUEST_SHARED_STATE       (  HM_CHANGED_GUEST_CR0                \
    125                                                   | HM_CHANGED_GUEST_DEBUG)
     127                                                  | HM_CHANGED_GUEST_DEBUG              \
     128                                                  | HM_CHANGED_GUEST_LAZY_MSRS)
    126129/** @} */
    127130
     
    595598        /** Number of guest/host MSR pairs in the auto-load/store area. */
    596599        uint32_t                    cMsrs;
    597         /** Whether the host MSR values are up-to-date. */
     600        /** Whether the host MSR values are up-to-date in the auto-load/store area. */
    598601        bool                        fUpdatedHostMsrs;
    599602        uint8_t                     u8Align[7];
     603
     604        /** Host LSTAR MSR value to restore lazily while leaving VT-x. */
     605        uint64_t                    u64HostLStarMsr;
     606        /** Host STAR MSR value to restore lazily while leaving VT-x. */
     607        uint64_t                    u64HostStarMsr;
     608        /** Host SF_MASK MSR value to restore lazily while leaving VT-x. */
     609        uint64_t                    u64HostSFMaskMsr;
     610        /** Host KernelGS-Base MSR value to restore lazily while leaving VT-x. */
     611        uint64_t                    u64HostKernelGSBaseMsr;
     612        /** A mask of which MSRs have been swapped and need restoration. */
     613        uint32_t                    fRestoreHostMsrs;
     614        uint32_t                    u32Alignment3;
    600615
    601616        /** The cached APIC-base MSR used for identifying when to map the HC physical APIC-access page. */
     
    641656        uint8_t                     u8Align2[7];
    642657
    643         /** Padding. */
     658        /** Alignment padding. */
    644659        uint32_t                    u32Padding;
    645660    } vmx;
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