Kevin O'Connor wrote:
On Sun, Jan 10, 2010 at 03:59:22PM +0100, Sebastian Herbszt wrote:
Kevin O'Connor wrote:
and if I apply the following change, it fixes the problem on bochs:
[...]
- asm volatile("sti ; hlt ; cli ; cld": : :"memory");
- asm volatile("sti ; rep ; nop ; cli ; cld": : :"memory");
[...]
However, I didn't think there was anything wrong with the original code. Am I missing something?
It should be ok. Your replacement uses PAUSE which can cause VM exits.
Yes, but I'd rather not make the change as it causes more cpu load on the host. Is there a reason why Bochs doesn't work with the original code?
I did some tracing and noticed the following:
Bochs BIOS (0) Breakpoint 1, 0x0000000000010ad4 in ?? () Next at t=158212338 (0) [0x00010ad4] 10aa:0034 (unk. ctxt): retf ; cb bochs:3 p Next at t=158212339 (0) [0x00020f41] 20f4:0001 (unk. ctxt): add bh, bh ; 00ff
SeaBIOS (0) Breakpoint 1, 0x0000000000010ad4 in ?? () Next at t=7729552430 (0) [0x00010ad4] 10aa:0034 (unk. ctxt): retf ; cb bochs:9 p Next at t=7729552431 (0) [0x00020f41] 20f4:0001 (unk. ctxt): add byte ptr ds:[bx+si], al ; 0000
Modified SeaBIOS (0) Breakpoint 1, 0x0000000000010ad4 in ?? () Next at t=394287951 (0) [0x00010ad4] 10aa:0034 (unk. ctxt): retf ; cb bochs:4 p Next at t=394287952 (0) [0x00020f41] 20f4:0001 (unk. ctxt): add bh, bh ; 00ff
So with Bochs BIOS and modified SeaBIOS we got the correct code at 20f4:0001. With not modified SeaBIOS we got zeros there. Still no clue why.
- Sebastian