qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@redhat.com>
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: Sun, 18 Sep 2011 18:29:26 +0200	[thread overview]
Message-ID: <4E761C66.9010208@web.de> (raw)
In-Reply-To: <4E7614CC.4000206@redhat.com>

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

On 2011-09-18 17:57, Avi Kivity wrote:
> On 09/18/2011 03:54 PM, Jan Kiszka wrote:
>> From: Jan Kiszka<jan.kiszka@siemens.com>
>>
>> We can express the offset of old portio completely via
>> MemoryRegionPortio::offset by splitting up regions of different offsets
>> and adjusting those offsets appropriately.
> 
> Please split into two patches - core and isa.

They depend on each other.

> 
>> +    /* Copy the sub-list and null-terminate it.  */
>> +    pio = g_new(MemoryRegionPortio, count + 1);
>> +    memcpy(pio, pio_init, sizeof(MemoryRegionPortio) * count);
>> +    memset(pio + count, 0, sizeof(MemoryRegionPortio));
> 
> Wish: g_copy(pio, pio_init, count);  // aka std::copy()
> 
>> @@ -396,12 +395,12 @@ static void memory_region_iorange_read(IORange
>> *iorange,
>>
>>           *data = ((uint64_t)1<<  (width * 8)) - 1;
>>           if (mrp) {
>> -            *data = mrp->read(mr->opaque, offset + mr->offset);
>> +            *data = mrp->read(mr->opaque, offset + mrp->offset);
>>           } else if (width == 2) {
>>               mrp = find_portio(mr, offset, 1, false);
>>               assert(mrp);
>> -            *data = mrp->read(mr->opaque, offset + mr->offset) |
>> -                    (mrp->read(mr->opaque, offset + mr->offset +
>> 1)<<  8);
>> +            *data = mrp->read(mr->opaque, offset + mrp->offset) |
>> +                    (mrp->read(mr->opaque, offset + mrp->offset +
>> 1)<<  8);
>>           }
>>           return;
>>       }
> 
> So long as mr->offset exists, you need to take it into account.

Only fair.

>  And I
> don't want to remove memory_region_set_offset() until everything (that
> can potentially use it, at least) has been converted.

IMO it's easier to fix those potential users before converting them. You
need to review them anyway to decide if an offset might be needed, and
which one precisely.

Are you aware of any candidates? For PIO, there should be none now.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2011-09-18 16:29 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 [this message]
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
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=4E761C66.9010208@web.de \
    --to=jan.kiszka@web.de \
    --cc=avi@redhat.com \
    --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).