Messages in this thread | | | Date | Sat, 26 Apr 2008 16:37:43 -0700 | From | Jeremy Fitzhardinge <> | 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
| |