From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Greg Kurz <gkurz@linux.vnet.ibm.com>,
David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] spapr_iommu: fix erroneous sanity check in h_put_tce_indirect()
Date: Tue, 16 Jun 2015 18:53:51 +1000 [thread overview]
Message-ID: <557FE41F.9020204@ozlabs.ru> (raw)
In-Reply-To: <20150615172804.22475.7018.stgit@bahia.huguette.org>
On 06/16/2015 03:28 AM, Greg Kurz wrote:
> According to PAPR+ 3.2.2.2, the TCE is implemented as follows:
> bits 0-51: real page number
> bits 52-61: reserved for future use
> bits 62-63: page protection (read-only, write-only, read-write)
tce_list is not a TCE, it is "The logical address of a page of (4 K long on
a 4 K boundary) of TCE contents to be stored in the TCE table (contains
logical address of storage page to be mapped)" so we rather want to remove
(tce_list & ~SPAPR_TCE_RW) below.
> Possible values for the protection bits are necessarly non-zero and thus
> H_PUT_TCE_INDIRECT currently always fails and returns H_PARAMETER.
>
> The code explicitly clears the protection bits when computing the TCE offset,
> a few lines below (tce_list & ~SPAPR_TCE_RW)... The sanity check is obviously
> wrong for these bits.
>
> Moreover, I could find no indication in PAPR+ that using the other reserved
> bits should error out with H_PARAMETER.
>
> This patch simply drops the offending check.
>
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> ---
> hw/ppc/spapr_iommu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
> index 8cd9dba9ac4d..37a1110c9d87 100644
> --- a/hw/ppc/spapr_iommu.c
> +++ b/hw/ppc/spapr_iommu.c
> @@ -258,7 +258,7 @@ static target_ulong h_put_tce_indirect(PowerPCCPU *cpu,
> return H_PARAMETER;
> }
>
> - if ((npages > 512) || (tce_list & SPAPR_TCE_PAGE_MASK)) {
> + if (npages > 512) {
> return H_PARAMETER;
> }
>
>
>
--
Alexey
next prev parent reply other threads:[~2015-06-16 8:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-15 17:28 [Qemu-devel] [PATCH] spapr_iommu: fix erroneous sanity check in h_put_tce_indirect() Greg Kurz
2015-06-16 8:53 ` Alexey Kardashevskiy [this message]
2015-06-16 9:24 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2015-06-16 14:32 ` Alexey Kardashevskiy
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=557FE41F.9020204@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=david@gibson.dropbear.id.au \
--cc=gkurz@linux.vnet.ibm.com \
--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).