Skip to content

Commit

Permalink
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/arm64/linux

Pull arm64 fix from Will Deacon:
 "Fix pte_same() to avoid getting stuck on write fault.

  This single arm64 fix is a revert of 747a70e ("arm64: Fix
  copy-on-write referencing in HugeTLB"), not because that patch was
  wrong, but because it was broken by aa57157 ("arm64: Ensure
  VM_WRITE|VM_SHARED ptes are clean by default") which we merged in
  -rc6.

  We spotted the issue in Android (AOSP), where one of the JIT threads
  gets stuck on a write fault during boot because the faulting pte is
  marked as PTE_DIRTY | PTE_WRITE | PTE_RDONLY and the fault handler
  decides that there's nothing to do thanks to pte_same() masking out
  PTE_RDONLY.

  Thanks to John Stultz for reporting this and testing this so quickly,
  and to Steve Capper for confirming that the HugeTLB tests continue to
  pass"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: Do not mask out PTE_RDONLY in pte_same()
  • Loading branch information
Linus Torvalds committed Nov 8, 2019
2 parents 410ef73 + 6767df2 commit 9e8ed26
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions arch/arm64/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,23 +283,6 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
set_pte(ptep, pte);
}

#define __HAVE_ARCH_PTE_SAME
static inline int pte_same(pte_t pte_a, pte_t pte_b)
{
pteval_t lhs, rhs;

lhs = pte_val(pte_a);
rhs = pte_val(pte_b);

if (pte_present(pte_a))
lhs &= ~PTE_RDONLY;

if (pte_present(pte_b))
rhs &= ~PTE_RDONLY;

return (lhs == rhs);
}

/*
* Huge pte definitions.
*/
Expand Down

0 comments on commit 9e8ed26

Please sign in to comment.