Review Board 2.0.15


x86: Fix bug when copying TSC on CPU handover

Review Request #1890 - Created June 2, 2013 and submitted

Information
Andreas Sandberg
gem5
default
Reviewers
Default
Changeset 9740:d879a42f78c4
---------------------------
x86: Fix bug when copying TSC on CPU handover

The TSC value stored in MISCREG_TSC is actually just an offset from
the current CPU cycle to the actual TSC value. Writes with
side-effects to the TSC subtract the current cycle count before
storing the new value, while reads add the current cycle count. When
switching CPUs, the current value is copied without side-effects. This
works as long as the source and the destination CPUs have the same
clock frequencies. The TSC will jump, sometimes backwards, if they
have different clock frequencies. Most OSes assume the TSC to be
monotonic and break when this happens.

This changeset makes sure that the TSC is copied with side-effects to
ensure that the offset is updated to match the new CPU.

   
Review request changed
Updated (June 10, 2013, 5:23 p.m.)

Status: Closed (submitted)