From: David Gibson <david@gibson.dropbear.id.au>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, hsp.cat7@gmail.com
Subject: Re: [Qemu-devel] [PATCH] cuda: decrease time delay before raising VIA SR interrupt
Date: Mon, 11 Feb 2019 10:16:30 +1100 [thread overview]
Message-ID: <20190210231629.GB7230@umbus.fritz.box> (raw)
In-Reply-To: <20190210174421.22062-1-mark.cave-ayland@ilande.co.uk>
[-- Attachment #1: Type: text/plain, Size: 2348 bytes --]
On Sun, Feb 10, 2019 at 05:44:21PM +0000, Mark Cave-Ayland wrote:
> 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 improving
> the responsiveness of the ADB keyboard and mouse with the guest.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Applied to ppc-for-4.0, thanks.
> ---
> 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)
>
> static void cuda_delay_set_sr_int(CUDAState *s)
> {
> - MOS6522CUDAState *mcs = &s->mos6522_cuda;
> - MOS6522State *ms = MOS6522(mcs);
> - MOS6522DeviceClass *mdc = MOS6522_DEVICE_GET_CLASS(ms);
> int64_t expire;
>
> - if (ms->dirb == 0xff || s->sr_delay_ns == 0) {
> - /* Disabled or not in Mac OS, fire the IRQ directly */
> - mdc->set_sr_int(ms);
> - return;
> - }
> -
> trace_cuda_delay_set_sr_int();
>
> expire = 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 = (uint32_t)mktimegm(&tm) + RTC_OFFSET;
>
> s->sr_delay_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, cuda_set_sr_int, s);
> - s->sr_delay_ns = 300 * SCALE_US;
> + s->sr_delay_ns = 20 * SCALE_US;
>
> s->adb_poll_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, cuda_adb_poll, s);
> s->adb_poll_mask = 0xffff;
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-02-10 23:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-10 17:44 [Qemu-devel] [PATCH] cuda: decrease time delay before raising VIA SR interrupt Mark Cave-Ayland
2019-02-10 23:16 ` David Gibson [this message]
2019-02-11 23:35 ` Philippe Mathieu-Daudé
2019-02-12 6:59 ` Mark Cave-Ayland
2019-02-12 11:03 ` [Qemu-devel] [Qemu-ppc] " BALATON Zoltan
2019-02-12 16:51 ` Mark Cave-Ayland
2019-02-12 17:21 ` Philippe Mathieu-Daudé
2019-02-12 17:50 ` Mark Cave-Ayland
2019-02-12 18:21 ` Philippe Mathieu-Daudé
2019-02-12 20:01 ` Mark Cave-Ayland
2019-02-13 0:21 ` David Gibson
2019-02-13 7:08 ` Mark Cave-Ayland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190210231629.GB7230@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=hsp.cat7@gmail.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).