]> git.baikalelectronics.ru Git - kernel.git/commitdiff
KVM: PPC: Use arch_get_random_seed_long instead of powernv variant
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Thu, 5 Aug 2021 07:56:49 +0000 (17:56 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 10 Aug 2021 13:14:56 +0000 (23:14 +1000)
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 <aik@ozlabs.ru>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210805075649.2086567-1-aik@ozlabs.ru
arch/powerpc/kvm/book3s_hv.c

index 085fb8ecbf6884f91a2a0473ce223cf8595bccfe..9f957ceee58ae8bbeb1a8e58ea325e4af23c1280 100644 (file)
@@ -1165,7 +1165,7 @@ int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu)
                break;
 #endif
        case H_RANDOM:
-               if (!powernv_get_random_long(&vcpu->arch.regs.gpr[4]))
+               if (!arch_get_random_seed_long(&vcpu->arch.regs.gpr[4]))
                        ret = H_HARDWARE;
                break;
        case H_RPT_INVALIDATE: