All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [patch 2.6.11] __copy_user breaks on unaligned src
Date: Fri, 18 Mar 2005 07:17:29 +0000	[thread overview]
Message-ID: <16954.32905.838756.136817@napali.hpl.hp.com> (raw)
In-Reply-To: <12404.1111129477@kao2.melbourne.sgi.com>

>>>>> On Fri, 18 Mar 2005 18:04:37 +1100, Keith Owens <kaos@sgi.com> said:

  Keith> memcpy_mck.S::__copy_user breaks in the prefetch code under these
  Keith> conditions :-

  Keith> * src is unaligned and
  Keith> * dst is near the end of a page and
  Keith> * the page after dst is unmapped.

  Keith> The loop count in r21 is 1 value too high.  A length of 0x100 gives
  Keith> ar.lc = r21 = 2.  .unaligned_src incorrectly copies r21 into ar.lc,
  Keith> when it should copy cnt, so the lfetch lines are executed 3 times, not
  Keith> 2.  That takes dst_pre_mem past the end of the page and into an
  Keith> unallocated area, oops.

That's a good thing to fix (it's definitely a performance bug).  However,
lfetch.fault should be safe to use even on unmapped memory.  See this
code in ia64_do_page_fault():

 /*
  * This fault was due to a speculative load or lfetch.fault, set the "ed"
  * bit in the psr to ensure forward progress.  (Target register will get a
  * NaT for ld.s, lfetch will be canceled.)
  */

I don't see off-hand why this wouldn't work as intended.

	--david

  reply	other threads:[~2005-03-18  7:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-18  7:04 [patch 2.6.11] __copy_user breaks on unaligned src Keith Owens
2005-03-18  7:17 ` David Mosberger [this message]
2005-03-18 17:40 ` Luck, Tony
2005-03-18 19:19 ` David Mosberger
2005-03-19  0:58 ` Luck, Tony
2005-03-22  3:04 ` Keith Owens
2005-03-25  1:17 ` David Mosberger
2005-03-25  7:59 ` David Mosberger
2005-03-25 20:27 ` David Mosberger

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=16954.32905.838756.136817@napali.hpl.hp.com \
    --to=davidm@napali.hpl.hp.com \
    --cc=linux-ia64@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.