From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jg0i6-0002WY-RH for qemu-devel@nongnu.org; Sun, 30 Mar 2008 12:48:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jg0i5-0002Vq-BT for qemu-devel@nongnu.org; Sun, 30 Mar 2008 12:48:46 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jg0i4-0002Vk-Vs for qemu-devel@nongnu.org; Sun, 30 Mar 2008 12:48:45 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jg0i4-0004Kv-Bi for qemu-devel@nongnu.org; Sun, 30 Mar 2008 12:48:44 -0400 From: Volker Ruppert Date: Sun, 30 Mar 2008 18:48:29 +0200 References: <20080330154135.GB1402@ohio.lan> In-Reply-To: <20080330154135.GB1402@ohio.lan> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803301848.29884.info@vruppert.de> Subject: [Qemu-devel] Re: [Bochs-developers] [PATCH] BIOS delay_ms optimized away with BX_QEMU enabled Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: bochs-developers@lists.sourceforge.net Cc: Kevin O'Connor , David Wentzlaff , qemu-devel@nongnu.org Hi, > On Thu, Mar 27, 2008 at 10:12:43PM -0400, David Wentzlaff wrote: > > When performing SMP probing, smp_probe() waits for 10ms by executing > > delay_ms(10). When compiling the BIOS for QEMU (BX_QEMU defined), > > delay_ms() simply spins with a 'for' loop. > > Hi David, > > Do you know why QEMU uses different code for the delay? What's wrong > with using inb(0x61) for both bochs and qemu? Bochs really supports the refresh toggle bit of port 0x61, but Qemu toggles on every read access. I have created a patch for Qemu that implements the 15 usec toggle, but the Qemu developers haven't accepted it. They are not sure whether the refresh toggle bit exists on modern hardware. --- /home/volker/qemu/hw/pcspk.c 2006-07-05 01:20:54.000000000 +0200 +++ ./hw/pcspk.c 2006-10-01 19:28:43.952247192 +0200 @@ -38,7 +38,7 @@ unsigned int samples; unsigned int play_pos; int data_on; - int dummy_refresh_clock; + int refresh_clock; } PCSpkState; static const char *s_spk = "pcspk"; @@ -117,10 +117,10 @@ PCSpkState *s = opaque; int out; - s->dummy_refresh_clock ^= (1 << 4); + s->refresh_clock = (((qemu_get_clock(vm_clock) / 15000) & 1) << 4); out = pit_get_out(s->pit, 2, qemu_get_clock(vm_clock)) << 5; - return pit_get_gate(s->pit, 2) | (s->data_on << 1) | s->dummy_refresh_clock | out; + return pit_get_gate(s->pit, 2) | (s->data_on << 1) | s->refresh_clock | out; } static void pcspk_ioport_write(void *opaque, uint32_t addr, uint32_t val) -- Bye Volker