]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/x86/kernel/alternative.c
Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / arch / x86 / kernel / alternative.c
index c0501ea6b634cd4b998ef7002b6ff8b93fc14d05..a81f2d52f869d842d9301d5f9aea5c23a74369a2 100644 (file)
@@ -266,6 +266,15 @@ void __init_or_module apply_alternatives(struct alt_instr *start,
        u8 insnbuf[MAX_PATCH_LEN];
 
        DPRINTK("%s: alt table %p -> %p\n", __func__, start, end);
+       /*
+        * The scan order should be from start to end. A later scanned
+        * alternative code can overwrite a previous scanned alternative code.
+        * Some kernel functions (e.g. memcpy, memset, etc) use this order to
+        * patch code.
+        *
+        * So be careful if you want to change the scan order to any other
+        * order.
+        */
        for (a = start; a < end; a++) {
                u8 *instr = a->instr;
                BUG_ON(a->replacementlen > a->instrlen);