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 { _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"