From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXakf-0001vo-HP for qemu-devel@nongnu.org; Wed, 20 Jan 2010 08:37:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXakb-0001td-VU for qemu-devel@nongnu.org; Wed, 20 Jan 2010 08:37:41 -0500 Received: from [199.232.76.173] (port=38516 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXakb-0001tX-M2 for qemu-devel@nongnu.org; Wed, 20 Jan 2010 08:37:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51694) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXakb-0000L9-4I for qemu-devel@nongnu.org; Wed, 20 Jan 2010 08:37:37 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0KDbZKY021079 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Jan 2010 08:37:36 -0500 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0KDbYEV023003 for ; Wed, 20 Jan 2010 08:37:35 -0500 Date: Wed, 20 Jan 2010 15:37:33 +0200 From: Gleb Natapov Message-ID: <20100120133733.GI5238@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH][rtc hack]: reduce number of reinjects on ACK List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Windows 7 BSODs under load with HAL_RTC_IRQF_WILL_NOT_CLEAR error. It happens here: hal!HalpRtcUnmaskClock: 8281b93a 8bff mov edi,edi 8281b93c 56 push esi 8281b93d 33f6 xor esi,esi 8281b93f 6a0c push 0Ch 8281b941 e8b2ffffff call hal!CMOS_READ (8281b8f8) 8281b946 84c0 test al,al 8281b948 7920 jns hal!HalpRtcUnmaskClock+0x30 (8281b96a) 8281b94a 6a0a push 0Ah 8281b94c 46 inc esi 8281b94d e854c8ffff call hal!KeStallExecutionProcessor (828181a6) 8281b952 83fe64 cmp esi,64h 8281b955 72e8 jb hal!HalpRtcUnmaskClock+0x5 (8281b93f) 8281b957 6a00 push 0 8281b959 6a00 push 0 8281b95b 6a00 push 0 8281b95d 680a010000 push 10Ah 8281b962 6a5c push 5Ch 8281b964 ff1500c38082 call dword ptr [hal!_imp__KeBugCheckEx (8280c300)] 8281b96a 5e pop esi 8281b96b c3 ret So it loops for 100(64h) times reading register C before BSOD. Lets reduce number of immediate reinjection well under this limit. Signed-off-by: Gleb Natapov diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c index e4d55c7..2616d0d 100644 --- a/hw/mc146818rtc.c +++ b/hw/mc146818rtc.c @@ -30,7 +30,7 @@ //#define DEBUG_CMOS -#define RTC_REINJECT_ON_ACK_COUNT 1000 +#define RTC_REINJECT_ON_ACK_COUNT 20 #define RTC_SECONDS 0 #define RTC_SECONDS_ALARM 1 -- Gleb.