From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linaro.org
Cc: groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
clg@kaod.org, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 06/43] cuda: decrease time delay before raising VIA SR interrupt and remove fast path
Date: Tue, 19 Feb 2019 01:30:12 +1100 [thread overview]
Message-ID: <20190218143049.17142-7-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au>
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
In order to handle a race condition in the MacOS 9 CUDA driver, 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 two things: firstly when booting Linux,
MacOS 9 and MacOS X the fast path which bypasses the delay is never
triggered once the OS kernel is loaded making it effectively
useless. Rather than leave this code in place where a guest could
potentially enable it by accident and break itself, we might as well
just remove it.
Secondly the previous reliability issues are no longer present, and
this value can be reduced down to 20us with no apparent ill
effects. This has the benefit of considerably improving the
responsiveness of the ADB keyboard and mouse within the guest.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
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;
--
2.20.1
next prev parent reply other threads:[~2019-02-18 14:31 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-18 14:30 [Qemu-devel] [PULL 00/43] ppc-for-4.0 queue 20190219 David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 01/43] hw/ppc/prep: Drop useless inclusion of "hw/i386/pc.h" David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 02/43] spapr: Rename xics to intc in interrupt controller agnostic code David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 03/43] target/ppc: Enable reporting of SPRs to GDB David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 04/43] target/ppc: Fix msync to do what hardware does David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 05/43] spapr_pci: Fix interrupt leak in rtas_ibm_change_msi() error path David Gibson
2019-02-18 14:30 ` David Gibson [this message]
2019-02-18 14:30 ` [Qemu-devel] [PULL 07/43] spapr: Disallow unsupported kernel-irqchip settings David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 08/43] mac_newworld: change default NIC to sungem for mac99 machine David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 09/43] target/ppc: Remove some #if 0'ed code David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 10/43] ppc: fix crash during branch stepping David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 11/43] xive: Only set source type for LSIs David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 12/43] qdev: pass an Object * to qbus_set_hotplug_handler() David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 13/43] target/ppc: Disable ISA 2.06 PM instructions on POWER9 David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 14/43] spapr: fix out of bounds write in spapr_populate_drmem_v2 David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 15/43] spapr/irq: add an 'nr_irq' parameter to initialize the backend David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 16/43] spapr/irq: remove the XICS offset adjustment David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 17/43] xics: Explicitely call KVM ICP methods from the common code David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 18/43] xics: Handle KVM ICP reset " David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 19/43] xics: Handle KVM ICP realize " David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 20/43] spapr/irq: Use the base ICP class for KVM David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 21/43] xics: Drop the KVM ICP class David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 22/43] xics: Explicitely call KVM ICS methods from the common code David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 23/43] xics: Handle KVM ICS reset from the "simple" ICS code David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 24/43] xics: Handle KVM interrupt presentation from " David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 25/43] spapr/irq: Use the "simple" ICS class for KVM David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 26/43] xics: Drop the KVM ICS class David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 27/43] target/ppc: convert VMX logical instructions to use vector operations David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 28/43] target/ppc: convert vaddu[b, h, w, d] and vsubu[b, h, w, d] over " David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 29/43] target/ppc: convert vspltis[bhw] " David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 30/43] target/ppc: convert vsplt[bhw] " David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 31/43] target/ppc: convert VSX logical operations to " David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 32/43] target/ppc: convert xxspltib " David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 33/43] target/ppc: convert xxspltw " David Gibson
2020-11-06 18:47 ` Peter Maydell
2020-11-06 19:44 ` Richard Henderson
2019-02-18 14:30 ` [Qemu-devel] [PULL 34/43] target/ppc: convert xxsel " David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 35/43] target/ppc: Pass integer to helper_mtvscr David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 36/43] target/ppc: Use helper_mtvscr for reset and gdb David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 37/43] target/ppc: Remove vscr_nj and vscr_sat David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 38/43] target/ppc: Add helper_mfvscr David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 39/43] target/ppc: Use mtvscr/mfvscr for vmstate David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 40/43] target/ppc: Add set_vscr_sat David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 41/43] target/ppc: Split out VSCR_SAT to a vector field David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 42/43] target/ppc: convert vadd*s and vsub*s to vector operations David Gibson
2019-02-18 14:30 ` [Qemu-devel] [PULL 43/43] target/ppc: convert vmin* and vmax* " David Gibson
2019-02-19 9:37 ` [Qemu-devel] [PULL 00/43] ppc-for-4.0 queue 20190219 Peter Maydell
2019-02-20 15:43 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2019-02-20 15:49 ` Peter Maydell
2019-02-20 15:56 ` Cédric Le Goater
2019-02-20 16:02 ` Peter Maydell
2019-02-20 16:54 ` Greg Kurz
2019-02-21 1:05 ` David Gibson
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=20190218143049.17142-7-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=clg@kaod.org \
--cc=groug@kaod.org \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=peter.maydell@linaro.org \
--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).