From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GrhrC-0007Lb-OM for qemu-devel@nongnu.org; Tue, 05 Dec 2006 16:29:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Grhqy-0007Dt-AN for qemu-devel@nongnu.org; Tue, 05 Dec 2006 16:29:29 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Grhqt-0007Do-7z for qemu-devel@nongnu.org; Tue, 05 Dec 2006 16:29:23 -0500 Received: from [147.32.9.3] (helo=mailgw1.fjfi.cvut.cz) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Grhqs-00044Y-V8 for qemu-devel@nongnu.org; Tue, 05 Dec 2006 16:29:23 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgw1.fjfi.cvut.cz (Postfix) with ESMTP id 23580112F23 for ; Tue, 5 Dec 2006 22:29:21 +0100 (CET) Received: from mailgw1.fjfi.cvut.cz ([127.0.0.1]) by localhost (mailgw1.fjfi.cvut.cz [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id D1cWeBgcrEDz for ; Tue, 5 Dec 2006 22:29:09 +0100 (CET) Received: from KMLinux.fjfi.cvut.cz (KMLinux.fjfi.cvut.cz [147.32.8.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailgw1.fjfi.cvut.cz (Postfix) with ESMTP id 65140112F20 for ; Tue, 5 Dec 2006 22:29:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by KMLinux.fjfi.cvut.cz (Postfix) with ESMTP id EA5CA111DC5 for ; Tue, 5 Dec 2006 22:29:08 +0100 (CET) Date: Tue, 5 Dec 2006 22:29:08 +0100 (CET) From: Miroslav Novak Subject: Re: [Qemu-devel] [PATCH] intentinoal slowing down qemu - brake In-Reply-To: <456EF118.4040705@utia.cas.cz> Message-ID: References: <456EF118.4040705@utia.cas.cz> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org I'm sending some more facts that should make clear why I think the functionality provided by the patch is relevant. (At least for the DOS emulation.) Making emulated CPU slower Some old DOS games runs too fast on modern CPUs, even the qemu-emulted ones. This patch can make these games playable. The problem was reported in http://qemu-forum.ipi.fi/viewtopic.php?t=1264 Energy saving MSDOS doesn't use HLT insn. Even if the dosidle can help in command prompt, it doesn't work in other programs such as games. This was reported in http://qemu-forum.ipi.fi/viewtopic.php?t=1372 The similar approach is used in dosbox by setting "CPU cycles". I think qemu is better than dosbox, so it makes sense to me to include such capability too. This patch doesn't try to emulate the task scheduler that was why Martin voted against it. I'm sorry if I wasnt't clear enough in my first post. Mirek. On Thu, 30 Nov 2006, Miroslav Novak wrote: > This patch adds support for slowing down qemu and saving cpu load. > The '-brake' command line parameter or monitor command 'brake' determines how > long to wait in the main_loop with respect to duration of time that qemu used > for the emulation itself. > Thus e.g. zero value runs at full speed, 1 at 1/2 speed, 10 at 1/11 speed, > etc. > > A drawback of this approach is that the timer interrupt can be missed if > raised too often. This happens if the loop_main divided by (1+brake) is less > than the frequency of PIC interrupts. > In such case the time of emulated system runs slowly. > > This problem occurs mainly for Linux emulation where kernel parameter HZ is of > several hunderds. > For DOS emulation, where the timer interrupts are raised usualy at 18Hz, this > approach works nice, and one can play old DOS games at reasonable speed and > save batteries. > > > Mirek > >