[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/17] linux-user: SPARC "rd %tick" can be used by us
From: |
Laurent Vivier |
Subject: |
[Qemu-devel] [PULL 02/17] linux-user: SPARC "rd %tick" can be used by user application |
Date: |
Mon, 4 Jun 2018 17:20:00 +0200 |
we have the same problem decribed in 7d6b1daedd
("linux-user, ppc: mftbl can be used by user application")
for ppc in the case of sparc.
When we use an application trying to resolve a name, it hangs in
0x00000000ff5dd40c: rd %tick, %o5
0x00000000ff5dd410: srlx %o5, 0x20, %o4
0x00000000ff5dd414: btst %o5, %g4
0x00000000ff5dd418: be %icc, 0xff5dd40c
because %tick is staying at 0.
As QEMU_CLOCK_VIRTUAL is not available in linux-user mode,
simply use cpu_get_host_ticks() instead.
Signed-off-by: Laurent Vivier <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
---
target/sparc/helper.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/target/sparc/helper.c b/target/sparc/helper.c
index 1d854890b4..46232788c8 100644
--- a/target/sparc/helper.c
+++ b/target/sparc/helper.c
@@ -67,7 +67,9 @@ uint64_t helper_tick_get_count(CPUSPARCState *env, void
*opaque, int mem_idx)
return cpu_tick_get_count(timer);
#else
- return 0;
+ /* In user-mode, QEMU_CLOCK_VIRTUAL doesn't exist.
+ Just pass through the host cpu clock ticks. */
+ return cpu_get_host_ticks();
#endif
}
--
2.14.3
- [Qemu-devel] [PULL 00/17] Linux user for 3.0 patches, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 09/17] linux-user: move sparc/sparc64 fcntl definitions to sparc/target_fcntl.h, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 07/17] linux-user: move mips/mips64 fcntl definitions to mips/target_fcntl.h, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 06/17] linux-user: move arm/aarch64/m68k fcntl definitions to [arm|aarch64|m68k]/target_fcntl.h, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 01/17] syscall: replace strcpy() by g_strlcpy(), Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 12/17] linux-user: move sparc signal definitions to sparc/target_signal.h, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 13/17] linux-user: move mips signal definitions to mips/target_signal.h, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 11/17] linux-user: move generic signal definitions to generic/signal.h, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 16/17] linux-user: move hppa signal definitions to hppa/target_signal.h, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 02/17] linux-user: SPARC "rd %tick" can be used by user application,
Laurent Vivier <=
- [Qemu-devel] [PULL 04/17] linux-user: move alpha fcntl definitions to alpha/target_fcntl.h, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 14/17] linux-user: move openrisc signal definitions to openrisc/target_signal.h, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 05/17] linux-user: move hppa fcntl definitions to hppa/target_fcntl.h, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 08/17] linux-user: move ppc fcntl definitions to ppc/target_fcntl.h, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 17/17] linux-user: remove useless #if, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 15/17] linux-user: move alpha signal definitions to alpha/target_signal.h, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 03/17] linux-user: move generic fcntl definitions to generic/fcntl.h, Laurent Vivier, 2018/06/04
- [Qemu-devel] [PULL 10/17] linux-user: move get_sp_from_cpustate() to target_cpu.h, Laurent Vivier, 2018/06/04
- Re: [Qemu-devel] [PULL 00/17] Linux user for 3.0 patches, no-reply, 2018/06/04
- Re: [Qemu-devel] [PULL 00/17] Linux user for 3.0 patches, Peter Maydell, 2018/06/05