Skip to contentSkip to conversation

linux-user: Implement /proc/cpuinfo for ppc cpus

PATCH In review Helge Deller 2 participants 2 messages Jun 11 – Jun 12

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 linux-user: Implement /proc/cpuinfo for ppc cpus

From: Helge Deller <[email protected]>

Mimic the entries for /proc/cpuinfo to what can be seen on two debian porterboxes (ppc64 and ppc64le), which are running via KVM/QEMU.

The "timebase" value in /proc/cpuinfo is used by glibc on power, but only if the __kernel_get_tbfreq vdso call isn't implemented. So switch cpu_ppc_load_tbl() for linux-user to get_clock(), as suggested by Richard, and report timebase = 1GHz in /proc/cpuinfo, which will make the vdso implementation simple too.

v4: change timebase to 1GHz and use get_clock()
v3: drop another colon, indenting fixes
v2: drop colon, add clock output, refine pvr calculation

---
 linux-user/ppc/cpu_loop.c    |  2 +-
 linux-user/ppc/target_proc.h | 91 +++++++++++++++++++++++++++++++++++-
 2 files changed, 91 insertions(+), 2 deletions(-)
linux-user/ppc/cpu_loop.c +1 -1
index 1f9ee20bd0..7c53e25a93 100644
@@ -26,7 +26,7 @@
 
 static inline uint64_t cpu_ppc_get_tb(CPUPPCState *env)
 {
-    return cpu_get_host_ticks();
+    return get_clock();
 }
 
 uint64_t cpu_ppc_load_tbl(CPUPPCState *env)
linux-user/ppc/target_proc.h +90 -1

91 lines not on this page · raw message

Signature · 1 line
2.54.0
Reviewed-by on v4 1/1
#1 lore raw
Quoted 15 lines · Helge Deller

From: Helge Deller<[email protected]>

Mimic the entries for /proc/cpuinfo to what can be seen on two debian porterboxes (ppc64 and ppc64le), which are running via KVM/QEMU.

The "timebase" value in /proc/cpuinfo is used by glibc on power, but only if the __kernel_get_tbfreq vdso call isn't implemented. So switch cpu_ppc_load_tbl() for linux-user to get_clock(), as suggested by Richard, and report timebase = 1GHz in /proc/cpuinfo, which will make the vdso implementation simple too.

v4: change timebase to 1GHz and use get_clock()
v3: drop another colon, indenting fixes
v2: drop colon, add clock output, refine pvr calculation

Quoted 7 lines
---
  linux-user/ppc/cpu_loop.c    |  2 +-
  linux-user/ppc/target_proc.h | 91 +++++++++++++++++++++++++++++++++++-
  2 files changed, 91 insertions(+), 2 deletions(-)

r~