Date: Mon, 15 Oct 2018 16:43:07 +0000 (UTC) From: Leandro Lupori <luporl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339360 - head/sys/powerpc/powerpc Message-ID: <201810151643.w9FGh7KC062012@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luporl Date: Mon Oct 15 16:43:07 2018 New Revision: 339360 URL: https://svnweb.freebsd.org/changeset/base/339360 Log: Initialize SPRG0 before its first possible use At early boot, PCPU_GET(), that obtains a pointer from SPRG0, was being used with SPRG0 not yet initialized. If it pointed to an invalid address, the machine would hang. Approved by: re(gjb), jhibbits(mentor) Modified: head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Mon Oct 15 10:50:04 2018 (r339359) +++ head/sys/powerpc/powerpc/machdep.c Mon Oct 15 16:43:07 2018 (r339360) @@ -383,12 +383,12 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs if (platform_smp_get_bsp(&bsp) != 0) bsp.cr_cpuid = 0; pc = &__pcpu[bsp.cr_cpuid]; + __asm __volatile("mtsprg 0, %0" :: "r"(pc)); pcpu_init(pc, bsp.cr_cpuid, sizeof(struct pcpu)); pc->pc_curthread = &thread0; thread0.td_oncpu = bsp.cr_cpuid; pc->pc_cpuid = bsp.cr_cpuid; pc->pc_hwref = bsp.cr_hwref; - __asm __volatile("mtsprg 0, %0" :: "r"(pc)); /* * Init KDB
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810151643.w9FGh7KC062012>