From: Bob Picco <bpicco@meloft.net>
To: sparclinux@vger.kernel.org
Subject: Re: [PATCH] sparc64: mem mmap
Date: Wed, 10 Sep 2014 19:34:26 +0000 [thread overview]
Message-ID: <20140910193426.GH17331@zareason> (raw)
In-Reply-To: <1410104925-22342-1-git-send-email-bpicco@meloft.net>
David Miller wrote: [Wed Sep 10 2014, 02:50:34PM EDT]
> From: Bob Picco <bpicco@meloft.net>
> Date: Wed, 10 Sep 2014 10:30:10 -0400
>
> > In a common part for DTLB/ITLB "BAD RA" check TSTATE_PRIV. Should we not
> > be privileged raise a bus error with SIGBUS and BUS_ADRERR for the task.
>
> The kernel could be accessing userspace via copy_from_user() or one of
> the other asm/uaccess.h accessors.
True and thanx for catching my brain slippage!
>
> So you'll need the full context of the fault to make this decision, just
> like do_sparc64_fault() does.
Yes.
>
> Actually, kernel TLB misses go via separate path and validate the RA
> already before trying to load the entry into the TLB. So you will
> contextually know if we are dealing with a user mapping or not.
>
> You could add a new thread fault code (FAULT_CODE_BAD_RA) to set in
> this situation and then vector to do_sparc64_fault() when this
> happens.
>
> Probably do_sparc64_fault() should just immediately do a
> do_fault_siginfo(). Suggested logic is:
>
> if (!down_read_trylock(&mm->mmap_sem)) {
> ...
> down_read(&mm->mmap_sem);
> }
>
> if (fault_code & FAULT_CODE_BAD_RA)
> goto do_sigbus;
>
> vma = find_vma(mm, address);
>
> I would not try to do anything clever like seeing if this is a
> non-faulting load or anything like that.
Okay let me look at this.
thanx again,
bob
> --
> To unsubscribe from this list: send the line "unsubscribe sparclinux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2014-09-10 19:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-07 15:48 [PATCH] sparc64: mem mmap Bob Picco
2014-09-09 22:07 ` David Miller
2014-09-10 14:30 ` Bob Picco
2014-09-10 18:50 ` David Miller
2014-09-10 19:34 ` Bob Picco [this message]
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=20140910193426.GH17331@zareason \
--to=bpicco@meloft.net \
--cc=sparclinux@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.