[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/10] spapr_iommu: Make H_PUT_TCE_INDIRECT endian-s
From: |
Alexey Kardashevskiy |
Subject: |
[Qemu-devel] [PATCH 02/10] spapr_iommu: Make H_PUT_TCE_INDIRECT endian-safe |
Date: |
Mon, 23 Feb 2015 19:33:52 +1100 |
PAPR is defined as big endian so TCEs need an adjustment so
does this patch.
This changes code to have ldq_be_phys() in one place.
Signed-off-by: Alexey Kardashevskiy <address@hidden>
Reviewed-by: David Gibson <address@hidden>
---
hw/ppc/spapr_iommu.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
index 4de6ba1..4b857e8 100644
--- a/hw/ppc/spapr_iommu.c
+++ b/hw/ppc/spapr_iommu.c
@@ -246,7 +246,7 @@ static target_ulong h_put_tce_indirect(PowerPCCPU *cpu,
target_ulong ioba1 = ioba;
target_ulong tce_list = args[2];
target_ulong npages = args[3];
- target_ulong ret = H_PARAMETER;
+ target_ulong ret = H_PARAMETER, tce = 0;
sPAPRTCETable *tcet = spapr_tce_find_by_liobn(liobn);
CPUState *cs = CPU(cpu);
hwaddr page_mask, page_size;
@@ -266,7 +266,7 @@ static target_ulong h_put_tce_indirect(PowerPCCPU *cpu,
for (i = 0; i < npages; ++i, ioba += page_size) {
target_ulong off = (tce_list & ~SPAPR_TCE_RW) +
i * sizeof(target_ulong);
- target_ulong tce = ldq_phys(cs->as, off);
+ tce = ldq_be_phys(cs->as, off);
ret = put_tce_emu(tcet, ioba, tce);
if (ret) {
@@ -277,8 +277,7 @@ static target_ulong h_put_tce_indirect(PowerPCCPU *cpu,
/* Trace last successful or the first problematic entry */
i = i ? (i - 1) : 0;
trace_spapr_iommu_indirect(liobn, ioba1, tce_list, i,
- ldq_phys(cs->as,
- tce_list + i * sizeof(target_ulong)),
+ tce,
ret);
return ret;
--
2.0.0
- [Qemu-devel] [PATCH 00/10] spapr: Small patches to prepare for Dynamic DMA windows, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 02/10] spapr_iommu: Make H_PUT_TCE_INDIRECT endian-safe,
Alexey Kardashevskiy <=
- [Qemu-devel] [PATCH 04/10] spapr_vio: Introduce a liobn number generating macros, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 01/10] spapr_iommu: Disable in-kernel IOMMU tables for >4GB windows, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 03/10] spapr_pci: Introduce a liobn number generating macros, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 08/10] spapr_iommu: Make spapr_tce_find_by_liobn() public, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 07/10] spapr_pci: Make find_phb()/find_dev() public, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 06/10] spapr_iommu: Add separate trace points for PCI DMA operations, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 09/10] spapr_pci: Rework device-tree rendering, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 05/10] spapr_pci: Define default DMA window size as a macro, Alexey Kardashevskiy, 2015/02/23