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

Commit d8fd35fc authored by Paul Mundt's avatar Paul Mundt
Browse files

sh64: Fix up vmalloc fault range check.



With the previous attempt reverted this switches to conditionalizing the
end address. Nominally VMALLOC_END, but extended for P3_ADDR_MAX in the
store queue case.

Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent c3e0af98
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -160,6 +160,12 @@ static inline pmd_t *vmalloc_sync_one(pgd_t *pgd, unsigned long address)
	return pmd_k;
	return pmd_k;
}
}


#ifdef CONFIG_SH_STORE_QUEUES
#define __FAULT_ADDR_LIMIT	P3_ADDR_MAX
#else
#define __FAULT_ADDR_LIMIT	VMALLOC_END
#endif

/*
/*
 * Handle a fault on the vmalloc or module mapping area
 * Handle a fault on the vmalloc or module mapping area
 */
 */
@@ -170,7 +176,7 @@ static noinline int vmalloc_fault(unsigned long address)
	pte_t *pte_k;
	pte_t *pte_k;


	/* Make sure we are in vmalloc/module/P3 area: */
	/* Make sure we are in vmalloc/module/P3 area: */
	if (!(address >= P3SEG && address < P3_ADDR_MAX))
	if (!(address >= VMALLOC_START && address < __FAULT_ADDR_LIMIT))
		return -1;
		return -1;


	/*
	/*