VirtualBox

Changeset 64310 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 18, 2016 10:23:35 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
111366
Message:

VMM/GIM/KVM: Don't GP fault on invalid time-struct MSR write

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

Legend:

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

    r62653 r64310  
    275275
    276276            /* Is the system-time struct. already enabled? If so, get flags that need preserving. */
    277             /*uint8_t fFlags = 0; - unused */
    278277            GIMKVMSYSTEMTIME SystemTime;
    279278            RT_ZERO(SystemTime);
     
    294293            {
    295294                pKvmCpu->u64SystemTimeMsr = 0;
    296                 return VERR_CPUM_RAISE_GP_0;
     295                /* We shouldn't throw a #GP(0) here for buggy guests (neither does KVM apparently), see @bugref{8627}. */
    297296            }
    298297            return VINF_SUCCESS;
  • TabularUnified trunk/src/VBox/VMM/VMMR3/GIMKvm.cpp

    r62641 r64310  
    284284    {
    285285        PCGIMKVMCPU pKvmCpu = &pVM->aCpus[i].gim.s.u.KvmCpu;
    286 
    287         /* Guest may alter flags (namely GIM_KVM_SYSTEM_TIME_FLAGS_GUEST_PAUSED bit). So re-read them from guest-memory. */
    288         GIMKVMSYSTEMTIME SystemTime;
    289         RT_ZERO(SystemTime);
    290         if (MSR_GIM_KVM_SYSTEM_TIME_IS_ENABLED(pKvmCpu->u64SystemTimeMsr))
    291         {
    292             int rc = PGMPhysSimpleReadGCPhys(pVM, &SystemTime, pKvmCpu->GCPhysSystemTime, sizeof(GIMKVMSYSTEMTIME));
    293             AssertRCReturn(rc, rc);
    294         }
    295 
    296286        SSMR3PutU64(pSSM, pKvmCpu->u64SystemTimeMsr);
    297287        SSMR3PutU64(pSSM, pKvmCpu->uTsc);
     
    299289        SSMR3PutGCPhys(pSSM, pKvmCpu->GCPhysSystemTime);
    300290        SSMR3PutU32(pSSM, pKvmCpu->u32SystemTimeVersion);
    301         SSMR3PutU8(pSSM, SystemTime.fFlags);
     291        SSMR3PutU8(pSSM, pKvmCpu->fSystemTimeFlags);
    302292    }
    303293
     
    359349            Assert(!TMVirtualIsTicking(pVM));       /* paranoia. */
    360350            Assert(!TMCpuTickIsTicking(pVCpu));
    361             rc = gimR3KvmEnableSystemTime(pVM, pVCpu);
    362             AssertRCReturn(rc, rc);
     351            gimR3KvmEnableSystemTime(pVM, pVCpu);
    363352        }
    364353    }
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