Commit 6186bdd1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull powerpc fixes from Madhavan Srinivasan:

 - Couple of patches to fix KASAN failduring boot

 - Fix to avoid warnings/errors when building with 4k page size

Thanks to Christophe Leroy, Ritesh Harjani (IBM), and Erhard Furtner

* tag 'powerpc-6.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/code-patching: Fix KASAN hit by not flagging text patching area as VM_ALLOC
  powerpc/64s: Rewrite __real_pte() and __rpte_to_hidx() as static inline
  powerpc/code-patching: Disable KASAN report during patching via temporary mm
parents 0ad2507d d262a192
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -77,9 +77,17 @@
/*
 * With 4K page size the real_pte machinery is all nops.
 */
#define __real_pte(e, p, o)		((real_pte_t){(e)})
static inline real_pte_t __real_pte(pte_t pte, pte_t *ptep, int offset)
{
	return (real_pte_t){pte};
}

#define __rpte_to_pte(r)	((r).pte)
#define __rpte_to_hidx(r,index)	(pte_val(__rpte_to_pte(r)) >> H_PAGE_F_GIX_SHIFT)

static inline unsigned long __rpte_to_hidx(real_pte_t rpte, unsigned long index)
{
	return pte_val(__rpte_to_pte(rpte)) >> H_PAGE_F_GIX_SHIFT;
}

#define pte_iterate_hashed_subpages(rpte, psize, va, index, shift)       \
	do {							         \
+3 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ static int text_area_cpu_up(unsigned int cpu)
	unsigned long addr;
	int err;

	area = get_vm_area(PAGE_SIZE, VM_ALLOC);
	area = get_vm_area(PAGE_SIZE, 0);
	if (!area) {
		WARN_ONCE(1, "Failed to create text area for cpu %d\n",
			cpu);
@@ -493,7 +493,9 @@ static int __do_patch_instructions_mm(u32 *addr, u32 *code, size_t len, bool rep

	orig_mm = start_using_temp_mm(patching_mm);

	kasan_disable_current();
	err = __patch_instructions(patch_addr, code, len, repeat_instr);
	kasan_enable_current();

	/* context synchronisation performed by __patch_instructions */
	stop_using_temp_mm(patching_mm, orig_mm);