summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2021-08-02 13:46:19 +0200
committerAndreas Gruenbacher <agruenba@redhat.com>2021-10-18 16:31:45 +0200
commit0c8eb2884a42d992c7726539328b7d3568f22143 (patch)
tree8bbeb387b5d3c11f08f36a29eb4ec47ff87a29f0 /arch
parentiov_iter: Fix iov_iter_get_pages{,_alloc} page fault return value (diff)
downloadlinux-0c8eb2884a42d992c7726539328b7d3568f22143.tar.xz
linux-0c8eb2884a42d992c7726539328b7d3568f22143.zip
powerpc/kvm: Fix kvm_use_magic_page
When switching from __get_user to fault_in_pages_readable, commit 9f9eae5ce717 broke kvm_use_magic_page: like __get_user, fault_in_pages_readable returns 0 on success. Fixes: 9f9eae5ce717 ("powerpc/kvm: Prefer fault_in_pages_readable function") Cc: stable@vger.kernel.org # v4.18+ Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/kvm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c
index 617eba82531c..d89cf802d9aa 100644
--- a/arch/powerpc/kernel/kvm.c
+++ b/arch/powerpc/kernel/kvm.c
@@ -669,7 +669,7 @@ static void __init kvm_use_magic_page(void)
on_each_cpu(kvm_map_magic_page, &features, 1);
/* Quick self-test to see if the mapping works */
- if (!fault_in_pages_readable((const char *)KVM_MAGIC_PAGE, sizeof(u32))) {
+ if (fault_in_pages_readable((const char *)KVM_MAGIC_PAGE, sizeof(u32))) {
kvm_patching_worked = false;
return;
}