linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Ian Munsie <imunsie@au1.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: "andrew.donnellan" <andrew.donnellan@au1.ibm.com>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: cxl: fix setting of _PAGE_USER bit when handling page faults
Date: Fri, 25 Mar 2016 12:15:49 -0500	[thread overview]
Message-ID: <1458925788-sup-2032@x230.ozlabs.ibm.com> (raw)
In-Reply-To: <3qWf364wYxz9sDG@ozlabs.org>

Excerpts from Michael Ellerman's message of 2016-03-25 05:01:38 -0500:
> I think you can (should) use is_kernel_addr() for the DAR check.
> 
> I'm also slightly worried by that logic in the case of a non-kernel context.
> 
> ie. if ctx->kernel is false, we get:
> 
>     if (true || !is_kernel_addr(dar))
>          access |= _PAGE_USER;
> 
> Which means we just add _PAGE_USER for any address. What am I missing here?

It's been ages since I did a deep dive on the related mm code, so I
don't recall the precise details so take this with a grain of salt, but
if memory serves the call to copro_handle_mm_fault will fail if a user
is trying to access a kernel region since it won't be mapped in the mm.

-Ian

  reply	other threads:[~2016-03-25 17:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18  4:01 [PATCH] cxl: fix setting of _PAGE_USER bit when handling page faults Andrew Donnellan
2016-03-18  6:30 ` Ian Munsie
2016-03-21  4:38   ` Andrew Donnellan
2016-03-25 10:01 ` Michael Ellerman
2016-03-25 17:15   ` Ian Munsie [this message]
2016-03-28 13:42   ` Aneesh Kumar K.V
2016-03-28 18:00     ` Aneesh Kumar K.V
2016-04-11  4:10     ` Andrew Donnellan
2016-04-11  4:27       ` Michael Ellerman
2016-04-11  4:31         ` Aneesh Kumar K.V
2016-04-11 11:14           ` Michael Ellerman
2016-04-11 13:42             ` Aneesh Kumar K.V
2016-04-12 11:42               ` Michael Ellerman
2016-03-29 22:08 ` [PATCH] " Matthew R. Ochs

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=1458925788-sup-2032@x230.ozlabs.ibm.com \
    --to=imunsie@au1.ibm.com \
    --cc=andrew.donnellan@au1.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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).