From: David Gibson <david@gibson.dropbear.id.au>
To: Andrea Bolognani <abologna@redhat.com>
Cc: peter.maydell@linaro.org, lvivier@redhat.com, thuth@redhat.com,
mdroth@linux.vnet.ibm.com, aik@ozlabs.ru, agraf@suse.de,
qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
sjitindarsingh@gmail.com, sam.bobroff@au1.ibm.com
Subject: Re: [Qemu-devel] [PULL 15/17] spapr_pci: Advertise access to PCIe extended config space
Date: Tue, 14 Mar 2017 12:20:39 +1100 [thread overview]
Message-ID: <20170314012039.GD12564@umbus.fritz.box> (raw)
In-Reply-To: <1489159521.3805.43.camel@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2116 bytes --]
On Fri, Mar 10, 2017 at 04:25:21PM +0100, Andrea Bolognani wrote:
> On Fri, 2017-03-03 at 14:25 +1100, David Gibson wrote:
> > The (paravirtual) PCI host bridge on the 'pseries' machine in most
> > regards acts like a regular PCI bus, rather than a PCIe bus. Despite
> > this, though, it does allow access to the PCIe extended config space.
> >
> > We already implemented the RTAS methods to allow this access.. but
> > forgot to put the markers into the device tree so that guest's know it
> > is there. This adds them in.
> >
> > With this, a pseries guest is able to view extended config space on
> > (for example an e1000e device. This should be enough to allow guests
> > to use at least some PCIe devices.
> >
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > ---
> > hw/ppc/spapr_pci.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> > index 2a3499e..919d3c2 100644
> > --- a/hw/ppc/spapr_pci.c
> > +++ b/hw/ppc/spapr_pci.c
> > @@ -1321,6 +1321,10 @@ static int spapr_populate_pci_child_dt(PCIDevice *dev, void *fdt, int offset,
> > _FDT(fdt_setprop(fdt, offset, "assigned-addresses",
> > (uint8_t *)rp.assigned, rp.assigned_len));
> >
> > + if (pci_is_express(dev)) {
> > + _FDT(fdt_setprop_cell(fdt, offset, "ibm,pci-config-space-type", 0x1));
> > + }
> > +
> > return 0;
> > }
>
> I've just realized that this is not tied to the pseries-2.9
> machine type, which means existing guests will suddenly get
> access to the Extended Config Space after upgrading QEMU.
>
> I'm not sure this will cause any issue in practice, but it
> seems like it would be safer to enable the Extended Config
> Space only for pseries-2.9 and newer machine types.
That's a good point. I've put a fix into ppc-for-2.9, will send a
pull request shortly.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-03-14 1:20 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 3:24 [Qemu-devel] [PULL 00/17] ppc-for-2.9 queue 20170303 David Gibson
2017-03-03 3:24 ` [Qemu-devel] [PULL 01/17] target/ppc: Add POWER9/ISAv3.00 to compat_table David Gibson
2017-03-03 3:24 ` [Qemu-devel] [PULL 02/17] exec, kvm, target-ppc: Move getrampagesize() to common code David Gibson
2017-03-03 3:24 ` [Qemu-devel] [PULL 03/17] powernv: Don't test POWER9 CPU yet David Gibson
2017-03-03 3:24 ` [Qemu-devel] [PULL 04/17] target/ppc/POWER9: Add POWERPC_MMU_V3 bit David Gibson
2017-03-03 3:24 ` [Qemu-devel] [PULL 05/17] target/ppc: Add patb_entry to sPAPRMachineState David Gibson
2017-03-03 3:24 ` [Qemu-devel] [PULL 06/17] target/ppc: Don't gen an SDR1 on POWER9 and rework register creation David Gibson
2017-03-03 3:24 ` [Qemu-devel] [PULL 07/17] target/ppc/POWER9: Add POWER9 mmu fault handler David Gibson
2017-03-03 3:24 ` [Qemu-devel] [PULL 08/17] target/ppc/POWER9: Add POWER9 pa-features definition David Gibson
2017-03-03 3:24 ` [Qemu-devel] [PULL 09/17] target/ppc/POWER9: Add cpu_has_work function for POWER9 David Gibson
2017-03-03 3:25 ` [Qemu-devel] [PULL 10/17] hw/ppc/spapr: Add POWER9 to pseries cpu models David Gibson
2017-03-03 3:25 ` [Qemu-devel] [PULL 11/17] target/ppc: Add Instruction Authority Mask Register Check David Gibson
2017-03-03 3:25 ` [Qemu-devel] [PULL 12/17] target/ppc: Add execute permission checking to access authority check David Gibson
2017-03-03 3:25 ` [Qemu-devel] [PULL 13/17] target/ppc: Move no-execute and guarded page checking into new function David Gibson
2017-03-03 3:25 ` [Qemu-devel] [PULL 14/17] target/ppc: Rework hash mmu page fault code and add defines for clarity David Gibson
2017-03-03 3:25 ` [Qemu-devel] [PULL 15/17] spapr_pci: Advertise access to PCIe extended config space David Gibson
2017-03-10 15:25 ` Andrea Bolognani
2017-03-14 1:20 ` David Gibson [this message]
2017-03-03 3:25 ` [Qemu-devel] [PULL 16/17] spapr: Small cleanup of PPC MMU enums David Gibson
2017-03-03 3:25 ` [Qemu-devel] [PULL 17/17] target/ppc: rewrite f[n]m[add, sub] using float64_muladd David Gibson
2017-03-03 3:40 ` [Qemu-devel] [PULL 00/17] ppc-for-2.9 queue 20170303 no-reply
2017-03-03 4:18 ` David Gibson
2017-03-03 10:23 ` Peter Maydell
2017-03-04 17:38 ` Peter Maydell
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=20170314012039.GD12564@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=abologna@redhat.com \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=lvivier@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=sam.bobroff@au1.ibm.com \
--cc=sjitindarsingh@gmail.com \
--cc=thuth@redhat.com \
/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).