Messages in this thread | | | Date | Thu, 26 Jun 2008 09:30:12 -0700 (PDT) | From | Linus Torvalds <> | 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
| |