From: Robert Reif <reif@earthlink.net>
To: Paul Brook <paul@codesourcery.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] 64 bit I/O support v7
Date: Fri, 01 May 2009 09:46:30 -0400 [thread overview]
Message-ID: <49FAFD36.5040609@earthlink.net> (raw)
In-Reply-To: <200905011303.50885.paul@codesourcery.com>
Paul Brook wrote:
>> The old array function call is supported so no existing drivers need
>> to be modified. They can continue to do 2 32 bit accesses because 2
>> helper functions have been added to break up the accesses automatically.
>> However, the helper functions should only be used until all drivers are
>> converted to use the structure and then can be removed along
>> with the old array functions api. The replacement of the arrays with
>> structures in the drivers is very straightforward for drivers that don't
>> do 64 bit I/O and the few that do can be cleaned up to remove the
>> work arounds for the lack of true 64 bit I/O by their maintainers.
>>
>
> This is going to be a bit of a pain, and a lot of duplication. My expectation
> is that most devices don't know/care about 64-bit accesses and want them to
> be automatically split into a pair of 32-bit accesses. I suggest pushing this
> down into the lower level dispatch routines. By my reading your mem_writeq
> helpers are broken if we happen to have multiple regions with the same opaque
> value (this effects at least lsi53c895a.c).
>
> In the interests of avoiding duplication, I'd also implement
> cpu_register_io_memory in terms of cpu_register_io_memory64.
>
>
>> + return ((CPUReadMemoryFunc64*)(*mmio->mem_read[idx][3]))
>> (mmio->opaque[idx][0][3], addr + mmio->region_offset[idx][0][3]);
>>
>
> Eww. It would be a good idea to fix this at the same time.
>
> Paul
>
>
The right way to do this is to convert the whole tree at once
so we don't need the helper functions and two versions of
cpu_register_io_memory. Unfortunately people have written
hardware drivers that rely on the current weird behavior by
caching half of a 64 bit access so it can be accessed later. This doesn't
work if the registers can also be accessed as 32 bits because the
cache trick implies a specific order of access.
95% of the hardware drivers could be trivially converted and
work fine. It's those few that play games that need to be looked
at carefully and converted properly to do the right thing. I think
the authors or maintainers of those drivers have the best knowledge
to back out the current workarounds and do 64 bit I/O properly.
That's why I'm taking a 2 step approach using the helper functions
and 2 cpu_register_io_memory functions. Once the entire tree is
converted to use the structures, the helper functions and the second
cpu_register_io_memory function would be removed. I can provide
patches to convert sparc to the new API and also convert most of
the simple drivers. However it's the ones that have workarounds
for the current behavior that need careful scrutiny.
The ideal time for applying this patch would be at the start of a
new development cycle. 95% of the drivers could be converted
immediately and the problem ones could be identified and fixed
afterwards. The issues with the helper functions doing a linear
scan and not supporting overlapping regions for 64 bit accesses
would only be a problem for a short period of time (maybe a week)
and only for some of the drivers that have 64 bit access issues.
next prev parent reply other threads:[~2009-05-01 13:50 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-21 11:42 [Qemu-devel] [PATCH] 64 bit I/O support v7 Robert Reif
2009-05-01 12:03 ` Paul Brook
2009-05-01 13:46 ` Robert Reif [this message]
2009-05-01 14:14 ` Paul Brook
2009-05-01 14:39 ` Robert Reif
2009-05-01 14:52 ` Paul Brook
2009-05-01 15:19 ` Robert Reif
2009-05-01 15:33 ` Paul Brook
2009-05-01 15:51 ` Blue Swirl
2009-05-01 16:36 ` Edgar E. Iglesias
2009-05-01 17:29 ` Robert Reif
2009-05-02 0:02 ` Robert Reif
2009-05-02 0:40 ` Paul Brook
2009-05-01 23:42 ` Robert Reif
2009-05-01 23:57 ` Paul Brook
2009-05-02 15:23 ` Blue Swirl
2009-05-02 19:35 ` Paul Brook
2009-05-05 1:59 ` Jamie Lokier
2009-05-05 6:05 ` Edgar E. Iglesias
2009-05-01 14:25 ` Robert Reif
2009-05-01 14:39 ` Paul Brook
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=49FAFD36.5040609@earthlink.net \
--to=reif@earthlink.net \
--cc=paul@codesourcery.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 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).