From nobody Sat Apr 20 05:06:23 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549820775060701.5927507259745; Sun, 10 Feb 2019 09:46:15 -0800 (PST) Received: from localhost ([127.0.0.1]:33809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gstB5-0004yw-8R for importer@patchew.org; Sun, 10 Feb 2019 12:46:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gst9x-0004X1-7n for qemu-devel@nongnu.org; Sun, 10 Feb 2019 12:44:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gst9w-0007Oj-5a for qemu-devel@nongnu.org; Sun, 10 Feb 2019 12:44:53 -0500 Received: from chuckie.co.uk ([82.165.15.123]:53101 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gst9q-0006m0-Ir; Sun, 10 Feb 2019 12:44:47 -0500 Received: from host86-164-28-159.range86-164.btcentralplus.com ([86.164.28.159] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1gst9q-0005Q0-JQ; Sun, 10 Feb 2019 17:44:47 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, hsp.cat7@gmail.com Date: Sun, 10 Feb 2019 17:44:21 +0000 Message-Id: <20190210174421.22062-1-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 X-SA-Exim-Connect-IP: 86.164.28.159 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH] cuda: decrease time delay before raising VIA SR interrupt X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" In order to handle a race condition in MacOS 9, a delay was introduced when raising the VIA SR interrupt inspired by similar code in MacOnLinux. During original testing of the MacOS 9 patches it was found that the 30us delay used in MacOnLinux did not work reliably within QEMU, and a value of 300us was required to function correctly. Recent experiments have shown that the previous reliability issues are no longer present, and this value can be reduced down to 20us with no apparent ill effects in my local tests. This has the benefit of considerably improvi= ng the responsiveness of the ADB keyboard and mouse with the guest. Signed-off-by: Mark Cave-Ayland --- hw/misc/macio/cuda.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index c4f7a2f39b..3febacdd1e 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -97,17 +97,8 @@ static void cuda_set_sr_int(void *opaque) =20 static void cuda_delay_set_sr_int(CUDAState *s) { - MOS6522CUDAState *mcs =3D &s->mos6522_cuda; - MOS6522State *ms =3D MOS6522(mcs); - MOS6522DeviceClass *mdc =3D MOS6522_DEVICE_GET_CLASS(ms); int64_t expire; =20 - if (ms->dirb =3D=3D 0xff || s->sr_delay_ns =3D=3D 0) { - /* Disabled or not in Mac OS, fire the IRQ directly */ - mdc->set_sr_int(ms); - return; - } - trace_cuda_delay_set_sr_int(); =20 expire =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + s->sr_delay_ns; @@ -542,7 +533,7 @@ static void cuda_realize(DeviceState *dev, Error **errp) s->tick_offset =3D (uint32_t)mktimegm(&tm) + RTC_OFFSET; =20 s->sr_delay_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, cuda_set_sr_int= , s); - s->sr_delay_ns =3D 300 * SCALE_US; + s->sr_delay_ns =3D 20 * SCALE_US; =20 s->adb_poll_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, cuda_adb_poll, = s); s->adb_poll_mask =3D 0xffff; --=20 2.11.0