Skip to content

Commit e1a5849

Browse files
Andreas Gruenbachergregkh
authored andcommitted
powerpc/kvm: Fix kvm_use_magic_page
commit 0c8eb28 upstream. When switching from __get_user to fault_in_pages_readable, commit 9f9eae5 broke kvm_use_magic_page: like __get_user, fault_in_pages_readable returns 0 on success. Fixes: 9f9eae5 ("powerpc/kvm: Prefer fault_in_pages_readable function") Cc: [email protected] # v4.18+ Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Anand Jain <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d72866a commit e1a5849

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/kernel/kvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ static void __init kvm_use_magic_page(void)
669669
on_each_cpu(kvm_map_magic_page, &features, 1);
670670

671671
/* Quick self-test to see if the mapping works */
672-
if (!fault_in_pages_readable((const char *)KVM_MAGIC_PAGE, sizeof(u32))) {
672+
if (fault_in_pages_readable((const char *)KVM_MAGIC_PAGE, sizeof(u32))) {
673673
kvm_patching_worked = false;
674674
return;
675675
}

0 commit comments

Comments
 (0)