x86_64 and i386 return 0 when reading MSR_TSC

Bug #1195012 reported by Jeff Rizzo
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Running NetBSD 6.1 (i386 and amd64) under QEMU (from git - 1.5.50 is the version it shows) results in an incorrectly set
TSC frequency (set to 0), because NetBSD uses rdmsr(TSC_MSR) for its serializing CPU counter.

To reproduce the problem, you can run an install ISO of NetBSD 6.1 (either i386 or amd64, depending on which qemu). Quit out of the installer, and you're left at a root prompt:

# sysctl machdep.tsc_freq
machdep.tsc_freq = 0

...on real hardware, it will return the TSC frequency:

# sysctl machdep.tsc_freq
machdep.tsc_freq = 3292685070

...this causes problems with a number of applications.

The NetBSD code which reads the MSR is here:


... the "rdmsr(MSR_TSC)" call in cpu_counter_serializing() always returns 0 when run under QEMU.

Revision history for this message
Jeff Rizzo (4-riz) wrote :

I should mention, the NetBSD 6.1 ISO I used for testing is here:


Revision history for this message
Jeff Rizzo (4-riz) wrote :

The NetBSD problem report where this issue was raised:


a workaround has been put in place for now, but it would be good to fix this in QEMU.

Revision history for this message
Thomas Huth (th-huth) wrote :

Looking through old bug tickets... can you still reproduce this issue with the latest version of QEMU? Or could we close this ticket nowadays?

Changed in qemu:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for QEMU because there has been no activity for 60 days.]

Changed in qemu:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers