qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: qemu-devel@nongnu.org, atar4qemu@gmail.com
Subject: [Qemu-devel] [PATCH] sun4u: update PCI topology to include simba PCI bridges
Date: Wed, 27 Sep 2017 07:45:56 +0100	[thread overview]
Message-ID: <1506494757-7352-1-git-send-email-mark.cave-ayland@ilande.co.uk> (raw)

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

             reply	other threads:[~2017-09-27  6:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27  6:45 Mark Cave-Ayland [this message]
2017-09-27  6:45 ` [Qemu-devel] [PATCH] sun4u: update PCI topology to include simba PCI bridges Mark Cave-Ayland
2017-09-27 12:09   ` Artyom Tarasenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1506494757-7352-1-git-send-email-mark.cave-ayland@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=atar4qemu@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).