VirtualBox

Changeset 80077 in vbox


Ignore:
Timestamp:
Jul 31, 2019 2:30:19 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132517
Message:

VMM: Kicking out raw-mode - GIM. bugref:9517

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

Legend:

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

    r78434 r80077  
    13641364 * Whether we need to trap \#UD exceptions in the guest.
    13651365 *
    1366  * We only need to trap \#UD exceptions for raw-mode guests when hypercalls are
    1367  * enabled. For HM VMs, the hypercall would be handled via the
     1366 * We only needed to trap \#UD exceptions for the old raw-mode guests when
     1367 * hypercalls are enabled. For HM VMs, the hypercall would be handled via the
    13681368 * VMCALL/VMMCALL VM-exit.
    13691369 *
     
    13721372VMM_INT_DECL(bool) gimHvShouldTrapXcptUD(PVMCPU pVCpu)
    13731373{
    1374 #ifdef VBOX_WITH_RAW_MODE
    1375     if (   VM_IS_RAW_MODE_ENABLED(pVCpu->CTX_SUFF(pVM))
    1376         && gimHvAreHypercallsEnabled(pVCpu))
    1377         return true;
    1378 #else
    13791374    RT_NOREF(pVCpu);
    1380 #endif
    13811375    return false;
    13821376}
  • trunk/src/VBox/VMM/VMMAll/GIMAllKvm.cpp

    r76553 r80077  
    239239        {
    240240            bool fEnable = RT_BOOL(uRawValue & MSR_GIM_KVM_SYSTEM_TIME_ENABLE_BIT);
    241 #ifdef IN_RING0
     241#ifndef IN_RING3
    242242            NOREF(fEnable); NOREF(pKvmCpu);
    243243            gimR0KvmUpdateSystemTime(pVM, pVCpu);
    244             return VINF_CPUM_R3_MSR_WRITE;
    245 #elif defined(IN_RC)
    246             Assert(pVM->cCpus == 1);
    247             if (fEnable)
    248             {
    249                 RTCCUINTREG fEFlags  = ASMIntDisableFlags();
    250                 pKvmCpu->uTsc        = TMCpuTickGetNoCheck(pVCpu) | UINT64_C(1);
    251                 pKvmCpu->uVirtNanoTS = TMVirtualGetNoCheck(pVM)   | UINT64_C(1);
    252                 ASMSetFlags(fEFlags);
    253             }
    254244            return VINF_CPUM_R3_MSR_WRITE;
    255245#else /* IN_RING3 */
     
    288278            }
    289279            return VINF_SUCCESS;
    290 #endif
     280#endif /* IN_RING3 */
    291281        }
    292282
     
    405395            PCGIMKVM pKvm = &pVM->gim.s.u.Kvm;
    406396            if (   uDisOpcode != pKvm->uOpcodeNative
    407                 && !VM_IS_RAW_MODE_ENABLED(pVM)
    408397                && cbInstr == sizeof(pKvm->abOpcodeNative) )
    409398            {
  • trunk/src/VBox/VMM/VMMR3/GIMHv.cpp

    r79080 r80077  
    510510                AssertLogRelRCReturn(rc, rc);
    511511                pHvStimer->pTimerR0 = TMTimerR0Ptr(pHvStimer->pTimerR3);
    512                 pHvStimer->pTimerRC = TMTimerRCPtr(pHvStimer->pTimerR3);
    513512            }
    514513        }
     
    622621VMMR3_INT_DECL(void) gimR3HvRelocate(PVM pVM, RTGCINTPTR offDelta)
    623622{
    624     RT_NOREF1(offDelta);
    625 
    626     PCGIMHV pHv = &pVM->gim.s.u.Hv;
    627     if (   (pHv->uBaseFeat & GIM_HV_BASE_FEAT_STIMER_MSRS)
    628         || (pHv->uBaseFeat & GIM_HV_BASE_FEAT_BASIC_SYNIC_MSRS))
    629     {
    630         for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
    631         {
    632             PGIMHVCPU pHvCpu = &pVM->aCpus[idCpu].gim.s.u.HvCpu;
    633             for (uint8_t idxStimer = 0; idxStimer < RT_ELEMENTS(pHvCpu->aStimers); idxStimer++)
    634             {
    635                 PGIMHVSTIMER pHvStimer = &pHvCpu->aStimers[idxStimer];
    636                 pHvStimer->pTimerRC = TMTimerRCPtr(pHvStimer->pTimerR3);
    637             }
    638         }
    639     }
     623    RT_NOREF(pVM, offDelta);
    640624}
    641625
  • trunk/src/VBox/VMM/VMMR3/GIMKvm.cpp

    r76553 r80077  
    167167    AssertLogRelRCReturn(rc, rc);
    168168    AssertLogRelReturn(cbHypercall == sizeof(pKvm->abOpcodeNative), VERR_GIM_IPE_1);
    169     pKvm->fTrapXcptUD = pKvm->uOpcodeNative != OP_VMCALL || VM_IS_RAW_MODE_ENABLED(pVM);
     169    pKvm->fTrapXcptUD = pKvm->uOpcodeNative != OP_VMCALL;
    170170
    171171    return VINF_SUCCESS;
  • trunk/src/VBox/VMM/include/GIMHvInternal.h

    r76585 r80077  
    11981198    /** Per-VM R0 Spinlock for protecting EMT writes to the TSC page. */
    11991199    RTSPINLOCK                  hSpinlockR0;
    1200 #if HC_ARCH_BITS == 32
    1201     uint32_t                    u32Alignment1;
    1202 #endif
    12031200    /** The TSC frequency (in HZ) reported to the guest. */
    12041201    uint64_t                    cTscTicksPerSecond;
     
    12701267    /** Synthetic timer object - R3 ptr. */
    12711268    PTMTIMERR3                  pTimerR3;
    1272     /** Synthetic timer object - RC ptr. */
    1273     PTMTIMERRC                  pTimerRC;
    1274     /** RC alignment padding. */
    1275     RTRCPTR                     uAlignment0;
    12761269    /** Virtual CPU ID this timer belongs to (for reverse mapping). */
    12771270    VMCPUID                     idCpu;
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