From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, David Gibson <david@gibson.dropbear.id.au>,
Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH qemu 2/5] spapr-iommu: Subclass TYPE_IOMMU_MEMORY_REGION
Date: Fri, 31 Mar 2017 14:03:20 +0200 [thread overview]
Message-ID: <306e1353-2a82-79e3-7001-5933efbf01f3@redhat.com> (raw)
In-Reply-To: <a08e4150-6a3b-b6d3-efc6-16def8517b59@ozlabs.ru>
On 31/03/2017 13:47, Alexey Kardashevskiy wrote:
>>>
>>> +static void spapr_iommu_memory_region_class_init(ObjectClass *k, void *data)
>>> +{
>>> + sPAPRIOMMUMemoryRegionClass *smrc = SPAPR_IOMMU_MEMORY_REGION_CLASS(k);
>>> +
>>> + smrc->get_fd = spapr_tce_get_fd;
>>> +}
>>> +
>> You don't even need the virtual function. Rather, make spapr_tce_get_fd
>> public and give it a sPAPRTCETable argument. Then vfio_spapr_notify_kvm
>> can use SPAPR_IOMMU_MEMORY_REGION(iommumr).
> Well, if I make spapr_tce_get_fd() public, vfio_spapr_notify_kvm() could
> just take MemoryRegion and cast it to sPAPRTCETable without all these
> dances with MemoryRegion, IOMMUMemoryRegion, what do I miss here? I have
> made a big patch with IOMMUMemoryRegion though, post it?
*I* was missing that the call was inside an "if (container->iommu_type == TCE)".
So the hierarchy is good to have, but the virtual function can be removed.
Paolo
next prev parent reply other threads:[~2017-03-31 12:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-30 12:47 [Qemu-devel] [RFC PATCH qemu 0/5] vfio-pci, spapr: Allow in-kernel acceleration Alexey Kardashevskiy
2017-03-30 12:47 ` [Qemu-devel] [RFC PATCH qemu 1/5] memory/iommu: QOM'fy IOMMU MemoryRegion Alexey Kardashevskiy
2017-03-30 13:00 ` Paolo Bonzini
2017-03-30 12:47 ` [Qemu-devel] [RFC PATCH qemu 2/5] spapr-iommu: Subclass TYPE_IOMMU_MEMORY_REGION Alexey Kardashevskiy
2017-03-30 13:00 ` Paolo Bonzini
2017-03-31 11:47 ` Alexey Kardashevskiy
2017-03-31 12:03 ` Paolo Bonzini [this message]
2017-03-30 12:47 ` [Qemu-devel] [RFC PATCH qemu 3/5] vfio-pci: Reorder group-to-container attaching Alexey Kardashevskiy
2017-03-30 12:47 ` [Qemu-devel] [RFC PATCH qemu 4/5] vfio/spapr: Add a notifier for PPC64 HV/PR KVM about new group attached to LIOBN Alexey Kardashevskiy
2017-03-30 12:47 ` [Qemu-devel] [RFC PATCH qemu 5/5] spapr/iommu: Enable in-kernel TCE acceleration via VFIO KVM device 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=306e1353-2a82-79e3-7001-5933efbf01f3@redhat.com \
--to=pbonzini@redhat.com \
--cc=aik@ozlabs.ru \
--cc=alex.williamson@redhat.com \
--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).