Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6539756e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull arm64 fixes from Catalin Marinas:

 - Update the linker script to use L1_CACHE_BYTES instead of hard-coded
   64.  We recently changed L1_CACHE_BYTES to 128

 - Improve race condition reporting on set_pte_at() and change the BUG
   to WARN_ONCE.  With hardware update of the accessed/dirty state, we
   need to ensure that set_pte_at() does not inadvertently override
   hardware updated state.  The patch also makes the checks ignore
   !pte_valid() new entries

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: Improve error reporting on set_pte_at() checks
  arm64: update linker script to increased L1_CACHE_BYTES value
parents b9d85451 82d34008
Loading
Loading
Loading
Loading
+8 −4
Original line number Original line Diff line number Diff line
@@ -276,10 +276,14 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
	 * hardware updates of the pte (ptep_set_access_flags safely changes
	 * hardware updates of the pte (ptep_set_access_flags safely changes
	 * valid ptes without going through an invalid entry).
	 * valid ptes without going through an invalid entry).
	 */
	 */
	if (IS_ENABLED(CONFIG_DEBUG_VM) && IS_ENABLED(CONFIG_ARM64_HW_AFDBM) &&
	if (IS_ENABLED(CONFIG_ARM64_HW_AFDBM) &&
	    pte_valid(*ptep)) {
	    pte_valid(*ptep) && pte_valid(pte)) {
		BUG_ON(!pte_young(pte));
		VM_WARN_ONCE(!pte_young(pte),
		BUG_ON(pte_write(*ptep) && !pte_dirty(pte));
			     "%s: racy access flag clearing: 0x%016llx -> 0x%016llx",
			     __func__, pte_val(*ptep), pte_val(pte));
		VM_WARN_ONCE(pte_write(*ptep) && !pte_dirty(pte),
			     "%s: racy dirty state clearing: 0x%016llx -> 0x%016llx",
			     __func__, pte_val(*ptep), pte_val(pte));
	}
	}


	set_pte(ptep, pte);
	set_pte(ptep, pte);
+3 −2
Original line number Original line Diff line number Diff line
@@ -5,6 +5,7 @@
 */
 */


#include <asm-generic/vmlinux.lds.h>
#include <asm-generic/vmlinux.lds.h>
#include <asm/cache.h>
#include <asm/kernel-pgtable.h>
#include <asm/kernel-pgtable.h>
#include <asm/thread_info.h>
#include <asm/thread_info.h>
#include <asm/memory.h>
#include <asm/memory.h>
@@ -140,7 +141,7 @@ SECTIONS
		ARM_EXIT_KEEP(EXIT_DATA)
		ARM_EXIT_KEEP(EXIT_DATA)
	}
	}


	PERCPU_SECTION(64)
	PERCPU_SECTION(L1_CACHE_BYTES)


	. = ALIGN(PAGE_SIZE);
	. = ALIGN(PAGE_SIZE);
	__init_end = .;
	__init_end = .;
@@ -158,7 +159,7 @@ SECTIONS
	. = ALIGN(PAGE_SIZE);
	. = ALIGN(PAGE_SIZE);
	_data = .;
	_data = .;
	_sdata = .;
	_sdata = .;
	RW_DATA_SECTION(64, PAGE_SIZE, THREAD_SIZE)
	RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
	PECOFF_EDATA_PADDING
	PECOFF_EDATA_PADDING
	_edata = .;
	_edata = .;