diff options
Diffstat (limited to 'arch/s390/kernel/setup.c')
-rw-r--r-- | arch/s390/kernel/setup.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index ae1d5be7dd88..82bc113e8c1d 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/stddef.h> | 24 | #include <linux/stddef.h> |
25 | #include <linux/unistd.h> | 25 | #include <linux/unistd.h> |
26 | #include <linux/ptrace.h> | 26 | #include <linux/ptrace.h> |
27 | #include <linux/random.h> | ||
27 | #include <linux/user.h> | 28 | #include <linux/user.h> |
28 | #include <linux/tty.h> | 29 | #include <linux/tty.h> |
29 | #include <linux/ioport.h> | 30 | #include <linux/ioport.h> |
@@ -61,6 +62,7 @@ | |||
61 | #include <asm/diag.h> | 62 | #include <asm/diag.h> |
62 | #include <asm/os_info.h> | 63 | #include <asm/os_info.h> |
63 | #include <asm/sclp.h> | 64 | #include <asm/sclp.h> |
65 | #include <asm/sysinfo.h> | ||
64 | #include "entry.h" | 66 | #include "entry.h" |
65 | 67 | ||
66 | /* | 68 | /* |
@@ -766,6 +768,7 @@ static void __init setup_hwcaps(void) | |||
766 | #endif | 768 | #endif |
767 | 769 | ||
768 | get_cpu_id(&cpu_id); | 770 | get_cpu_id(&cpu_id); |
771 | add_device_randomness(&cpu_id, sizeof(cpu_id)); | ||
769 | switch (cpu_id.machine) { | 772 | switch (cpu_id.machine) { |
770 | case 0x9672: | 773 | case 0x9672: |
771 | #if !defined(CONFIG_64BIT) | 774 | #if !defined(CONFIG_64BIT) |
@@ -804,6 +807,19 @@ static void __init setup_hwcaps(void) | |||
804 | } | 807 | } |
805 | 808 | ||
806 | /* | 809 | /* |
810 | * Add system information as device randomness | ||
811 | */ | ||
812 | static void __init setup_randomness(void) | ||
813 | { | ||
814 | struct sysinfo_3_2_2 *vmms; | ||
815 | |||
816 | vmms = (struct sysinfo_3_2_2 *) alloc_page(GFP_KERNEL); | ||
817 | if (vmms && stsi(vmms, 3, 2, 2) == 0 && vmms->count) | ||
818 | add_device_randomness(&vmms, vmms->count); | ||
819 | free_page((unsigned long) vmms); | ||
820 | } | ||
821 | |||
822 | /* | ||
807 | * Setup function called from init/main.c just after the banner | 823 | * Setup function called from init/main.c just after the banner |
808 | * was printed. | 824 | * was printed. |
809 | */ | 825 | */ |
@@ -901,6 +917,9 @@ void __init setup_arch(char **cmdline_p) | |||
901 | 917 | ||
902 | /* Setup zfcpdump support */ | 918 | /* Setup zfcpdump support */ |
903 | setup_zfcpdump(); | 919 | setup_zfcpdump(); |
920 | |||
921 | /* Add system specific data to the random pool */ | ||
922 | setup_randomness(); | ||
904 | } | 923 | } |
905 | 924 | ||
906 | #ifdef CONFIG_32BIT | 925 | #ifdef CONFIG_32BIT |