/*
- * Copyright (c) 2013, 2015 ARM Limited
+ * Copyright (c) 2013, 2015, 2017 ARM Limited
* All rights reserved.
*
* The license below extends only to copyright in the software and shall
void
GenericTimer::setMiscReg(int reg, unsigned cpu, MiscReg val)
{
+ // This method might have been called from another context if we
+ // are running in multi-core KVM. Migrate to the SimObject's event
+ // queue to prevent surprising race conditions.
+ EventQueue::ScopedMigration migrate(eventQueue());
+
CoreTimers &core(getTimers(cpu));
switch (reg) {
MiscReg
GenericTimer::readMiscReg(int reg, unsigned cpu)
{
+ // This method might have been called from another context if we
+ // are running in multi-core KVM. Migrate to the SimObject's event
+ // queue to prevent surprising race conditions.
+ EventQueue::ScopedMigration migrate(eventQueue());
+
CoreTimers &core(getTimers(cpu));
switch (reg) {