summaryrefslogtreecommitdiff
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2017-02-04 11:40:36 +0100
committerSasha Levin <alexander.levin@microsoft.com>2018-01-17 12:26:14 -0500
commit5a5c7a67ca04f669586444685d3b4e43b9ad865d (patch)
treea735423246515d9249c5a4f5e5172f9bf02999c2 /arch/s390
parenta12924ee8b30ffdd6de324d425ac80fff328c4da (diff)
s390: make setup_randomness work
[ Upstream commit da8fd820f389a0e29080b14c61bf5cf1d8ef5ca1 ] Commit bcfcbb6bae64 ("s390: add system information as device randomness") intended to add some virtual machine specific information to the randomness pool. Unfortunately it uses the page allocator before it is ready to use. In result the page allocator always returns NULL and the setup_randomness function never adds anything to the randomness pool. To fix this use memblock_alloc and memblock_free instead. Fixes: bcfcbb6bae64 ("s390: add system information as device randomness") Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/setup.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 1942f22e6694..86c33bb15867 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -801,10 +801,10 @@ static void __init setup_randomness(void)
{
struct sysinfo_3_2_2 *vmms;
- vmms = (struct sysinfo_3_2_2 *) alloc_page(GFP_KERNEL);
- if (vmms && stsi(vmms, 3, 2, 2) == 0 && vmms->count)
+ vmms = (struct sysinfo_3_2_2 *) memblock_alloc(PAGE_SIZE, PAGE_SIZE);
+ if (stsi(vmms, 3, 2, 2) == 0 && vmms->count)
add_device_randomness(&vmms, vmms->count);
- free_page((unsigned long) vmms);
+ memblock_free((unsigned long) vmms, PAGE_SIZE);
}
/*