Skip to content

Commit 2ac78e0

Browse files
aikmpe
authored andcommitted
KVM: PPC: Use arch_get_random_seed_long instead of powernv variant
The powernv_get_random_long() does not work in nested KVM (which is pseries) and produces a crash when accessing in_be64(rng->regs) in powernv_get_random_long(). This replaces powernv_get_random_long with the ppc_md machine hook wrapper. Signed-off-by: Alexey Kardashevskiy <[email protected]> Reviewed-by: Fabiano Rosas <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9b49f97 commit 2ac78e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/kvm/book3s_hv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu)
11651165
break;
11661166
#endif
11671167
case H_RANDOM:
1168-
if (!powernv_get_random_long(&vcpu->arch.regs.gpr[4]))
1168+
if (!arch_get_random_seed_long(&vcpu->arch.regs.gpr[4]))
11691169
ret = H_HARDWARE;
11701170
break;
11711171
case H_RPT_INVALIDATE:

0 commit comments

Comments
 (0)