From: Mitsyanko Igor <i.mitsyanko@samsung.com>
To: andrzej zaborowski <balrogg@gmail.com>
Cc: peter.maydell@linaro.org, e.voevodin@samsung.com,
quintela@redhat.com, qemu-devel@nongnu.org,
kyungmin.park@samsung.com, d.solodkiy@samsung.com,
m.kozlov@samsung.com, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH 3/5] hw/pxa2xx_lcd.c: drop VMSTATE_UINTTL usage
Date: Wed, 22 Feb 2012 17:30:00 +0400 [thread overview]
Message-ID: <4F44EDD8.4080901@samsung.com> (raw)
In-Reply-To: <CAOq732KWdqytEo9tBK3GmKtmY0RqpAk3JjiKiMN8kZ64Co49jw@mail.gmail.com>
On 02/22/2012 04:48 PM, andrzej zaborowski wrote:
> On 22 February 2012 13:26, Mitsyanko Igor<i.mitsyanko@samsung.com> wrote:
>> On 02/22/2012 03:36 PM, andrzej zaborowski wrote:
>>> Why's uint32_t more correct though? The purpose of using a named type
>>> across qemu is to mark fields as memory addresses (similar to size_t
>>> being used for sizes, etc.), uint32_t conveys less information -- only
>>> the size.
>>
>> It's obviously more informative, but I thought it's main purpose is to be
>> used with code that could be executed for a different targets (with
>> different address bus width).
>
> In some case for sure, but I believe not in most cases.
>
>>
>>
>>
>>> It's a safe hack, but I don't see the rationale.
>>
>>
>> I don't consider this a hack, we are trying to emulate real hardware, and
>> pxa lcd and dma controllers are intended to work with 32-bit bus. We should
>> not have a possibility to use them with 64-bit targets.
>>
>>
>>> If it's because VMSTATE_UINT32 requires that specific type than a less
>>> ugly hack would be to make a pxa specific memory address type.
>>>
>>
>> Introducing new type doesn't look pretty to me,
>
> Why?
Peter already answered, this fields should be exactly 32-bit wide
(hardware is implemented this way) and we already have a type that is
exactly 32-bit wide. Implementing each device without any assumptions
about other parts of emulated system seems like a right approach to me.
Doing something like typedef uint32_t pxalcd_phys_addr_t is fun, but
then we could end up introducing typedefs like this for every device in hw/.
Also, currently we can't save custom types in VMSTATE.
>> maybe just rename variables
>> to source_addr, dest_addr e.t.c?
>
> Wouldn't it be analogous to changing pointer typed variables to void *
> and adding the actual type in their names? The result is that at
> language level they'll all be the same type even though they are not.
>
> (or changing le32 and be32 to uint32 in Linux)
>
Yes, but you got to admit they would be more informative for human :)
--
Mitsyanko Igor
ASWG, Moscow R&D center, Samsung Electronics
email: i.mitsyanko@samsung.com
next prev parent reply other threads:[~2012-02-22 13:30 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-22 10:15 [Qemu-devel] [PATCH 0/5] VMState cleanups Igor Mitsyanko
2012-02-22 10:15 ` [Qemu-devel] [PATCH 1/5] target-alpha/machine.c: use VMSTATE_UINT64* instead of VMSTATE_UINTTL* Igor Mitsyanko
2012-02-22 11:19 ` Peter Maydell
2012-02-22 13:49 ` Juan Quintela
2012-02-22 10:15 ` [Qemu-devel] [PATCH 2/5] hw/pxa2xx_dma.c: drop VMSTATE_UINTTL usage Igor Mitsyanko
2012-02-22 11:06 ` Peter Maydell
2012-02-22 13:47 ` Juan Quintela
2012-02-22 13:52 ` Peter Maydell
2012-02-22 14:05 ` Juan Quintela
2012-02-22 10:15 ` [Qemu-devel] [PATCH 3/5] hw/pxa2xx_lcd.c: " Igor Mitsyanko
2012-02-22 11:07 ` Peter Maydell
2012-02-22 11:36 ` andrzej zaborowski
2012-02-22 12:00 ` Peter Maydell
2012-02-22 12:13 ` andrzej zaborowski
2012-02-22 12:48 ` Peter Maydell
2012-02-22 12:56 ` andrzej zaborowski
2012-02-22 13:32 ` Mitsyanko Igor
2012-02-22 13:56 ` Juan Quintela
2012-02-22 12:26 ` Mitsyanko Igor
2012-02-22 12:48 ` andrzej zaborowski
2012-02-22 13:30 ` Mitsyanko Igor [this message]
2012-02-22 10:15 ` [Qemu-devel] [PATCH 4/5] vmstate: refactor and move VMSTATE_UINTTL* macro Igor Mitsyanko
2012-02-22 14:00 ` Juan Quintela
2012-02-22 10:15 ` [Qemu-devel] [PATCH 5/5] vmstate: introduce get_bufsize entry in VMStateField Igor Mitsyanko
2012-02-22 11:26 ` [Qemu-devel] [PATCH 0/5] VMState cleanups Peter Maydell
2012-02-22 12:01 ` Mitsyanko Igor
2012-02-22 12:49 ` Andreas Färber
2012-02-22 12:50 ` Peter Maydell
2012-02-22 14:02 ` Juan Quintela
2012-02-22 15:37 ` Andreas Färber
2012-02-22 15:42 ` Peter Maydell
2012-02-22 16:04 ` Andreas Färber
2012-02-22 16:09 ` Peter Maydell
2012-02-22 23:41 ` Alexander Graf
2012-02-23 13:52 ` Juan Quintela
2012-02-22 12:06 ` Peter Maydell
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=4F44EDD8.4080901@samsung.com \
--to=i.mitsyanko@samsung.com \
--cc=afaerber@suse.de \
--cc=balrogg@gmail.com \
--cc=d.solodkiy@samsung.com \
--cc=e.voevodin@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=m.kozlov@samsung.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/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).