From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH v2 8/9] qemu-kvm: Refresh MSI settings after vmload
Date: Wed, 27 Apr 2011 19:26:53 +0300 [thread overview]
Message-ID: <20110427162653.GA26993@redhat.com> (raw)
In-Reply-To: <4DB84264.4040007@siemens.com>
On Wed, Apr 27, 2011 at 06:20:52PM +0200, Jan Kiszka wrote:
> On 2011-04-27 18:02, Michael S. Tsirkin wrote:
> > On Wed, Apr 27, 2011 at 05:21:43PM +0200, Jan Kiszka wrote:
> >> On 2011-04-27 17:09, Michael S. Tsirkin wrote:
> >>> On Wed, Apr 27, 2011 at 04:39:53PM +0200, Jan Kiszka wrote:
> >>>> On 2011-04-27 16:30, Michael S. Tsirkin wrote:
> >>>>>>>> --- a/hw/pci.c
> >>>>>>>> +++ b/hw/pci.c
> >>>>>>>> @@ -34,6 +34,7 @@
> >>>>>>>> #include "device-assignment.h"
> >>>>>>>> #include "qemu-objects.h"
> >>>>>>>> #include "range.h"
> >>>>>>>> +#include "msi.h"
> >>>>>>>>
> >>>>>>>> //#define DEBUG_PCI
> >>>>>>>> #ifdef DEBUG_PCI
> >>>>>>>> @@ -342,6 +343,7 @@ static int get_pci_config_device(QEMUFile *f, void *pv, size_t size)
> >>>>>>>> memcpy(s->config, config, size);
> >>>>>>>>
> >>>>>>>> pci_update_mappings(s);
> >>>>>>>> + msi_post_load(s);
> >>>>>>>
> >>>>>>> Pls don't do this: I'm trying to keep just the core in
> >>>>>>> pci.c and all capabilities in separate files.
> >>>>>>> msix has msix_load, msi will just need one too,
> >>>>>>> and let all devices call that.
> >>>>>>>
> >>>>>>
> >>>>>> Preferred alternatives are...? Registering a vmstate for msi?
> >>>>>>
> >>>>>> Jan
> >>>>>
> >>>>> Add msi_load and call that from devices that need it.
> >>>>> Like msix_load does now.
> >>>>>
> >>>>
> >>>> msix_load/save are refactoring candidates IMHO. MSI-X has a real need
> >>>> for storing additional state information, so it should register its own
> >>>> subsection.
> >>>
> >>> That's an implementation detail though, isn't it.
> >>>
> >>>> I don't want to offload this burden to the devices also for
> >>>> MSI.
> >>>> From the devices' POV, why shouldn't msi_init suffice?
> >>>>
> >>>> Jan
> >>>
> >>> One can also claim this about config writes:
> >>> pci_bridge_write_config(d, address, val, len);
> >>> pcie_cap_flr_write_config(d, address, val, len);
> >>> pcie_cap_slot_write_config(d, address, val, len);
> >>> msi_write_config(d, address, val, len);
> >>> pcie_aer_write_config(d, address, val, len);
> >>> which arguably just duplicates the initialization sequence.
> >>>
> >>> What I'm trying to do though is to keep it modular and
> >>> keep module inter-dependencies to a minimum,
> >>> so that pci is the core and msix depends on it
> >>> but not the other way around.
> >>
> >> I still don't see the bigger benefit in saving a single bidirectional
> >> dependency at core level vs. saving additional callbacks at each and
> >> every MSI user. The latter is also a source for bugs.
> >>
> >> Jan
> >
> > Yes but let us be consistent with how e.g. config writes are
> > handled. As I said
> >
> >>> What I think we should do is to add a pci subdirectory, move all
> >>> of the stuff there, move pci.c to pci/core.c and
> >>> add a high level module that depends on them all
> >>> and deals with all the capabilities.
> >
> > Which will solve both issues without need for tradeoffs.
>
> OK, but this patch is not about doing a pci refactoring. And it should
> not touch any device without a need. So what is your suggestion again?
>
> Jan
Either add msi_load call in 4 msi users or keep your patch as is. I'll fix
it up when I do the refactoring.
> --
> Siemens AG, Corporate Technology, CT T DE IT 1
> Corporate Competence Center Embedded Linux
prev parent reply other threads:[~2011-04-27 16:27 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-26 13:19 [PATCH v2 0/9] qemu-kvm: Clean up and enhance MSI irqchip support Jan Kiszka
2011-04-26 13:19 ` [PATCH v2 1/9] qemu-kvm: Drop unneeded kvm_irq_routing_entry declaration Jan Kiszka
2011-04-26 13:19 ` [PATCH v2 2/9] qemu-kvm: Rename kvm_msix_message to KVMMsiMessage Jan Kiszka
2011-04-26 13:19 ` [PATCH v2 3/9] qemu-kvm: Refactor MSI core API of KVM Jan Kiszka
2011-04-26 13:19 ` [PATCH v2 4/9] qemu-kvm: Fix and clean up msix vector use/unuse hooks Jan Kiszka
2011-04-26 13:19 ` [PATCH v2 5/9] qemu-kvm: Move gsi bits from kvm_msix_vector_add to kvm_msi_add_message Jan Kiszka
2011-04-26 13:19 ` [PATCH v2 6/9] qemu-kvm: Move entry comparison into kvm_msi_update_message Jan Kiszka
2011-04-26 13:19 ` [PATCH v2 7/9] qemu-kvm: Add in-kernel irqchip support for MSI Jan Kiszka
2011-04-26 13:19 ` [PATCH v2 8/9] qemu-kvm: Refresh MSI settings after vmload Jan Kiszka
2011-04-26 13:19 ` [PATCH v2 9/9] qemu-kvm: hpet: Add MSI support for in-kernel irqchip mode Jan Kiszka
2011-04-26 13:30 ` Michael Tokarev
2011-04-26 13:55 ` Jan Kiszka
2011-04-26 13:56 ` Avi Kivity
2011-04-26 13:58 ` Jan Kiszka
2011-04-26 14:01 ` [PATCH v3 " Jan Kiszka
2011-04-26 16:06 ` Christoph Hellwig
2011-04-26 17:06 ` Jan Kiszka
2011-04-26 17:09 ` Christoph Hellwig
2011-04-27 7:27 ` [PATCH v2 0/9] qemu-kvm: Clean up and enhance MSI irqchip support Avi Kivity
2011-04-27 9:00 ` Jan Kiszka
2011-04-27 9:04 ` Avi Kivity
2011-04-27 9:06 ` Jan Kiszka
2011-04-27 9:14 ` Avi Kivity
2011-04-27 11:21 ` Jan Kiszka
2011-04-27 12:12 ` Avi Kivity
2011-04-27 13:31 ` Jan Kiszka
2011-04-27 13:39 ` Avi Kivity
2011-04-27 13:54 ` Jan Kiszka
2011-04-27 14:01 ` Avi Kivity
2011-04-27 14:11 ` Michael S. Tsirkin
2011-04-27 14:02 ` Michael S. Tsirkin
2011-04-27 14:10 ` Jan Kiszka
2011-04-27 14:14 ` Michael S. Tsirkin
2011-04-27 14:21 ` Jan Kiszka
2011-04-27 13:49 ` Michael S. Tsirkin
2011-04-27 9:34 ` Avi Kivity
2011-04-27 11:39 ` [PATCH v2 8/9] qemu-kvm: Refresh MSI settings after vmload Jan Kiszka
2011-04-27 12:19 ` Avi Kivity
2011-04-27 14:16 ` Michael S. Tsirkin
2011-04-27 14:28 ` Jan Kiszka
2011-04-27 14:30 ` Michael S. Tsirkin
2011-04-27 14:39 ` Jan Kiszka
2011-04-27 15:09 ` Michael S. Tsirkin
2011-04-27 15:21 ` Jan Kiszka
2011-04-27 16:02 ` Michael S. Tsirkin
2011-04-27 16:20 ` Jan Kiszka
2011-04-27 16:26 ` Michael S. Tsirkin [this message]
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=20110427162653.GA26993@redhat.com \
--to=mst@redhat.com \
--cc=avi@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@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