Skip to contentSkip to conversation

x86_64 and i386 return 0 when reading MSR_TSC

Qemu-devel Jeff Rizzo 2 participants 5 messages Jun 26, 2013 – Jun 13, 2018

lore
Share & tools
lore

Jeff Rizzo

author
#0 lore raw

Public bug reported:

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:

http://nxr.netbsd.org/xref/src/sys/arch/x86/x86/tsc.c#262

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

** Affects: qemu
Importance: Undecided
Status: New

Signature · 37 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1195012

Title:
  x86_64 and i386 return 0 when reading MSR_TSC

Status in QEMU:
  New

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:

  http://nxr.netbsd.org/xref/src/sys/arch/x86/x86/tsc.c#262

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1195012/+subscriptions
author
#1 lore raw

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

http://iso.netbsd.org/pub/NetBSD/iso/6.1/NetBSD-6.1-amd64.iso

Signature · 37 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1195012

Title:
  x86_64 and i386 return 0 when reading MSR_TSC

Status in QEMU:
  New

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:

  http://nxr.netbsd.org/xref/src/sys/arch/x86/x86/tsc.c#262

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1195012/+subscriptions
author
#2 lore raw
In reply to Jeff Rizzo

The NetBSD problem report where this issue was raised:

http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=47967

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

Signature · 37 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1195012

Title:
  x86_64 and i386 return 0 when reading MSR_TSC

Status in QEMU:
  New

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:

  http://nxr.netbsd.org/xref/src/sys/arch/x86/x86/tsc.c#262

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1195012/+subscriptions
#3 lore raw
In reply to Jeff Rizzo

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

Signature · 37 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1195012

Title:
  x86_64 and i386 return 0 when reading MSR_TSC

Status in QEMU:
  Incomplete

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:

  http://nxr.netbsd.org/xref/src/sys/arch/x86/x86/tsc.c#262

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1195012/+subscriptions
#4 lore raw
In reply to Jeff Rizzo

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

** Changed in: qemu
Status: Incomplete => Expired

Signature · 37 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1195012

Title:
  x86_64 and i386 return 0 when reading MSR_TSC

Status in QEMU:
  Expired

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:

  http://nxr.netbsd.org/xref/src/sys/arch/x86/x86/tsc.c#262

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1195012/+subscriptions