From: Alexander Graf <agraf@suse.de>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: "qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"david@gibson.dropbear.id.au" <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH 3/4] spapr: Code more defensively against lack of primary PCI bus
Date: Tue, 30 Apr 2013 14:29:05 +0200 [thread overview]
Message-ID: <517FB911.7030204@suse.de> (raw)
In-Reply-To: <517FB3FA.3040007@ozlabs.ru>
On 04/30/2013 02:07 PM, Alexey Kardashevskiy wrote:
> On 04/30/2013 09:56 PM, Alexander Graf wrote:
>>
>> Am 30.04.2013 um 13:52 schrieb Alexey Kardashevskiy<aik@ozlabs.ru>:
>>
>>> On 04/30/2013 09:30 PM, Alexander Graf wrote:
>>>>
>>>> Am 30.04.2013 um 13:15 schrieb Alexey Kardashevskiy<aik@ozlabs.ru>:
>>>>
>>>>> On 04/30/2013 07:45 PM, Alexander Graf wrote:
>>>>>> On 30.04.2013, at 06:33, Alexey Kardashevskiy wrote:
>>>>>>
>>>>>>> Currently sPAPR always creates a primary PCI host bridge for emulated PCI
>>>>>>> devices. However, because the platform supports native virtual IO, and
>>>>>>> can also support multiple independent PCI host bridges, it's quite often
>>>>>>> useful to disable the primary bridge for debugging purposes.
>>>>>>>
>>>>>>> This patch, therefore, makes the code cope more gracefully with a missing
>>>>>>> primary host bridge.
>>>>>> Does this handle the -net case too? What about disks?
>>>>>>
>>>>>> If those use a different mechanism to find their bus, maybe it'd be better to instead do
>>>>>>
>>>>>> if (phb) {
>>>>>> pcibus = phb->bus;
>>>>>> } else {
>>>>>> pcibus = find_pci_bus();
>>>>>> }
>>>>>>
>>>>>> In fact, maybe the code already deals with bus==NULL?
>>>>>
>>>>> I needed it to deal with phb==NULL.
>>>>>
>>>>> The story behind this patch is that while doing VFIO stuff, I have to deal
>>>>> with multiple PHBs. And sometime I want to be 100% sure that it is just
>>>>> VFIO PHB and no emulated PCI stuff (especially when I debug USB PCI card in
>>>>> VFIO) so I simply commented out the call which creates default emulated PHB
>>>>> and that would be it if the existing code did not try to use phb->bus.
>>>> Then this code does nor belong in upstream. If you want to have full control over instantiated devices, implement -nodefaults.
>>>
>>> -nodefaults means no default devices but it is still expected to create PCI
>>> bus and libvirt heavily uses this feature.
>> Your patch only addresses default device creation.
>
> It makes it easier to disable emulated PHB by commenting out one single
> line in the code. Profit.
It adds untested code paths. Nack.
> If there was a way to tell QEMU via command line not to create default
> emulated PHB, sure I would have implemented it but it is not there. And
> this is for debug, not for a normal use so there is no point in inventing
> such a parameter for qemu.
Take a look at what your patch does, then at your comment and then start
thinking please.
Alex
next prev parent reply other threads:[~2013-04-30 12:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-30 4:33 [Qemu-devel] [0/4] General updates for pseries Alexey Kardashevskiy
2013-04-30 4:33 ` [Qemu-devel] [PATCH 1/4] pseries: Factor out check for out-of-bounds LIOBN Alexey Kardashevskiy
2013-04-30 4:33 ` [Qemu-devel] [PATCH 2/4] pseries: Fix debug message for out-of-bounds address in H_PUT_TCE Alexey Kardashevskiy
2013-04-30 4:33 ` [Qemu-devel] [PATCH 3/4] spapr: Code more defensively against lack of primary PCI bus Alexey Kardashevskiy
2013-04-30 9:45 ` Alexander Graf
2013-04-30 11:15 ` Alexey Kardashevskiy
2013-04-30 11:30 ` Alexander Graf
2013-04-30 11:52 ` Alexey Kardashevskiy
2013-04-30 11:56 ` Alexander Graf
2013-04-30 12:07 ` Alexey Kardashevskiy
2013-04-30 12:29 ` Alexander Graf [this message]
2013-04-30 4:33 ` [Qemu-devel] [PATCH 4/4] pseries: Update SLOF firmware image Alexey Kardashevskiy
2013-04-30 9:39 ` [Qemu-devel] [0/4] General updates for pseries Alexander Graf
2013-04-30 9:46 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2013-04-30 11:17 ` [Qemu-devel] " Alexey Kardashevskiy
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=517FB911.7030204@suse.de \
--to=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).