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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html