From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXMVA-0003UX-HT for qemu-devel@nongnu.org; Tue, 19 Jan 2010 17:24:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXMV5-0003QR-LR for qemu-devel@nongnu.org; Tue, 19 Jan 2010 17:24:43 -0500 Received: from [199.232.76.173] (port=60992 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXMV5-0003QC-8O for qemu-devel@nongnu.org; Tue, 19 Jan 2010 17:24:39 -0500 Received: from mail-fx0-f219.google.com ([209.85.220.219]:56823) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXMV4-0003d0-Ql for qemu-devel@nongnu.org; Tue, 19 Jan 2010 17:24:39 -0500 Received: by fxm19 with SMTP id 19so4164380fxm.17 for ; Tue, 19 Jan 2010 14:24:37 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20100118222820.25394.64889.stgit@skyserv> Date: Wed, 20 Jan 2010 01:24:37 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH] sparc64: reimplement tick timers v2 From: Igor Kovalenko Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl , qemu-devel@nongnu.org On Tue, Jan 19, 2010 at 9:44 PM, Blue Swirl wrote: > On Mon, Jan 18, 2010 at 10:28 PM, Igor V. Kovalenko > wrote: >> From: Igor V. Kovalenko >> >> sparc64 timer has tick counter which can be set and read, >> and tick compare value used as deadline to fire timer interrupt. >> The timer is not used as periodic timer, instead deadline >> is set each time new timer interrupt is needed. > > Does not compile: > > =A0CC =A0 =A0sparc64-softmmu/sun4u.o > cc1: warnings being treated as errors > /src/qemu/hw/sun4u.c: In function 'cpu_tick_set_count': > /src/qemu/hw/sun4u.c:467: error: implicit declaration of function > 'TIMER_DPRINTF' > make[1]: *** [sun4u.o] Error 1 Sorry forgot the split out debugging piece. New v3 has all these comments addressed. > If I add the missing TIMER_DPRINTF, Linux still crashes: > > Memory: 117376k available (2136k kernel code, 664k data, 184k init) > [fffff80000000000,0000000007e80000] > SLUB: Genslabs=3D14, HWalign=3D32, Order=3D0-3, MinObjects=3D0, CPUs=3D1,= Nodes=3D1 > Hierarchical RCU implementation. > NR_IRQS:255 > clocksource: mult[a0000] shift[16] > clockevent: mult[19999999] shift[32] > Console: colour dummy device 80x25 > Unable to handle kernel NULL pointer dereference > tsk->{mm,active_mm}->context =3D 0000000000000000 > tsk->{mm,active_mm}->pgd =3D fffff800006fdaa4 > =A0 =A0 =A0 =A0 =A0 =A0 =A0\|/ ____ \|/ > =A0 =A0 =A0 =A0 =A0 =A0 =A0"@'/ .. \`@" > =A0 =A0 =A0 =A0 =A0 =A0 =A0/_| \__/ |_\ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \__U_/ > swapper(0): Oops [#1] > TSTATE: 0000004480001607 TPC: 00000000006e32f4 TNPC: 00000000006e32f8 > Y: 00000000 =A0 =A0Not tainted > TPC: Easy to reproduce here, and I still fail to find the reason for this crash. It looks like linux kernel loads zero values from memory while returning from timer softirq handler. Note this does not always happen at first timer interrupt inside calibrate_delay loop. I really want to see debug trace of all processed instructions, but qemu command line switch -singlestep does not really work for sparc64-softm= mu and stepping through calibrate_delay does not seem to help at the moment. Any ideas on how to force all instructions after approx. 5000000 cpu cycles to be single stepped, so I get the trace in qemu.log ? --=20 Kind regards, Igor V. Kovalenko