Skip to content

Commit 0e11df9

Browse files
kvaneeshmpe
authored andcommitted
powerpc/kvm/book3s: Use pte_present instead of opencoding _PAGE_PRESENT check
This adds _PAGE_PTE check and makes sure we validate the pte value returned via find_kvm_host_pte. NOTE: this also considers _PAGE_INVALID to the software valid bit. Signed-off-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9fd4236 commit 0e11df9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/include/asm/kvm_book3s_64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ static inline pte_t kvmppc_read_update_linux_pte(pte_t *ptep, int writing)
435435
continue;
436436
}
437437
/* If pte is not present return None */
438-
if (unlikely(!(pte_val(old_pte) & _PAGE_PRESENT)))
438+
if (unlikely(!pte_present(old_pte)))
439439
return __pte(0);
440440

441441
new_pte = pte_mkyoung(old_pte);

0 commit comments

Comments
 (0)