qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [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	[thread overview]
Message-ID: <20150616183840.2892d596@bahia.local> (raw)
In-Reply-To: <20150616162647.31380.65074.stgit@bahia.huguette.org>

On Tue, 16 Jun 2015 18:26:47 +0200
Greg Kurz <gkurz@linux.vnet.ibm.com> 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 <aik@ozlabs.ru>
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> ---
>  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	other threads:[~2015-06-16 16:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16 16:26 [Qemu-devel] [PATCH v2 0/2] spapr_iommu: TCE permission bits fixes Greg Kurz
2015-06-16 16:26 ` [Qemu-devel] [PATCH v2 1/2] spapr_iommu: drop erroneous check in h_put_tce_indirect() Greg Kurz
2015-06-16 16:38   ` Greg Kurz [this message]
2015-06-16 16:26 ` [Qemu-devel] [PATCH v2 2/2] spapr_iommu: translate sPAPRTCEAccess to IOMMUAccessFlags Greg Kurz
2015-06-18  6:23 ` [Qemu-devel] [PATCH v2 0/2] spapr_iommu: TCE permission bits fixes David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150616183840.2892d596@bahia.local \
    --to=gkurz@linux.vnet.ibm.com \
    --cc=aik@ozlabs.ru \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).