Set pcpu curpmap for powerpc64

Summary:
If an illegal instruction is encountered on a process running on a
powerpc64 kernel it would attempt to sync the cache before retrying the
instruction "just in case".  However, since curpmap is not set, when
moea64_sync_icache() attempts to lock the pmap, it's locking on a NULL pointer,
triggering a panic.  Fix this by adding a (assumed unnecessary) fallback to
curthread's pmap in moea64_sync_icache().

Reported by:	alfredo.junior_eldorado.org.br
Reviewed by:	luporl, alfredo.junior_eldorado.org.br
Differential Revision: https://reviews.freebsd.org/D20911
This commit is contained in:
Justin Hibbits 2019-07-13 00:19:57 +00:00
parent 8fb2c7ac84
commit 21e47be25e

View File

@ -2838,6 +2838,9 @@ moea64_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_size_t sz)
vm_paddr_t pa;
vm_size_t len;
if (__predict_false(pm == NULL))
pm = &curthread->td_proc->p_vmspace->vm_pmap;
PMAP_LOCK(pm);
while (sz > 0) {
lim = round_page(va+1);