qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] sun4u: update PCI topology to include simba PCI bridges
@ 2017-09-27  6:45 Mark Cave-Ayland
  2017-09-27  6:45 ` Mark Cave-Ayland
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Cave-Ayland @ 2017-09-27  6:45 UTC (permalink / raw)
  To: qemu-devel, atar4qemu

This patch implements what I've been working towards over the past few
months in order to get a more realistic Ultra 5 model for the sun4u
machine. The basic change is that devices are no longer plugged into the
PCI root bus, but behind PCI busA for in-built devices and PCI busB for all
other devices.

Note: this patch requires my previous fix for allowing 32-bit PCI IO
accesses through the PCI bridge posted at
https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg06371.html in
order for devices plugged into PCI busB to function correctly.

The benefits of this patch are that guest OSs can map PCI BARs correctly
without overlapping (Linux currently issues several warnings about this
on boot) and interrupt routing is updated to match the official
documentation.

For users the main visible change is that it is no longer possible to
plug PCI devices into the PCI root bus, but instead devices should be
added to PCI busB. For example with this patchset if you try and plug
a virtio-blk-pci device as before you now get this error:

$ ./qemu-system-sparc64 -device virtio-blk-pci,...
qemu-system-sparc64: -device virtio-blk-pci: PCI: no slot/function available
for virtio-blk-pci, all in use or reserved

Instead the correct command line should be:

$ ./qemu-system-sparc64 -device virtio-blk-pci,bus=pciB,...

Since the patch changes the PCI IO space, PCI topology and interrupt
routing I've included a custom-built openbios-sparc64 to maintain
bisectability. Once this patch has been applied I will immediately send
an updated MR to sync the OpenBIOS submodule and binaries once again.

As it stands the patch is reasonably straightforward: the hardest part
is related to the in-built sunhme network card since the combination
of QEMU's -netdev syntax not supporting in-built NICs and
pci_nic_init_nofail() asserting if not using the PCI root bus lead to
some interesting code. I hope that I've managed to come up with a solution
that implements reasonable behaviour in these cases.

On a final note I should add that this passes all my OpenBIOS SPARC64
image boot tests without introducing regressions, and whilst we introduce
PCI topology changes there is no effect on migration because the sun4u
machine is currently not migratable.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


Mark Cave-Ayland (1):
  sun4u: update PCI topology to include simba PCI bridges

 hw/pci-host/apb.c        |   47 +++++++++++++++++++++++++++---------
 hw/sparc64/sun4u.c       |   60 +++++++++++++++++++++++++++++++++-------------
 pc-bios/openbios-sparc64 |  Bin 1593408 -> 1593408 bytes
 3 files changed, 79 insertions(+), 28 deletions(-)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-27 12:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-27  6:45 [Qemu-devel] [PATCH] sun4u: update PCI topology to include simba PCI bridges Mark Cave-Ayland
2017-09-27  6:45 ` Mark Cave-Ayland
2017-09-27 12:09   ` Artyom Tarasenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).