[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.10.0806260925220.14031@hp.linux-foundation.org>
Date: Thu, 26 Jun 2008 09:30:12 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Vitaly Mayatskikh <v.mayatskih@...il.com>
cc: Anton Arapov <aarapov@...hat.com>,
Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] Fix copy_user on x86_64
On Thu, 26 Jun 2008, Vitaly Mayatskikh wrote:
>
> Seems reasonable. However, we still need specialized memset() routine,
> because, again, destination can fail. Thanks for the review, Linus!
Actually, the "zero at the end" case is only for copy_from_user() (at
least it _should_ be), so for the clearing-at-end you should be able to
use a regular memset().
But it's not a big deal either way. As long as we only get into the fixup
routine at exception time, and handle all the common cases fast (ie do the
32-byte unrolled thing etc optimally), the fixup routine can do everything
a byte at a time with "get_user()" and "put_user()" etc. The "fault at
copy_*_user()" case really isn't all that performance-sensitive, because
it really happens essentially _never_.
(That's obviously why nobody even noticed how broken they were for
essentially what must have been _years_. It's not just not a performance
sensitive area, it's one that is entered so seldom that it's hard to ever
hit any correctness issues either)
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists