[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4813BCC7.5040701@goop.org>
Date: Sat, 26 Apr 2008 16:37:43 -0700
From: Jeremy Fitzhardinge <jeremy@...p.org>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: Ingo Molnar <mingo@...e.hu>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>, Yinghai Lu <yinghai.lu@....com>,
Yinghai Lu <yhlu.kernel@...il.com>, jbarnes@...tuousgeek.org
Subject: Re: [git pull] "big box" x86 changes, boot protocol
Andrew Morton wrote:
>> + memcpy(&early_res[i], &early_res[i + 1],
>> + (j - 1 - i) * sizeof(struct early_res));
>>
>
> nit: memcpy() shouldn't be used for overlapping copies. It happens to be
> OK (for dst<src) in the kernel implementations. We hope.
>
Definitely shouldn't be assumed. At one point in the distant past I had
a ppc memcpy which would clobber a destination cacheline before reading
the source, so source and dest within a cacheline's distance would be
trouble, regardless of the direction. Arch-specific code which knows
about the arch-specific details of memcpy might be safer, I guess, but
its still fairly brittle.
J
--
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