Re: x86 SGDT emulation for Wine

From: Stefan Dösinger
Date: Wed Jan 03 2024 - 02:30:47 EST


Am Dienstag, 2. Januar 2024, 22:53:26 EAT schrieb Elizabeth Figura:
> I'm concerned that this will be very expensive. Most VM users don't need
> to exit on every syscall. While I haven't tested KVM, I think some other
> Wine developers actually did a similar experiment using a hypervisor to
> solve some other problem (related to 32-bit support on Mac OS), and exiting
> the hypervisor was prohibitively slow.

Just to add to this point, Ken Thomases and I experimented with this on Mac
OS, and as Zeb said, we found it to be unworkably slow. In the d3d games we
tested the performance of hypervisor + lots of exits was approximately the
same as running all 32 bit guest code inside qemu's software CPU emulation, or
about 5% of the performance of using native 32 bit mac processes (when they
still existed). From what we could tell the cost was imposed by the CPU and
not MacOS' very lightweight hypervisor API.

There are obviously differences between Mac and Linux, and with Wine's new
syscalls we probably don't need to exit as often as my hangover wrapper DLLs
did, but combined with the other reasons Zeb listed I don't think running Wine
inside KVM is ever going to be realistic.

Attachment: signature.asc
Description: This is a digitally signed message part.