qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: qemu-devel <qemu-devel@nongnu.org>, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH] isa: Avoid using obsolete memory_region_set_offset for old portio
Date: Mon, 19 Sep 2011 15:59:27 +0300	[thread overview]
Message-ID: <4E773CAF.9060202@redhat.com> (raw)
In-Reply-To: <4E773A2D.3010407@web.de>

On 09/19/2011 03:48 PM, Jan Kiszka wrote:
> >
> >  Ah:
> >
> >  -        /* If we see a hole, break the region.  */
> >  +        /* If we see a new offset, break the region. */
> >
> >
> >  But, sorry for being slow, I don't see why it requires a core update
> >  (other for adding mrp->offset).
>
> So far we matched accesses in find_portio by considering the portio
> offset as well. If we want to replace the region offset with the portio
> one (which confines legacy to a legacy-only place), we need to make the
> portio offset a pure correction value on handler invocation and exclude
> it from any range matching. And that means an old_portio memory region
> can only describe one range starting exactly at MemoryRegion::addr.

Thanks for the explanation.  But I think you're trying to remove 
->offset by moving it somewhere else.  That's not removal, that's 
renaming, and it reduces functionality for other old_portio users.

If users need absolute addresses, then we should provide them via 
set_offset(), not pretend the need doesn't exist.

(btw, another way to emulate set_offset() is via aliases, as detailed in 
the other thread).

>
> >
> >>
> >>  >   They all use the same handler, so you need to split e.g.
> >>  >   sh7750_io_memory into six MemoryRegionsOps. Or use tricks with
> >>  aliases -
> >>  >   have one giant 4G region with one handler, and map six 4k aliases into
> >>  >   the system address space.
> >>
> >>  Looks more like 3 regions with one alias each. But we likely need to
> >>  disentangle all that logic first. I would be surprised if there wasn't a
> >>  more readable way to express it via the memory API.
> >>
> >
> >  Depends if you subscribe to the "blindly make it work exactly the same
> >  way" or "understand the details and rewrite it cleanly" brands of
> >  masochism.
>
> We generally used to convert from APIv<n-1>  to APIv<n>  by adding legacy
> wrappers, rarely removing any of them. This doesn't scale, but - granted
> - it requires some masochism to make progress.
>

Wrappers reduce the risk of regression from a bad conversion by a tired 
coder.  But yes, they increase the amount of cruft immensely.

-- 
error compiling committee.c: too many arguments to function

  reply	other threads:[~2011-09-19 12:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-18 12:54 [Qemu-devel] [PATCH] isa: Avoid using obsolete memory_region_set_offset for old portio Jan Kiszka
2011-09-18 13:09 ` [Qemu-devel] [PATCH] memory: Eliminate region offset Jan Kiszka
2011-09-18 15:57 ` [Qemu-devel] [PATCH] isa: Avoid using obsolete memory_region_set_offset for old portio Avi Kivity
2011-09-18 16:29   ` Jan Kiszka
2011-09-18 16:46     ` Avi Kivity
2011-09-18 19:04       ` Jan Kiszka
2011-09-19 12:14         ` Avi Kivity
2011-09-19 12:29           ` Jan Kiszka
2011-09-19 12:37             ` Avi Kivity
2011-09-19 12:48               ` Jan Kiszka
2011-09-19 12:59                 ` Avi Kivity [this message]
2011-09-18 16:49 ` Richard Henderson
2011-09-18 19:16   ` Jan Kiszka
2011-09-19 12:15     ` Avi Kivity

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=4E773CAF.9060202@redhat.com \
    --to=avi@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).