VirtualBox

Changeset 72802 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jul 2, 2018 4:49:04 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123345
Message:

VMM/HMVMXR0: bugref:9193 Don't trash error codes for events unconditionally when Unrestricted-guest execution is used.
It's only for real-mode + UX we need to clear the error code in the VMCS. Should address the
VERR_VMX_UNABLE_TO_START_VM gurus.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r72798 r72802  
    4141#include "HMVMXR0.h"
    4242#include "dtrace/VBoxVMM.h"
    43 
    44 #define HMVMX_ALWAYS_SYNC_FULL_GUEST_STATE
    4543
    4644#ifdef DEBUG_ramshankar
     
    76327630    STAM_COUNTER_INC(&pVCpu->hm.s.paStatInjectedIrqsR0[uVector & MASK_INJECT_IRQ_STAT]);
    76337631
    7634     if (pVCpu->CTX_SUFF(pVM)->hm.s.vmx.fUnrestrictedGuest)
    7635     {
    7636         /*
    7637          * For unrestricted execution enabled CPUs running real-mode guests, we must not set the deliver-error-code bit.
    7638          * See Intel spec. 26.2.1.3 "VM-Entry Control Fields".
    7639          */
    7640         u32IntInfo &= ~VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_VALID;
    7641     }
    7642     else
    7643     {
    7644         /* We require CR0 to check if the guest is in real-mode. */
    7645         int rc = hmR0VmxImportGuestState(pVCpu, CPUMCTX_EXTRN_CR0);
    7646         AssertRCReturn(rc, rc);
    7647 
    7648         /*
    7649          * Hardware interrupts & exceptions cannot be delivered through the software interrupt
    7650          * redirection bitmap to the real mode task in virtual-8086 mode. We must jump to the
    7651          * interrupt handler in the (real-mode) guest.
    7652          *
    7653          * See Intel spec. 20.3 "Interrupt and Exception handling in Virtual-8086 Mode".
    7654          * See Intel spec. 20.1.4 "Interrupt and Exception Handling" for real-mode interrupt handling.
    7655          */
    7656         if (CPUMIsGuestInRealModeEx(pMixedCtx))
     7632    /* We require CR0 to check if the guest is in real-mode. */
     7633    /** @todo No we don't, since CR0.PE is always intercepted. */
     7634    int rc = hmR0VmxImportGuestState(pVCpu, CPUMCTX_EXTRN_CR0);
     7635    AssertRCReturn(rc, rc);
     7636
     7637    /*
     7638     * Hardware interrupts & exceptions cannot be delivered through the software interrupt
     7639     * redirection bitmap to the real mode task in virtual-8086 mode. We must jump to the
     7640     * interrupt handler in the (real-mode) guest.
     7641     *
     7642     * See Intel spec. 20.3 "Interrupt and Exception handling in Virtual-8086 Mode".
     7643     * See Intel spec. 20.1.4 "Interrupt and Exception Handling" for real-mode interrupt handling.
     7644     */
     7645    if (CPUMIsGuestInRealModeEx(pMixedCtx))
     7646    {
     7647        if (pVCpu->CTX_SUFF(pVM)->hm.s.vmx.fUnrestrictedGuest)
     7648        {
     7649            /*
     7650             * For unrestricted execution enabled CPUs running real-mode guests, we must not                              .
     7651             * set the deliver-error-code bit                                                                             .
     7652             *                                                                                                            .
     7653             * See Intel spec. 26.2.1.3 "VM-Entry Control Fields".
     7654             */
     7655            u32IntInfo &= ~VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_VALID;
     7656        }
     7657        else
    76577658        {
    76587659            PVM pVM = pVCpu->CTX_SUFF(pVM);
     
    77627763
    77637764    /* Inject. */
    7764     int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_ENTRY_INTERRUPTION_INFO, u32IntInfo);
     7765    rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_ENTRY_INTERRUPTION_INFO, u32IntInfo);
    77657766    if (VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_IS_VALID(u32IntInfo))
    77667767        rc |= VMXWriteVmcs32(VMX_VMCS32_CTRL_ENTRY_EXCEPTION_ERRCODE, u32ErrCode);
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