From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXqPC-0001bR-Ks for qemu-devel@nongnu.org; Thu, 02 May 2013 06:06:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXqP6-0008SX-GP for qemu-devel@nongnu.org; Thu, 02 May 2013 06:06:26 -0400 Received: from mail-bk0-x233.google.com ([2a00:1450:4008:c01::233]:40565) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXqP6-0008Rl-8V for qemu-devel@nongnu.org; Thu, 02 May 2013 06:06:20 -0400 Received: by mail-bk0-f51.google.com with SMTP id ji2so180623bkc.38 for ; Thu, 02 May 2013 03:06:19 -0700 (PDT) Sender: Richard Henderson Message-ID: <51823A97.5090505@twiddle.net> Date: Thu, 02 May 2013 11:06:15 +0100 From: Richard Henderson MIME-Version: 1.0 References: <51822DFF.4070300@tilera.com> In-Reply-To: <51822DFF.4070300@tilera.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] qemu/virtio issue due to non-atomic data access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Guo Cc: qemu-devel@nongnu.org On 2013-05-02 10:12, Paul Guo wrote: > A proper fix for this issue seems to be: Judge whether the address is aligned, do direct loading for the aligned case in ldq_le_p(), etc? No, I would think the proper fix would be to change the bits of virtio that are known to access aligned memory to not use the pointer wrapper functions, but to use a normal C memory access followed by leN_to_cpu et al. r~