From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qe6Ad-0003wO-Oe for qemu-devel@nongnu.org; Tue, 05 Jul 2011 10:00:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qe6AV-0002U3-NB for qemu-devel@nongnu.org; Tue, 05 Jul 2011 10:00:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qe6AV-0002T0-1j for qemu-devel@nongnu.org; Tue, 05 Jul 2011 10:00:03 -0400 Message-ID: <4E1318DD.10703@redhat.com> Date: Tue, 05 Jul 2011 15:59:57 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1309863815-28236-1-git-send-email-hare@suse.de> <1309863815-28236-2-git-send-email-hare@suse.de> <1309863815-28236-3-git-send-email-hare@suse.de> <1309863815-28236-4-git-send-email-hare@suse.de> <1309863815-28236-5-git-send-email-hare@suse.de> <1309863815-28236-6-git-send-email-hare@suse.de> <4E1313E2.30400@suse.de> In-Reply-To: <4E1313E2.30400@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/5] megasas: LSI Megaraid SAS emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: kvm@vger.kernel.org, Hannes Reinecke , Stefan Haynoczi , qemu-devel@nongnu.org On 07/05/2011 03:38 PM, Alexander Graf wrote: >> >> + if (is_sgl64) { >> + iov_pa = ldq_phys(pa); >> + } else { >> + iov_pa = ldl_phys(pa); > > These load data from memory in target endianness. Are you sure that's > what you want? I'd expect this to be defined as little endian > (especially given that ldq and ldl on the same address work). Seems to be target endianness from the corresponding Linux code: if (sge_count) { scsi_for_each_sg(scp, os_sgl, sge_count, i) { mfi_sgl->sge32[i].length = sg_dma_len(os_sgl); mfi_sgl->sge32[i].phys_addr = sg_dma_address(os_sgl); } } ... if (sge_count) { scsi_for_each_sg(scp, os_sgl, sge_count, i) { mfi_sgl->sge64[i].length = sg_dma_len(os_sgl); mfi_sgl->sge64[i].phys_addr = sg_dma_address(os_sgl); } } Note that this is _either_ a ldq or a ldl depending on what the driver told the device. It is not accessing a 64-bit value as 32-bit. Paolo