qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [Qemu-devel] [PATCH v2 1/2] spapr_iommu: drop erroneous c


From: Greg Kurz
Subject: Re: [Qemu-ppc] [Qemu-devel] [PATCH v2 1/2] spapr_iommu: drop erroneous check in h_put_tce_indirect()
Date: Tue, 16 Jun 2015 18:38:40 +0200

On Tue, 16 Jun 2015 18:26:47 +0200
Greg Kurz <address@hidden> wrote:
> 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 <address@hidden>
> Signed-off-by: Greg Kurz <address@hidden>
> ---
>  hw/ppc/spapr_iommu.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 

Of course, I did forget the changelog...

v2:
- suggested by aik
- keep sPAPRTCEAccess, a translation helper is introduced in the next
  patch

> 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) {
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]