linux-user: Implement /proc/cpuinfo for ppc cpus
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
@@ -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
Quoted 15 lines · Helge Deller
From: Helge Deller<[email protected]>
Mimic the entries for
/proc/cpuinfoto what can be seen on two debian porterboxes (ppc64 and ppc64le), which are running via KVM/QEMU.The "timebase" value in
/proc/cpuinfois used by glibc on power, but only if the__kernel_get_tbfreqvdso call isn't implemented. So switchcpu_ppc_load_tbl()for linux-user toget_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
Cc Richard Henderson<[email protected]>Signed-off-by Helge Deller<[email protected]>--- linux-user/ppc/cpu_loop.c | 2 +- linux-user/ppc/target_proc.h | 91 +++++++++++++++++++++++++++++++++++- 2 files changed, 91 insertions(+), 2 deletions(-)
r~