[gPXE] [Etherboot-developers] [PATCH] [pciextra] Restore the PCI COMMAND register after writing to the BARs
Bernhard Kohl
bernhard.kohl at nsn.com
Fri Jan 22 11:09:27 EST 2010
ext Stefan Hajnoczi schrieb:
>
> Hi Bernhard,
> I hope we can debug this further to understand exactly what is going
> on here.
>
> Have you tried running gPXE on the same hardware without KVM?
>
No, I did not.
>
> > We got problems when using gPXE in KVM virtual machines with direct
> PCI device access.
>
> What happens when you run gPXE? Does the network device fail to come
> up? Does the VM hang?
>
Yes the device fails. The VM continues running. When gPXE reads the
COMMAND word from the PCI config space in function adjust_pci_device() a
wrong (random) value is returned. This value is changed by toggling some
bits and written back to the PCI config space. Depending on the new
value the device can get completely broken. This was caused by a call to
pci_bar_size() before. With my patch everything works well here.
>
> Which devices are giving you this problem? Which versions of KVM,
> Linux, and gPXE are you using?
>
Host device: Intel Corporation 82571EB Quad Port Gigabit Mezzanine
Adapter [8086:10da] (rev 06)
KVM modules 2.6.31.5
KVM/QEMU userspace: kvm-88
Fedora release 11 (Leonidas) with self built kernel 2.6.31.5
gPXE 0.9.6 self built
>
> I'd like to see what changed prior to restoring the command register:
>
> uint16_t cmd_after;
> pci_read_config_word ( pci, PCI_COMMAND, &cmd_after );
> DBG ( "pci_bar_size before=0x%x after=0x%x\n", cmd, cmd_after );
>
> If you build with "make DEBUG=pciextra" then you'll get this debug output.
>
Sorry, I need some time for setting this up again. It is more than 2
months ago when I did this.
Bernhard
> Stefan
>
More information about the gPXE
mailing list