Muli Ben-Yehuda wrote:
On Tue, Sep 23, 2008 at 11:30:32AM -0500, Anthony Liguori wrote:
+ + (addr - r_access->e_physbase);
+
+ if (r_access->debug & DEVICE_ASSIGNMENT_DEBUG_PIO) {
+ fprintf(stderr, "%s: r_pio=%08x e_physbase=%08x"
+ " r_virtbase=%08lx value=%08x\n",
+ __func__, r_pio, (int)r_access->e_physbase,
+ (unsigned long)r_access->r_virtbase, value);
+ }
+ iopl(3);
+ outb(value, r_pio);
The formatting is wrong for this entire file. Also, you shouldn't
have device specific debug. Should probably error check iopl(3).
It's not necessary to call it every time you do an outb, just once
when initialized.
We tried that at first, but ran into cases where even after iopl()
ran, pio's from qemu still failed. Does qemu do anything to drop
iopl() privileges? In any case calling iopl() unconditionally on every
pio fixed it, but is obviously not the right long-term solution.
Make sure you issue iopl() before any of the VCPU threads are spawned.
Otherwise, you may be running into issues when something other than
VCPU-0 is doing PIO/MMIO and you haven't iopl()'d for that thread.
Regards,
Anthony Liguori
Cheers,
Muli
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html