Skip to content

Commit

Permalink
Merge tag 'powerpc-5.0-5' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/powerpc/linux

Pull powerpc fix from Michael Ellerman:
 "Just one fix, for pgd/pud_present() which were broken on big endian
  since v4.20, leading to possible data corruption.

  Thanks to: Aneesh Kumar K.V., Erhard F., Jan Kara"

* tag 'powerpc-5.0-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/64s: Fix possible corruption on big endian due to pgd/pud_present()
  • Loading branch information
Linus Torvalds committed Feb 17, 2019
2 parents 0513ebc + a580076 commit c5f1ac5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/include/asm/book3s/64/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ static inline int pud_none(pud_t pud)

static inline int pud_present(pud_t pud)
{
return (pud_raw(pud) & cpu_to_be64(_PAGE_PRESENT));
return !!(pud_raw(pud) & cpu_to_be64(_PAGE_PRESENT));
}

extern struct page *pud_page(pud_t pud);
Expand Down Expand Up @@ -951,7 +951,7 @@ static inline int pgd_none(pgd_t pgd)

static inline int pgd_present(pgd_t pgd)
{
return (pgd_raw(pgd) & cpu_to_be64(_PAGE_PRESENT));
return !!(pgd_raw(pgd) & cpu_to_be64(_PAGE_PRESENT));
}

static inline pte_t pgd_pte(pgd_t pgd)
Expand Down

0 comments on commit c5f1ac5

Please sign in to comment.