From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKeoV-0005DC-9L for qemu-devel@nongnu.org; Wed, 29 Jul 2015 23:47:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKeoS-0002uE-1c for qemu-devel@nongnu.org; Wed, 29 Jul 2015 23:47:23 -0400 Received: from mout.gmx.net ([212.227.17.22]:51656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKeoR-0002u8-Mn for qemu-devel@nongnu.org; Wed, 29 Jul 2015 23:47:19 -0400 References: <55B734A7.8040108@gmx.net> <55B8B122.7020406@gmx.net> <55B8DB46.6070307@gmx.net> From: Dennis Luehring Message-ID: <55B99E47.8070007@gmx.net> Date: Thu, 30 Jul 2015 05:47:19 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Debian 7.8.0 SPARC64 on qemu - anything i can do to speedup the emulation? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Karel Gardas Cc: qemu-devel@nongnu.org so your aarch64 is just less todo for qemu - not EVERY >= 16bit memory access needs swapping or needs check for unaligned access to emulate bus-erros Am 29.07.2015 um 16:41 schrieb Karel Gardas: > ubuntu@ubuntu:~$ ./a.out > endianess: little > try to access unaligned word > equal to 0x1234: YES > value: 0x1234 > done > > On Wed, Jul 29, 2015 at 3:55 PM, Dennis Luehring wrote: > > Am 29.07.2015 um 14:34 schrieb Karel Gardas: > >> > >> Once it boots, tell me how to find the asnwers to your > >> questions. > > > > > > compile with gcc test.cpp and run > > > > ----------- > > #include > > #include > > #include > > #include > > #include > > > > int main() > > { > > uint16_t value = 0x1234; > > > > { > > volatile uint8_t* ptr = (uint8_t*)&value; > > printf("endianess: %s\n", ptr[0]==0x34 ? "little":"big"); > > } > > > > uint8_t buffer[1+sizeof(value)]={0}; > > uint8_t* ptr = buffer; > > if(ptrdiff_t(ptr) % 2 == 0) > > { > > ++ptr; > > } > > uint16_t* unaligned_word = (uint16_t*)ptr; > > > > ::memcpy(unaligned_word, &value, sizeof(value)); > > > > printf("try to access unaligned word\n"); > > uint16_t read = *unaligned_word; // here can happen Bus-Errors, > > Exceptions, whatever your architecture likes > > printf(" equal to 0x%04X: %s\n", value, read == value ? "YES":"!!NO!!"); > > // sometimes you get the value - but its still wrong > > printf(" value: 0x%04X\n", read); > > printf("done\n"); > > > > return 0; > > } > > ----------- > >