From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZuXc-0006v8-I8 for qemu-devel@nongnu.org; Tue, 26 Jan 2010 18:09:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZuXV-0006uH-RU for qemu-devel@nongnu.org; Tue, 26 Jan 2010 18:09:47 -0500 Received: from [199.232.76.173] (port=36530 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZuXV-0006uE-Md for qemu-devel@nongnu.org; Tue, 26 Jan 2010 18:09:41 -0500 Received: from mail-fx0-f222.google.com ([209.85.220.222]:41223) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZuXV-00082k-6f for qemu-devel@nongnu.org; Tue, 26 Jan 2010 18:09:41 -0500 Received: by fxm22 with SMTP id 22so9797681fxm.2 for ; Tue, 26 Jan 2010 15:09:39 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20100119222515.20170.38945.stgit@skyserv> Date: Wed, 27 Jan 2010 02:09:39 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH] sparc64: reimplement tick timers v3 From: Igor Kovalenko Content-Type: text/plain; charset=ISO-8859-1 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On Fri, Jan 22, 2010 at 11:32 PM, Blue Swirl wrote: > On Tue, Jan 19, 2010 at 10:25 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. >> >> v2 -> v3: >> - added missing timer debug output macro >> - CPUTimer struct and typedef moved to cpu.h >> - change CPU_SAVE_VERSION to 6, older save formats not supported >> >> v1 -> v2: >> - new conversion helpers cpu_to_timer_ticks and timer_to_cpu_ticks >> - save offset from clock source to implement cpu_tick_set_count >> - renamed struct sun4u_timer to CPUTimer >> - load and save cpu timers >> >> v0 -> v1: >> - coding style > > My debugging of Linux panic has not been very fruitful. Once I got the > panic triggered while single stepping calibrate_delay() with GDB and > keeping enter key pressed. Then I missed the fault though. > > One possible problem is that 4dc28134f3d7db0033c6b3c5bc4be9a91adb3e2b > added interrupt checks to the helpers which means that they can cause > faults, but translation of the instructions was not changed to take > this into account. But when I added calls to save_state() in > translate.c, it didn't change anything. The issue is with PUT_CWP64 - linux kernel does read cwp which happens to be zero, decrements it and writes the result to cwp. Expected value is max window id but we store zero cwp, and return path from trap handler does restore wrong window. I'll post the fix now, and then try to clean up the rest of timer patch. -- Kind regards, Igor V. Kovalenko