linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Helge Deller <deller@gmx.de>
Cc: linux-parisc@vger.kernel.org,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	John David Anglin <dave.anglin@bell.net>
Subject: Re: [PATCH] parisc: Fix access fault handling in pa_memcpy()
Date: Mon, 27 Mar 2017 18:57:50 +0100	[thread overview]
Message-ID: <20170327175750.GE29622@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20170327154702.GA11377@p100.box>

On Mon, Mar 27, 2017 at 05:47:02PM +0200, Helge Deller wrote:
> pa_memcpy() is the major memcpy implementation in the parisc kernel which is
> used to do any kind of userspace/kernel memory copies.
> 
> Al Viro noticed various bugs in the implementation of pa_mempcy(), most notably
> that in case of faults it may report back to have copied more bytes than it
> actually did.
> 
> Fixing those bugs is quite hard in the C-implementation, because the compiler
> is messing around with the registers and we are not guaranteed that specific
> variables are always in the same processor registers. This makes proper fault
> handling complicated.
> 
> This patch implements pa_memcpy() in assembler. That way we have correct fault
> handling and adding a 64-bit copy routine was quite easy.

Hmm...  Is there any point trying to fall back from store fault to byte
copy?  Note that in copy_dstaligned() dst *is* aligned, so if the word
store fails, there's no realistic chance of having a byte store succeed.

  reply	other threads:[~2017-03-27 17:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27 15:47 [PATCH] parisc: Fix access fault handling in pa_memcpy() Helge Deller
2017-03-27 17:57 ` Al Viro [this message]
2017-03-27 20:23   ` Helge Deller
2017-03-28 14:19 ` [PATCH v2] " Helge Deller
2017-03-28 14:40   ` [PATCH v2] parisc: Fix access fault handling in pa_memcpy() - testcase Helge Deller

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=20170327175750.GE29622@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dave.anglin@bell.net \
    --cc=deller@gmx.de \
    --cc=linux-parisc@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 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).