Skip to contentSkip to conversation

PCI Bios fixup

Qemu-devel Samuel Thibault 2 participants 2 messages Sep 7, 2006 – Sep 9, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

The patch that qemu applies to bochs bios is a bit bugged:

pci_pro_fail:
pop edi
pop esi
- sti
popf
stc
+ and dword ptr[esp+4],0xfffffffc ;; reset CS.RPL for kqemu retf

The and operation clears carry... So that pci functions always leave carry clear, and hence tell operating systems that they always work... This should rather be:

pci_pro_fail:
pop edi
pop esi
- sti
popf
+ and dword ptr[esp+4],0xfffffffc ;; reset CS.RPL for kqemu stc
retf

Samuel

#1 lore raw

Right, this is better. An even better fix would be to clear CS.RPL before the popf.

Regards,

Fabrice.

Quoted 35 lines · Samuel Thibault

Hi,

The patch that qemu applies to bochs bios is a bit bugged:

pci_pro_fail:
pop edi
pop esi

(quoted diff) +1 -1
-  sti
   popf
   stc
+  and dword ptr[esp+4],0xfffffffc ;; reset CS.RPL for kqemu
   retf

The and operation clears carry... So that pci functions always leave carry clear, and hence tell operating systems that they always work... This should rather be:

pci_pro_fail:
pop edi
pop esi

(quoted diff) +1 -1
-  sti
   popf
+  and dword ptr[esp+4],0xfffffffc ;; reset CS.RPL for kqemu
   stc
   retf

Samuel

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel