x86/KASLR: use the right memcpy
PATCH 1/1 x86/KASLR: use the right memcpy
The decompressor has its own implementation of the string functions, but has to include the right header to get those, while implicitly including linux/string.h may result in a link error:
arch/x86/boot/compressed/kaslr.o: In function `choose_random_location':
kaslr.c:(.text+0xf51): undefined reference to `_mmx_memcpy'
This has appeared now as kaslr started using memcpy. Other files in the decompressor already do the same thing.
--- arch/x86/boot/compressed/kaslr.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/boot/compressed/kaslr.c +1 -0
@@ -30,6 +30,7 @@#include "misc.h" #include "error.h" +#include "../string.h" #include <generated/compile.h> #include <linux/module.h>
Signature · 1 line
2.9.0
Quoted 4 lines · Arnd Bergmann
The decompressor has its own implementation of the string functions, but has to include the right header to get those, while implicitly including
linux/string.hmay result in a link error:
Quoted 8 lines
arch/x86/boot/compressed/kaslr.o: In function `choose_random_location':
kaslr.c:(.text+0xf51): undefined reference to `_mmx_memcpy'This has appeared now as kaslr started using memcpy. Other files in the decompressor already do the same thing.
Fixes d52e7d5a952c ("x86/KASLR: Parse all 'memmap=' boot option entries")Signed-off-by Arnd Bergmann <[email protected]>
Thanks for this fix, Arnd!
The linking error didn't happen when I tested the patch of d52e7d5a952c. Could you tell in what condition it will be triggered? Not sure if I should wait for this fix being merged and do a back porting, or can defer it if it's not risky.
Thanks
Baoquan
Quoted 19 lines
--- arch/x86/boot/compressed/kaslr.c | 1 + 1 file changed, 1 insertion(+)arch/x86/boot/compressed/kaslr.c +1
-0@@ -30,6 +30,7 @@#include "misc.h" #include "error.h" +#include "../string.h" #include <generated/compile.h> #include <linux/module.h> Signature · 1 line
2.9.0
Quoted 14 lines · Baoquan He
Quoted 4 lines · Arnd Bergmann
The decompressor has its own implementation of the string functions, but has to include the right header to get those, while implicitly including
linux/string.hmay result in a link error:Quoted 8 lines
arch/x86/boot/compressed/kaslr.o: In function `choose_random_location':
kaslr.c:(.text+0xf51): undefined reference to `_mmx_memcpy'This has appeared now as kaslr started using memcpy. Other files in the decompressor already do the same thing.
Fixes d52e7d5a952c ("x86/KASLR: Parse all 'memmap=' boot option entries")Signed-off-by Arnd Bergmann <[email protected]>
Quoted 6 lines
Thanks for this fix, Arnd!
The linking error didn't happen when I tested the patch of
d52e7d5a952c. Could you tell in what condition it will be triggered? Not sure if I should wait for this fix being merged and do a back porting, or can defer it if it's not risky.
It only happens on 32-bit kernels with CONFIG_X86_USE_3DNOW, maybe there are additional requirements.
Arnd
Quoted 17 lines · Arnd Bergmann
Quoted 16 lines · Baoquan He
Quoted 4 lines · Arnd Bergmann
The decompressor has its own implementation of the string functions, but has to include the right header to get those, while implicitly including
linux/string.hmay result in a link error:Quoted 8 lines
arch/x86/boot/compressed/kaslr.o: In function `choose_random_location':
kaslr.c:(.text+0xf51): undefined reference to `_mmx_memcpy'This has appeared now as kaslr started using memcpy. Other files in the decompressor already do the same thing.
Fixes d52e7d5a952c ("x86/KASLR: Parse all 'memmap=' boot option entries")Signed-off-by Arnd Bergmann <[email protected]>Thanks for this fix, Arnd!
Quoted 7 lines
Quoted 4 lines
The linking error didn't happen when I tested the patch of
d52e7d5a952c. Could you tell in what condition it will be triggered? Not sure if I should wait for this fix being merged and do a back porting, or can defer it if it's not risky.It only happens on 32-bit kernels with
CONFIG_X86_USE_3DNOW, maybe there are additional requirements.
Checked code again, in commit d52e7d5a952c "#include "../boot.h" is removed. Not sure if that removal caused the 32-bit kernel link error. While I didn't see boot/string.h is included into the boot/boot.h.
tip-bot for Arnd Bergmann
merge bot[tip:x86/boot] x86/KASLR: Use the right memcpy() implementation
In reply to Arnd Bergmannx86/KASLR: Use the right memcpy() implementation
Commit-ID: 5b8b9cf76add98e19ff8ceb4247c2920687591a0 Gitweb: http://git.kernel.org/tip/5b8b9cf76add98e19ff8ceb4247c2920687591a0 Author: Arnd Bergmann <[email protected]> AuthorDate: Tue, 30 May 2017 11:14:17 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 31 May 2017 07:59:45 +0200
x86/KASLR: Use the right memcpy() implementation
The decompressor has its own implementation of the string functions, but has to include the right header to get those, while implicitly including linux/string.h may result in a link error:
arch/x86/boot/compressed/kaslr.o: In function `choose_random_location':
kaslr.c:(.text+0xf51): undefined reference to `_mmx_memcpy'
This has appeared now as KASLR started using memcpy(), via:
d52e7d5a952c ("x86/KASLR: Parse all 'memmap=' boot option entries")Other files in the decompressor already do the same thing.
--- arch/x86/boot/compressed/kaslr.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/boot/compressed/kaslr.c +1 -0
@@ -30,6 +30,7 @@#include "misc.h" #include "error.h" +#include "../string.h" #include <generated/compile.h> #include <linux/module.h>