Date: Thu, 18 Jan 2018 16:20:10 +0000 (UTC) From: Ruslan Bukin <br@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328130 - head/sys/arm64/arm64 Message-ID: <201801181620.w0IGKAW7074897@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: br Date: Thu Jan 18 16:20:09 2018 New Revision: 328130 URL: https://svnweb.freebsd.org/changeset/base/328130 Log: Set the base address of translation table 0. This fixes operation on Qualcomm Snapdragon and some other platforms. During boot time on subsystems initialization we have some amount of kernel threads created, then scheduler gives CPU time to each thread. Eventually scheduler returns CPU execution back to thread 0. In this case writing zero to ttbr0 in cpu_switch leads Qualcomm board to reboot (asynchronously, CPU continues execution). Similar to other kernel threads install a valid physical address (kernel pmap) to user page table base register ttbr0. Reviewed by: andrew Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13536 Modified: head/sys/arm64/arm64/machdep.c Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Thu Jan 18 15:28:49 2018 (r328129) +++ head/sys/arm64/arm64/machdep.c Thu Jan 18 16:20:09 2018 (r328130) @@ -715,6 +715,9 @@ init_proc0(vm_offset_t kstack) thread0.td_pcb->pcb_vfpcpu = UINT_MAX; thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; + + /* Set the base address of translation table 0. */ + thread0.td_proc->p_md.md_l0addr = READ_SPECIALREG(ttbr0_el1); } typedef struct {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801181620.w0IGKAW7074897>