From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Jeremy Kerr <jk@ozlabs.org>, linuxppc-dev@lists.ozlabs.org
Cc: Sombat Tragolgosol <sombat3960@gmail.com>, Jeremy Kerr <jk@ozlabs.org>
Subject: Re: [PATCH] powerpc/spufs: Fix hash faults for kernel regions
Date: Wed, 24 May 2017 14:28:49 +0530 [thread overview]
Message-ID: <8760gqr5py.fsf@skywalker.in.ibm.com> (raw)
In-Reply-To: <1495608599-16819-1-git-send-email-jk@ozlabs.org>
Jeremy Kerr <jk@ozlabs.org> writes:
> Change ac29c64089b7 swapped _PAGE_USER for _PAGE_PRIVILEGED, and
> introduced check_pte_access() which denied kernel access to
> non-_PAGE_PRIVILEGED pages.
>
> However, it didn't add _PAGE_PRIVILEGED to the hash fault handler for
> spufs' kernel accesses, so the DMAs required to establish SPE memory
> no longer work.
>
> This change adds _PAGE_PRIVILEGED to the hash fault handler for
> kernel accesses.
>
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
> Reported-by: Sombat Tragolgosol <sombat3960@gmail.com>
> CC: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
> arch/powerpc/platforms/cell/spu_base.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
> index 96c2b8a..0c45cdb 100644
> --- a/arch/powerpc/platforms/cell/spu_base.c
> +++ b/arch/powerpc/platforms/cell/spu_base.c
> @@ -197,7 +197,9 @@ static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
> (REGION_ID(ea) != USER_REGION_ID)) {
>
> spin_unlock(&spu->register_lock);
> - ret = hash_page(ea, _PAGE_PRESENT | _PAGE_READ, 0x300, dsisr);
> + ret = hash_page(ea,
> + _PAGE_PRESENT | _PAGE_READ | _PAGE_PRIVILEGED,
> + 0x300, dsisr);
> spin_lock(&spu->register_lock);
>
> if (!ret) {
> --
> 2.7.4
next prev parent reply other threads:[~2017-05-24 9:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-24 6:49 [PATCH] powerpc/spufs: Fix hash faults for kernel regions Jeremy Kerr
2017-05-24 8:58 ` Aneesh Kumar K.V [this message]
2017-05-25 13:22 ` Michael Ellerman
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=8760gqr5py.fsf@skywalker.in.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=jk@ozlabs.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=sombat3960@gmail.com \
/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).