VirtualBox

Changeset 83029 in vbox


Ignore:
Timestamp:
Feb 10, 2020 9:18:24 AM (5 years ago)
Author:
vboxsync
Message:

HM: Always use the 64-bit SVM context switcher for 64-bit capable VMs (see bugref:6208).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMR0A.asm

    r82968 r83029  
    17921792
    17931793;;
    1794 ; Prepares for and executes VMRUN (32 bits guests)
     1794; Prepares for and executes VMRUN (32-bit register context guests)
    17951795;
    17961796; @returns  VBox status code
     
    18021802;
    18031803ALIGNCODE(16)
    1804 BEGINPROC SVMR0VMRun
     1804BEGINPROC SVMR0VMRun32
    18051805%ifdef RT_ARCH_AMD64 ; fake a cdecl stack frame
    18061806 %ifdef ASM_CALL64_GCC
     
    19361936%endif
    19371937    ret
    1938 ENDPROC SVMR0VMRun
     1938ENDPROC SVMR0VMRun32
    19391939
    19401940
    19411941%ifdef RT_ARCH_AMD64
    19421942;;
    1943 ; Prepares for and executes VMRUN (64 bits guests)
     1943; Prepares for and executes VMRUN (64-bit register context)
    19441944;
    19451945; @returns  VBox status code
     
    19511951;
    19521952ALIGNCODE(16)
    1953 BEGINPROC SVMR0VMRun64
     1953BEGINPROC SVMR0VMRun
    19541954    ; Fake a cdecl stack frame
    19551955 %ifdef ASM_CALL64_GCC
     
    21142114    add     rsp, 6 * xCB
    21152115    ret
    2116 ENDPROC SVMR0VMRun64
     2116ENDPROC SVMR0VMRun
    21172117%endif ; RT_ARCH_AMD64
    21182118
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r83025 r83029  
    21802180 * Selects the appropriate function to run guest code.
    21812181 *
    2182  * @returns VBox status code.
    21832182 * @param   pVCpu   The cross context virtual CPU structure.
    21842183 *
    21852184 * @remarks No-long-jump zone!!!
    21862185 */
    2187 static int hmR0SvmSelectVMRunHandler(PVMCPUCC pVCpu)
    2188 {
    2189     if (CPUMIsGuestInLongMode(pVCpu))
    2190     {
    2191 #ifndef VBOX_WITH_64_BITS_GUESTS
    2192         return VERR_PGM_UNSUPPORTED_SHADOW_PAGING_MODE;
    2193 #else
     2186DECLINLINE(void) hmR0SvmSelectVMRunHandler(PVMCPUCC pVCpu)
     2187{
     2188    if (pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests)
     2189    {
    21942190# if HC_ARCH_BITS != 64 || ARCH_BITS != 64
    21952191#  error "Only 64-bit hosts are supported!"
    21962192# endif
    2197         Assert(pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests);    /* Guaranteed by hmR3InitFinalizeR0(). */
    2198         /* Guest in long mode, use 64-bit handler (host is 64-bit). */
    2199         pVCpu->hm.s.svm.pfnVMRun = SVMR0VMRun64;
    2200 #endif
     2193        /* Guest may enter long mode, always use 64-bit handler. */
     2194        pVCpu->hm.s.svm.pfnVMRun = SVMR0VMRun;
    22012195    }
    22022196    else
    22032197    {
    2204         /* Guest is not in long mode, use the 32-bit handler. */
    2205         pVCpu->hm.s.svm.pfnVMRun = SVMR0VMRun;
    2206     }
    2207     return VINF_SUCCESS;
     2198        /* Guest is 32-bit only, use the 32-bit handler. */
     2199        pVCpu->hm.s.svm.pfnVMRun = SVMR0VMRun32;
     2200    }
    22082201}
    22092202
     
    23632356    }
    23642357
    2365     rc = hmR0SvmSelectVMRunHandler(pVCpu);
    2366     AssertRCReturn(rc, rc);
     2358    hmR0SvmSelectVMRunHandler(pVCpu);
    23672359
    23682360    /* Clear any bits that may be set but exported unconditionally or unused/reserved bits. */
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.h

    r82968 r83029  
    5454
    5555/**
    56  * Prepares for and executes VMRUN (32-bit guests).
     56 * Prepares for and executes VMRUN (32-bit register context).
     57 *
     58 * @returns VBox status code.
     59 * @param   pVMCBHostPhys   Physical address of host VMCB.
     60 * @param   pVMCBPhys       Physical address of the VMCB.
     61 * @param   pCtx            Pointer to the guest CPU context.
     62 * @param   pVM             The cross context VM structure. (Not used.)
     63 * @param   pVCpu           The cross context virtual CPU structure. (Not used.)
     64 */
     65DECLASM(int) SVMR0VMRun32(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVMCC pVM, PVMCPUCC pVCpu);
     66
     67
     68/**
     69 * Prepares for and executes VMRUN (64-bit register context).
    5770 *
    5871 * @returns VBox status code.
     
    6477 */
    6578DECLASM(int) SVMR0VMRun(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVMCC pVM, PVMCPUCC pVCpu);
    66 
    67 
    68 /**
    69  * Prepares for and executes VMRUN (64-bit guests).
    70  *
    71  * @returns VBox status code.
    72  * @param   pVMCBHostPhys   Physical address of host VMCB.
    73  * @param   pVMCBPhys       Physical address of the VMCB.
    74  * @param   pCtx            Pointer to the guest CPU context.
    75  * @param   pVM             The cross context VM structure. (Not used.)
    76  * @param   pVCpu           The cross context virtual CPU structure. (Not used.)
    77  */
    78 DECLASM(int) SVMR0VMRun64(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVMCC pVM, PVMCPUCC pVCpu);
    7979
    8080/**
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