From: Paolo Bonzini <pbonzini@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>,
Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [RFC PATCH qemu 1/3] memory: Add get_fd() hook for IOMMU MR
Date: Wed, 29 Mar 2017 10:04:47 +0200 [thread overview]
Message-ID: <0c5842ea-3c9f-94ee-27db-e1ee6ae3a449@redhat.com> (raw)
In-Reply-To: <20170328210410.3d6cb5d8@t450s.home>
On 29/03/2017 05:04, Alex Williamson wrote:
>>> What if we used this as a prototype:
>>>
>>> int (*get_fd)(IOMMUFdType type, MemoryRegion *iommu);
>>>
>>> And then we defined:
>>>
>>> typedef enum {
>>> SPAPR_IOMMU_TABLE_FD = 0,
>>> } IOMMUFdType;
>>
>> Where do I put this enum definition? include/exec/memory.h? It does not
>> have any mention of any platform yet...
>
> I would assume memory.h, yes. It seems like the enum is just an
> abstraction, what does "get fd" mean generically to an IOMMU
> MemoryRegion? How can anyone else ever implement that callback if the
> initial user is assuming that the returned fd is a specific, yet
> unspecified type. If the API is "give me an fd for this type of thing"
> then the IOMMU driver can either provide it or indicate that type is not
> supported. There's really no platform knowledge at the memory API
> level, it's just a type of thing that means something to the driver
> providing the MemoryRegionIOMMUOps and the caller.
I think we should move to a QOM hierarchy like
AbstractMemoryRegion
MemoryRegion << adds MemoryRegionOps
IOMMUMemoryRegion << adds MemoryRegionIOMMUOps
sPAPR_IOMMUMemoryRegion << adds get_fd
but for now I'm okay with Alex's proposal.
Paolo
next prev parent reply other threads:[~2017-03-29 8:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-28 9:05 [Qemu-devel] [RFC PATCH qemu 0/3] vfio-pci, spapr: Allow in-kernel acceleration Alexey Kardashevskiy
2017-03-28 9:05 ` [Qemu-devel] [RFC PATCH qemu 1/3] memory: Add get_fd() hook for IOMMU MR Alexey Kardashevskiy
2017-03-28 17:48 ` Alex Williamson
2017-03-29 1:41 ` Alexey Kardashevskiy
2017-03-29 3:04 ` Alex Williamson
2017-03-29 8:04 ` Paolo Bonzini [this message]
2017-03-30 1:33 ` David Gibson
2017-03-29 3:35 ` David Gibson
2017-03-29 5:08 ` Alexey Kardashevskiy
2017-03-28 9:05 ` [Qemu-devel] [RFC PATCH qemu 2/3] vfio-pci: Reorder group-to-container attaching Alexey Kardashevskiy
2017-03-28 17:48 ` Alex Williamson
2017-03-29 3:42 ` David Gibson
2017-03-28 9:05 ` [Qemu-devel] [RFC PATCH qemu 3/3] vfio: Enable in-kernel acceleration via VFIO KVM device Alexey Kardashevskiy
2017-03-28 17:48 ` Alex Williamson
2017-03-29 4:27 ` Alexey Kardashevskiy
2017-03-29 3:53 ` David Gibson
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=0c5842ea-3c9f-94ee-27db-e1ee6ae3a449@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).