qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Alexey Kardashevskiy" <aik@ozlabs.ru>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"Cornelia Huck" <cornelia.huck@de.ibm.com>,
	"Peter Xu" <peterx@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [Qemu-devel] [PATCH qemu v7] memory/iommu: QOM'fy IOMMU MemoryRegion
Date: Fri, 9 Jun 2017 00:51:17 +1000	[thread overview]
Message-ID: <20170608145117.GH25805@umbus.fritz.box> (raw)
In-Reply-To: <b9c81b9d-56ce-b8e6-bedc-5140caf14798@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1571 bytes --]

On Thu, Jun 08, 2017 at 03:59:27PM +0200, Paolo Bonzini wrote:
> 
> 
> On 08/06/2017 09:42, David Gibson wrote:
> > So.. this seems like an only halfway QOMification.  The main init
> > function still takes an ops structure, whereas the QOMish way to do
> > this would be to have the base IOMMUMemoryRegion be an abstract class,
> > and have the IOMMUOps pointers as part of the IOMMUMemoryRegionClass.
> > 
> > Maybe you can persuade me this is a useful interim step?
> 
> Well, it's definitely better than nothing, and MR already relies heavily
> on the ops pattern.

Hm, fair point.

> The only changes I'd make are:
> 
> 1) remove this unnecessary hunk
> 
> >      snprintf(tmp, sizeof(tmp), "tce-iommu-%x", tcet->liobn);
> > -    memory_region_init_iommu(&tcet->iommu, tcetobj, &spapr_iommu_ops, tmp, 0);
> > +    memory_region_init_iommu_type(TYPE_IOMMU_MEMORY_REGION,
> > +                                  &tcet->iommu, tcetobj, &spapr_iommu_ops,
> > +                                  tmp, 0);
> 
> thus delaying the introduction of memory_region_init_iommu_type to the
> next step.
> 
> 2) Leave is_iommu early in the "should fit in a cache line" part, for
> example after dirty_log_mask, and since we have room move "bool
> ram_device;" there too.

I really think the unsafe use of object_initialize() needs to be fixed
as well.

-- 
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 --]

  reply	other threads:[~2017-06-08 14:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07  8:32 [Qemu-devel] [PATCH qemu v7] memory/iommu: QOM'fy IOMMU MemoryRegion Alexey Kardashevskiy
2017-06-08  7:42 ` David Gibson
2017-06-08 13:59   ` Paolo Bonzini
2017-06-08 14:51     ` David Gibson [this message]
2017-06-08 14:28   ` Alexey Kardashevskiy
2017-06-08 14:40     ` Paolo Bonzini
2017-06-08 14:58     ` David Gibson
2017-06-08 15:30       ` Paolo Bonzini
2017-06-08 23:49         ` 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=20170608145117.GH25805@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=aik@ozlabs.ru \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --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).