From patchwork Mon Jun 4 15:20:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 925100 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40zzLf6Ynjz9s0w for ; Tue, 5 Jun 2018 01:26:50 +1000 (AEST) Received: from localhost ([::1]:40369 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPrNg-0007fp-Is for incoming@patchwork.ozlabs.org; Mon, 04 Jun 2018 11:26:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPrHt-0002Ch-A7 for qemu-devel@nongnu.org; Mon, 04 Jun 2018 11:20:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPrHp-00060f-W0 for qemu-devel@nongnu.org; Mon, 04 Jun 2018 11:20:49 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:43201) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPrHp-0005yo-L1 for qemu-devel@nongnu.org; Mon, 04 Jun 2018 11:20:45 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LdyNE-1g4hnP0tn2-00pxfn; Mon, 04 Jun 2018 17:20:31 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 4 Jun 2018 17:20:00 +0200 Message-Id: <20180604152015.13359-3-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180604152015.13359-1-laurent@vivier.eu> References: <20180604152015.13359-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:4oPks0S7VdH1ECvbv/bTecQG0FOIZINXibkwQRRlqONLDk4l8Hl HiS2QG8C+Oi9LaM1RTGCYwqpkOISOPBkzhorIXiGwxsynlbPG6Wx0oWjAUmq/FCfquidq2K 71kz/a+wpL6AM7fyxvWT3EMV2nBl8Gpd1NWJw+zsJ7TCo+l0oY2R4J5841grH6oGQt2vRpl D0Mn3rSrH26QLw77xOUOA== X-UI-Out-Filterresults: notjunk:1; V01:K0:7hV+16LbQQg=:m3PdqeMBOhJaxDgLdXBv9I ruxGcMX/o4fwwrpdweb+o69PR44uYjvEO4x7ME34rIjjNS9CR+tuLRVMWIYY+HtxRyakhN0u0 CkaKtnzvN2n9srhrGC8AtZtKDkdaZ10BAD9zlLaHyGExfJ45pckqCU3Fl9aNxx5idzzVcBxm7 w+VLg2R4OY69jp29CvhZNSjqdkBfLvVs9D2QfDUo/ETLAUwmC4itUtI6NS6YRiQ2H660kANcZ LwpattRng9YPHVIQAiJcqapPSFzyLb+JnJZnVSJlWStuRySYaiG6lrHmHyowF8uZELFdyxlvX lf9vLOxQgGolNiKD1SZ8H3qTxAkISNQ2HSsHZKScD5XE5QGQ8D2PsPgoTzfV9bHL0WgPOGPbu gY4TlhSRZ92ypvdMD7i9YXW+tNkFRWElc7VX2N6SY/P/mpoja7fNMs5yW0vHS5lCkHOlsBaaX Bl+DU25BojKvESddUrOuRGzwlbioeWnKtPod2KH/Bzh4Df5+AekTpdlPzp2+/2omiCxmfTGV7 H1/hQ+DqP11OB2JcUfEmmSQU7zWwXzGUKWwdEfP1gCAGjXtq81NNGr/rJSEZAjhWbaf1Kfjnx WY3M3kEq3FTVCdyFuz3zbNGp2DsrBoZt9kVU0KEY5/gCLmIbyXERTtPFcRvoGesszQ2qXXL46 QmkyHSdsryLVPpUHbx0c0LBq13UdBTXEoOxxVRYM4r1wrOdmMETNiW4tfm3h94ocDLnDQBRyQ +/SreZX8f/giEBfg X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.131 Subject: [Qemu-devel] [PULL 02/17] linux-user: SPARC "rd %tick" can be used by user application X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Mark Cave-Ayland , Laurent Vivier , Artyom Tarasenko Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20180528194812.31216-1-laurent@vivier.eu> --- 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 }