Received: from eggs.gnu.org ([2001:4830:134:3::10]:59499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4thz-0002W4-2W for qemu-devel@nongnu.org; Tue, 16 Jun 2015 12:27:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4ths-0005gx-T9 for qemu-devel@nongnu.org; Tue, 16 Jun 2015 12:27:30 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:54386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4ths-0005gW-JO for qemu-devel@nongnu.org; Tue, 16 Jun 2015 12:27:24 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 16 Jun 2015 17:27:23 +0100 From: Greg Kurz Date: Tue, 16 Jun 2015 18:26:47 +0200 Message-ID: <20150616162647.31380.65074.stgit@bahia.huguette.org> In-Reply-To: <20150616160925.31380.64020.stgit@bahia.huguette.org> References: <20150616160925.31380.64020.stgit@bahia.huguette.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v2 1/2] spapr_iommu: drop erroneous check in h_put_tce_indirect() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, qemu-devel@nongnu.org The tce_list variable is not a TCE but the address to a TCE: we shouldn't clear permission bits as we do now. And this is dead code anyway since we check tce_list is 4K aligned a few lines above. This patch doesn't fix any bug, it is only code cleanup. Suggested-by: Alexey Kardashevskiy Signed-off-by: Greg Kurz --- hw/ppc/spapr_iommu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index 8cd9dba9ac4d..ddd0ea5cd4dd 100644 --- a/hw/ppc/spapr_iommu.c +++ b/hw/ppc/spapr_iommu.c @@ -267,9 +267,7 @@ static target_ulong h_put_tce_indirect(PowerPCCPU *cpu, ioba &= page_mask; for (i = 0; i < npages; ++i, ioba += page_size) { - target_ulong off = (tce_list & ~SPAPR_TCE_RW) + - i * sizeof(target_ulong); - tce = ldq_be_phys(cs->as, off); + tce = ldq_be_phys(cs->as, tce_list + i * sizeof(target_ulong)); ret = put_tce_emu(tcet, ioba, tce); if (ret) {