diff options
author | 2022-06-22 12:54:35 +0200 | |
---|---|---|
committer | 2022-07-19 19:37:50 +0200 | |
commit | 850190e5d421544fdf95652be2b4575d45fd4298 (patch) | |
tree | 1c26298f7a009e3319b9e7d06e35a237d08fbb50 /include/linux/mtd/doc2000.h | |
parent | powerpc/powernv: rename remaining rng powernv_ functions to pnv_ (diff) | |
download | linux-dev-850190e5d421544fdf95652be2b4575d45fd4298.tar.xz linux-dev-850190e5d421544fdf95652be2b4575d45fd4298.zip |
powerpc/kvm: don't crash on missing rng, and use darn
On POWER8 systems that don't have ibm,power-rng available, a guest that
ignores the KVM_CAP_PPC_HWRNG flag and calls H_RANDOM anyway will
dereference a NULL pointer. And on machines with darn instead of
ibm,power-rng, H_RANDOM won't work at all.
This patch kills two birds with one stone, by routing H_RANDOM calls to
ppc_md.get_random_seed, and doing the real mode check inside of it.
Cc: stable@vger.kernel.org # v4.1+
Cc: Michael Ellerman <mpe@ellerman.id.au>
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
Fixes: e928e9cb3601 ("KVM: PPC: Book3S HV: Add fast real-mode H_RANDOM implementation.")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'include/linux/mtd/doc2000.h')
0 files changed, 0 insertions, 0 deletions