From owner-svn-src-head@freebsd.org Thu Jan 18 16:20:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1964FEB5083; Thu, 18 Jan 2018 16:20:11 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9236754DB; Thu, 18 Jan 2018 16:20:10 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47A2720DAF; Thu, 18 Jan 2018 16:20:10 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0IGKASF074898; Thu, 18 Jan 2018 16:20:10 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0IGKAW7074897; Thu, 18 Jan 2018 16:20:10 GMT (envelope-from br@FreeBSD.org) Message-Id: <201801181620.w0IGKAW7074897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 18 Jan 2018 16:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328130 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 328130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 16:20:11 -0000 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 {