VirtualBox

Changeset 97004 in vbox


Ignore:
Timestamp:
Oct 5, 2022 1:17:28 PM (2 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Convered two HMEVENT stack variables into static const.

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/VMXAllTemplate.cpp.h

    r96999 r97004  
    952952}
    953953
    954 
    955954#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
     955
    956956/**
    957957 * Loads the shadow VMCS specified by the VMCS info. object.
     
    11171117    return rc;
    11181118}
     1119
    11191120#endif /* VBOX_WITH_NESTED_HWVIRT_VMX */
    1120 
    1121 
    11221121#ifdef VBOX_STRICT
     1122
    11231123/**
    11241124 * Reads the VM-entry interruption-information field from the VMCS into the VMX
     
    11611161    AssertRC(rc);
    11621162}
     1163
    11631164#endif /* VBOX_STRICT */
    1164 
    11651165
    11661166/**
     
    42764276                if (uVector == X86_XCPT_GP)
    42774277                {
    4278                     uint32_t const uXcptDfInfo = RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VECTOR,         X86_XCPT_DF)
    4279                                                | RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_TYPE,           VMX_ENTRY_INT_INFO_TYPE_HW_XCPT)
    4280                                                | RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_ERR_CODE_VALID, 0)
    4281                                                | RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VALID,          1);
    4282                     HMEVENT EventXcptDf;
    4283                     RT_ZERO(EventXcptDf);
    4284                     EventXcptDf.u64IntInfo = uXcptDfInfo;
    4285                     return vmxHCInjectEventVmcs(pVCpu, pVmcsInfo, fIsNestedGuest, &EventXcptDf, fStepping, pfIntrState);
     4278                    static HMEVENT const s_EventXcptDf
     4279                        = HMEVENT_INIT_ONLY_INT_INFO(  RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VECTOR, X86_XCPT_DF)
     4280                                                     | RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_TYPE,   VMX_ENTRY_INT_INFO_TYPE_HW_XCPT)
     4281                                                     | RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_ERR_CODE_VALID, 0)
     4282                                                     | RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VALID,          1));
     4283                    return vmxHCInjectEventVmcs(pVCpu, pVmcsInfo, fIsNestedGuest, &s_EventXcptDf, fStepping, pfIntrState);
    42864284                }
    42874285
     
    42924290                 * See Intel spec. 20.1.4 "Interrupt and Exception Handling"
    42934291                 */
    4294                 uint32_t const uXcptGpInfo = RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VECTOR,         X86_XCPT_GP)
    4295                                            | RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_TYPE,           VMX_ENTRY_INT_INFO_TYPE_HW_XCPT)
    4296                                            | RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_ERR_CODE_VALID, 0)
    4297                                            | RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VALID,          1);
    4298                 HMEVENT EventXcptGp;
    4299                 RT_ZERO(EventXcptGp);
    4300                 EventXcptGp.u64IntInfo = uXcptGpInfo;
    4301                 return vmxHCInjectEventVmcs(pVCpu, pVmcsInfo, fIsNestedGuest, &EventXcptGp, fStepping, pfIntrState);
     4292                static HMEVENT const s_EventXcptGp
     4293                    = HMEVENT_INIT_ONLY_INT_INFO(  RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VECTOR, X86_XCPT_GP)
     4294                                                 | RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_TYPE,   VMX_ENTRY_INT_INFO_TYPE_HW_XCPT)
     4295                                                 | RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_ERR_CODE_VALID, 0)
     4296                                                 | RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VALID,          1));
     4297                return vmxHCInjectEventVmcs(pVCpu, pVmcsInfo, fIsNestedGuest, &s_EventXcptGp, fStepping, pfIntrState);
    43024298            }
    43034299
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r96993 r97004  
    22442244}
    22452245
    2246 
    22472246#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
     2247
    22482248/**
    22492249 * Sets up the shadow VMCS fields arrays.
     
    23662366    }
    23672367}
     2368
    23682369#endif /* VBOX_WITH_NESTED_HWVIRT_VMX */
    2369 
    23702370
    23712371/**
  • trunk/src/VBox/VMM/include/HMVMXCommon.h

    r96407 r97004  
    232232AssertCompileSizeAlignment(HMEVENT, 8);
    233233
     234/** Initializer for a HMEVENT structure with    */
     235#define HMEVENT_INIT_ONLY_INT_INFO(a_uIntInfo) { 0, 0, 0, 0, (a_uIntInfo), 0 }
    234236
    235237/**
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