From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhpRO-0006nb-KT for qemu-devel@nongnu.org; Fri, 15 Jul 2011 16:56:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QhpRJ-0007To-Uk for qemu-devel@nongnu.org; Fri, 15 Jul 2011 16:56:54 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53836 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhpRJ-0007TQ-H0 for qemu-devel@nongnu.org; Fri, 15 Jul 2011 16:56:49 -0400 Message-ID: <4E20A98D.2030709@suse.de> Date: Fri, 15 Jul 2011 22:56:45 +0200 From: Alexander Graf MIME-Version: 1.0 References: <8934321C-C651-415B-9F3A-0CB962C39C0B@suse.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Avoid CPU endian memory accesses in devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel On 07/15/2011 10:02 PM, Blue Swirl wrote: > On Fri, Jul 15, 2011 at 12:56 AM, Alexander Graf wrote: >> >> >> >> Am 14.07.2011 um 21:34 schrieb Blue Swirl: >> >>> Don't compile virtio.c in hwlib, it depends on memory accesses >>> performed in CPU endianness. >>> >>> Make loads and stores in CPU endianness unavailable to devices >>> and poison them to avoid further bugs. >> Very nice :). Couldn't test execute it, but: >> >> Acked-by: Alexander Graf > By the way, another way would be to change virtio to always use LE > accesses. This would need changes to KVM on PPC and s390x. Would that > be possible? The code is already in Linux for quite a while, other OSs started implementing it (Solaris) and the spec is pretty specific on fields being in target endianness. The virtio v2 spec will hopefully fix this, but that should end up in a different module then :) Alex