Re: [git pull] "big box" x86 changes, boot protocol

From: H. Peter Anvin
Date: Sat Apr 26 2008 - 17:11:00 EST


Adrian Bunk 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.
...

We always use the gcc builtin for memcpy() here.


You have to do something pretty weird for memcpy() to not work for
dst <= src even with overlap; this usually involves architectures that have explicit cache control instructions to establish the dst in the cache, if used before src is read.

This is not an issue on x86, though.

-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/