From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MDzjF-0007pW-6U for qemu-devel@nongnu.org; Tue, 09 Jun 2009 07:42:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MDzjA-0007gp-KK for qemu-devel@nongnu.org; Tue, 09 Jun 2009 07:42:56 -0400 Received: from [199.232.76.173] (port=40708 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MDzj9-0007gL-Ql for qemu-devel@nongnu.org; Tue, 09 Jun 2009 07:42:52 -0400 Received: from mx2.redhat.com ([66.187.237.31]:38503) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MDzj8-00028g-KE for qemu-devel@nongnu.org; Tue, 09 Jun 2009 07:42:50 -0400 Message-ID: <4A2E4AD1.2080900@redhat.com> Date: Tue, 09 Jun 2009 14:43:13 +0300 From: Dor Laor MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCHv2] Add rtc reset function. References: <20090609092605.GU27210@redhat.com> <4A2E3819.8050509@siemens.com> <20090609103941.GV27210@redhat.com> In-Reply-To: <20090609103941.GV27210@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: dlaor@redhat.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: Jan Kiszka , Anthony Liguori , qemu-devel@nongnu.org Gleb Natapov wrote: > On Tue, Jun 09, 2009 at 12:23:21PM +0200, Jan Kiszka wrote: > >>> +static void rtc_reset(void *opaque) >>> +{ >>> + RTCState *s = opaque; >>> + >>> + s->cmos_data[RTC_REG_B] &= ~(REG_B_PIE | REG_B_AIE | REG_B_SQWE); >>> + s->cmos_data[RTC_REG_C] &= ~(REG_C_UF | REG_C_IRQF | REG_C_PF | REG_C_AF); >>> + >>> + qemu_irq_lower(s->irq); >>> + >>> +#ifdef TARGET_I386 >>> + if (rtc_td_hack) >>> + s->irq_coalesced = 0; >>> >> Sorry, missed that on first run: Isn't it safer, clearer, more beautiful >> to reset this unconditionally? >> >> > It doesn't really matter. From safety point of view the code is safe. > > Actually we should drop this rtc-td-hack flag entirely. The time drift fix is now only compiled for x86 so it will be harmless for other arch. Users are affected by not calling it although it is a must for every OS that uses rtc clock source and cannot deal with drifts (aka all windows, and some of the Linux guests). Anthony, will you accept such a patch to remove rtc-td-hack or at least change it's default? > -- > Gleb. > > >