On 03/09/2026 12:50, Kirill A. Korinsky wrote:
The CUDA model assumes a 20 microsecond delay before each shift
register interrupt. OpenBSD times out during device discovery with that
timing, so retain the existing default but allow an override.
This is curious: 20us is effectively nothing, but we need a slight delay otherwise
MacOS 9 fails to read from the CUDA device (maybe one day I will analyse the code to
understand why this is the case).
Can you explain a bit more why 20us is enough to cause a timeout but only for
OpenBSD?
Signed-off-by: Kirill A. Korinsky <[email protected]>
---
hw/misc/macio/cuda.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c
index ccb3e1d74b..a62fdf23b9 100644
--- a/hw/misc/macio/cuda.c
+++ b/hw/misc/macio/cuda.c
@@ -535,7 +535,6 @@ 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 = 20 * SCALE_US;
adb_register_autopoll_callback(adb_bus, cuda_adb_poll, s);
}
@@ -557,6 +556,8 @@ static void cuda_init(Object *obj)
static const Property cuda_properties[] = {
DEFINE_PROP_UINT64("timebase-frequency", CUDAState, tb_frequency, 0),
+ DEFINE_PROP_UINT64("sr-delay-ns", CUDAState, sr_delay_ns,
+ 20 * SCALE_US),
};
static void cuda_class_init(ObjectClass *oc, const void *data)
ATB,
Mark.