History

powerpc/book3e: get rid of #include <generated/compile.h>

You cannot include <generated/compile.h> here because it is generated in init/Makefile but there is no guarantee that it happens before arch/powerpc/mm/nohash/kaslr_booke.c is compiled for parallel builds. The places where you can reliably include <generated/compile.h> are: - init/ (because init/Makefile can specify the dependency) - arch/*/boot/ (because it is compiled after vmlinux) Commit f231e4333312 ("hexagon: get rid of #include <generated/compile.h>") fixed the last breakage at that time, but powerpc re-added this. <generated/compile.h> was unneeded because 'build_str' is almost the same as 'linux_banner' defined in init/version.c Let's copy the solution from MIPS. (get_random_boot() in arch/mips/kernel/relocate.c)

Masahiro Yamada committed 4 years ago

Commit 7ad4bd81 parent 3e8635f1 file · +2 −6Browse files

Unified · Split

arch/powerpc/mm/nohash/kaslr_booke.c+2−6
@@ -19,7 +19,6 @@ · 18 unmodified lines
19#include <asm/cacheflush.h>19#include <asm/cacheflush.h>
20#include <asm/kdump.h>20#include <asm/kdump.h>
21#include <mm/mmu_decl.h>21#include <mm/mmu_decl.h>
22#include <generated/compile.h>
23#include <generated/utsrelease.h>22#include <generated/utsrelease.h>
24 23
25struct regions {24struct regions {
@@ -37,10 +36,6 @@ struct regions { · 11 unmodified lines
37 int reserved_mem_size_cells;36 int reserved_mem_size_cells;
38};37};
39 38
40/* Simplified build-specific string for starting entropy. */
41static const char build_str[] = UTS_RELEASE " (" LINUX_COMPILE_BY "@"
42 LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION;
43
44struct regions __initdata regions;39struct regions __initdata regions;
45 40
46static __init void kaslr_get_cmdline(void *fdt)41static __init void kaslr_get_cmdline(void *fdt)
@@ -71,7 +66,8 @@ static unsigned long __init get_boot_seed(void *fdt) · 24 unmodified lines
71{66{
72 unsigned long hash = 0;67 unsigned long hash = 0;
73 68
74 hash = rotate_xor(hash, build_str, sizeof(build_str));69 /* build-specific string for starting entropy. */
70 hash = rotate_xor(hash, linux_banner, strlen(linux_banner));
75 hash = rotate_xor(hash, fdt, fdt_totalsize(fdt));71 hash = rotate_xor(hash, fdt, fdt_totalsize(fdt));
76 72
77 return hash;73 return hash;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t