All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Blue Swirl <blauwirbel@gmail.com>, Avi Kivity <avi@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] memory: simple memory tree printer
Date: Wed, 14 Sep 2011 08:10:58 -0700	[thread overview]
Message-ID: <4E70C402.3090907@twiddle.net> (raw)
In-Reply-To: <4E6DCE8D.9040602@siemens.com>

On 09/12/2011 02:19 AM, Jan Kiszka wrote:
> On 2011-09-12 11:11, Avi Kivity wrote:
>> On 09/12/2011 12:01 PM, Jan Kiszka wrote:
>>> On 2011-09-12 08:43, Richard Henderson wrote:
>>>>  On 09/11/2011 09:31 PM, Blue Swirl wrote:
>>>>>  Field 'offset' is always zero, maybe that is not interesting. Will it
>>>>>  become one day?
>>>>
>>>>  It's not always zero, but only used by certain devices.
>>>
>>> I do not see any users, neither upstream nor in Avi's tree.
>>
>> There aren't.
>>
>>> To my (semi-)understanding, offset should correlate to region_offset of
>>> cpu_register_physical_memory_offset: legacy device models require this
>>> to be 0 as they expect an absolute memory address passed to their
>>> handler, in contrast to a normal one that is relative to the regions
>>> base. But I do not see how the memory region offset actually helps here.
>>>
>>
>> mr->offset is added to the address in memory_region_{read,write}_thunk_n().
> 
> Ah, ok.
> 
> So the default address passed to the handler is now already relative? I
> think we should keep it like this for all converted devices, ie. take
> the chance, fix the remaining models, and drop the offset.

It's non-zero for the isa portio conversion that I did, which
I thought was in Avi's tree.

This is required by at least the VGA and GUS ISA devices which
do expect absolute i/o addresses, and check them.  The offset is
used to convert the relative i/o address back into an absolute
address.

It would also be used when we split an ISA portio region, as 
with the FDC device.  There, we have 7 ports in 2 chunks.  The
offset would still be needed to convert the relative offset of
the second chuck to be relative to the "real" un-split region.

Feel free to convert all of these devices to a more "native" use
of the memory api, but I warn you it won't be trivial.


r~

  reply	other threads:[~2011-09-14 15:11 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-11 20:31 [Qemu-devel] [PATCH] memory: simple memory tree printer Blue Swirl
2011-09-12  6:43 ` Richard Henderson
2011-09-12  9:01   ` Jan Kiszka
2011-09-12  9:11     ` Avi Kivity
2011-09-12  9:19       ` Jan Kiszka
2011-09-14 15:10         ` Richard Henderson [this message]
2011-09-14 15:23           ` Avi Kivity
2011-09-14 15:27             ` Richard Henderson
2011-09-14 15:29               ` Avi Kivity
2011-09-14 15:36                 ` Richard Henderson
2011-09-14 15:46                   ` Avi Kivity
2011-09-14 17:58           ` Jan Kiszka
2011-09-14 18:10             ` Jan Kiszka
2011-09-14 19:24               ` Avi Kivity
2011-09-15  9:30                 ` Jan Kiszka
2011-09-15  9:53                   ` Avi Kivity
2011-09-15 10:18                     ` Jan Kiszka
2011-09-15 11:21                       ` Avi Kivity
2011-09-14 18:26             ` Richard Henderson
2011-09-12  7:00 ` Peter Maydell
2011-09-12  8:46 ` Avi Kivity
2011-09-12  8:53   ` Jan Kiszka
2011-09-12  9:12     ` Avi Kivity
2011-09-12 10:37 ` Gerd Hoffmann
2011-09-12 10:53   ` Avi Kivity
2011-09-12 20:07     ` Blue Swirl

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=4E70C402.3090907@twiddle.net \
    --to=rth@twiddle.net \
    --cc=avi@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=jan.kiszka@siemens.com \
    --cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.