On Mon, Nov 22, 2010 at 11:52:56AM +0100, Gerd Hoffmann wrote:
I suppose one could implement a simple SMM gateway - write a magic IO bit to invoke the SMM handler, have the SMM handler backup the cpu state somewhere in BIOS owned memory, and then leave SMM mode with execution at a BIOS handler running in 32bit flat mode.
Hmm, how about having a virtual "I/O bounce" device? Allocate two dwords in I/O space. One dword for the address, one for the data. reads and writes to the data register will be bounced to the address written into the address register.
It could work. However, having the ability to go into full 32bit mode would be more flexible.
On real hardware seabios could emulate this using SMM.
On virtual hardware qemu could emulate this so we don't need SMM support in kvm.
How hard would it be to add SMM support into kvm?
From a security point of view it might not be the best idea though.
If a program has access to iospace, it's basically fully privileged anyway, so I don't think this is a problem. (For example, the old 16bit DMA registers are fully programmed from iospace.)