From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52997 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHMBk-0002oy-RL for qemu-devel@nongnu.org; Wed, 26 May 2010 15:22:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHMBj-0006E7-Mi for qemu-devel@nongnu.org; Wed, 26 May 2010 15:22:48 -0400 Received: from mail-px0-f173.google.com ([209.85.212.173]:35631) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHMBj-0006Dv-IP for qemu-devel@nongnu.org; Wed, 26 May 2010 15:22:47 -0400 Received: by pxi19 with SMTP id 19so2801418pxi.4 for ; Wed, 26 May 2010 12:22:46 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Blue Swirl Date: Wed, 26 May 2010 19:22:25 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH, RFC 3/4] Implement byte swapped MMIO type Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Kovalenko Cc: qemu-devel On Tue, May 25, 2010 at 7:45 PM, Igor Kovalenko wrote: > On Mon, May 24, 2010 at 12:34 AM, Blue Swirl wrote= : >> BROKEN >> >> Signed-off-by: Blue Swirl >> --- >> =C2=A0cpu-common.h =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A03 +- >> =C2=A0softmmu_template.h | =C2=A0 69 +++++++++++++++++++++++++++++++++++= +++++++++++------ >> =C2=A02 files changed, 63 insertions(+), 9 deletions(-) > > Changes to io_read and io_write seem to have issue with considering > wrong value bits, you should check physaddr instead since index is cut > off physaddr. Thanks, good catch! > It's probably a good idea to instead do a byteswap at __ld*/__st* > level (a bit higher level than in your change.) > These two sets are directly entered from runtime, and this way you > need only two templates changed. > Not sure if it is a good idea to handle unaligned accesses. That's the difficulty with the __ld/__st case. I think an unaligned word load on a byte swapped bus would consist of two loads, so there should be two swaps as well. Perhaps the unaligned access code should be changed to this way instead of current series of byte loads.