diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-22 08:56:55 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-22 08:56:55 +0200 |
commit | b4a338d2b3cafa1be68d4e1903203c7e08a38ee5 (patch) | |
tree | 069f3753af1cda34c36a7627000ab46ef5c51c83 /arch/powerpc/kvm/book3s_hv_builtin.c | |
parent | 34cfb106d1f8a746fcccbe61c852f705dcdceaa2 (diff) | |
parent | 08332893e37af6ae779367e78e444f8f9571511d (diff) | |
download | linux-b4a338d2b3cafa1be68d4e1903203c7e08a38ee5.tar.bz2 |
Merge 4.12-rc2 into char-misc-next
We want the fixes in here as well to handle merge issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/powerpc/kvm/book3s_hv_builtin.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_hv_builtin.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c index 88a65923c649..ee4c2558c305 100644 --- a/arch/powerpc/kvm/book3s_hv_builtin.c +++ b/arch/powerpc/kvm/book3s_hv_builtin.c @@ -207,7 +207,14 @@ EXPORT_SYMBOL_GPL(kvmppc_hwrng_present); long kvmppc_h_random(struct kvm_vcpu *vcpu) { - if (powernv_get_random_real_mode(&vcpu->arch.gpr[4])) + int r; + + /* Only need to do the expensive mfmsr() on radix */ + if (kvm_is_radix(vcpu->kvm) && (mfmsr() & MSR_IR)) + r = powernv_get_random_long(&vcpu->arch.gpr[4]); + else + r = powernv_get_random_real_mode(&vcpu->arch.gpr[4]); + if (r) return H_SUCCESS; return H_HARDWARE; |