From owner-svn-src-all@freebsd.org Fri Jun 9 15:37:18 2017 Return-Path: Delivered-To: svn-src-all@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 BBEE0BF7B89; Fri, 9 Jun 2017 15:37:18 +0000 (UTC) (envelope-from andrew@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 mx1.freebsd.org (Postfix) with ESMTPS id 8BC7E71ABF; Fri, 9 Jun 2017 15:37:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v59FbHnQ045572; Fri, 9 Jun 2017 15:37:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v59FbHMx045568; Fri, 9 Jun 2017 15:37:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706091537.v59FbHMx045568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 9 Jun 2017 15:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319752 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jun 2017 15:37:18 -0000 Author: andrew Date: Fri Jun 9 15:37:17 2017 New Revision: 319752 URL: https://svnweb.freebsd.org/changeset/base/319752 Log: Store the read-only thread pointer when scheduling a new thread. This is not currently set, however we may wish to set it later. Modified: head/sys/arm64/arm64/genassym.c head/sys/arm64/arm64/swtch.S head/sys/arm64/include/pcb.h Modified: head/sys/arm64/arm64/genassym.c ============================================================================== --- head/sys/arm64/arm64/genassym.c Fri Jun 9 15:30:41 2017 (r319751) +++ head/sys/arm64/arm64/genassym.c Fri Jun 9 15:37:17 2017 (r319752) @@ -49,6 +49,7 @@ ASSYM(PCB_SIZE, roundup2(sizeof(struct pcb), STACKALIG ASSYM(PCB_SINGLE_STEP_SHIFT, PCB_SINGLE_STEP_SHIFT); ASSYM(PCB_REGS, offsetof(struct pcb, pcb_x)); ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp)); +ASSYM(PCB_TPIDRRO, offsetof(struct pcb, pcb_tpidrro_el0)); ASSYM(PCB_L0ADDR, offsetof(struct pcb, pcb_l0addr)); ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Fri Jun 9 15:30:41 2017 (r319751) +++ head/sys/arm64/arm64/swtch.S Fri Jun 9 15:37:17 2017 (r319752) @@ -104,6 +104,8 @@ ENTRY(cpu_throw) ldp x5, x6, [x4, #PCB_SP] mov sp, x5 msr tpidr_el0, x6 + ldr x6, [x4, #PCB_TPIDRRO] + msr tpidrro_el0, x6 ldp x8, x9, [x4, #PCB_REGS + 8 * 8] ldp x10, x11, [x4, #PCB_REGS + 10 * 8] ldp x12, x13, [x4, #PCB_REGS + 12 * 8] @@ -149,6 +151,8 @@ ENTRY(cpu_switch) str x30, [x4, #PCB_REGS + 30 * 8] /* And the old stack pointer */ mov x5, sp + mrs x6, tpidrro_el0 + str x6, [x4, #PCB_TPIDRRO] mrs x6, tpidr_el0 stp x5, x6, [x4, #PCB_SP] @@ -215,6 +219,8 @@ ENTRY(cpu_switch) ldp x5, x6, [x4, #PCB_SP] mov sp, x5 msr tpidr_el0, x6 + ldr x6, [x4, #PCB_TPIDRRO] + msr tpidrro_el0, x6 ldp x8, x9, [x4, #PCB_REGS + 8 * 8] ldp x10, x11, [x4, #PCB_REGS + 10 * 8] ldp x12, x13, [x4, #PCB_REGS + 12 * 8] @@ -301,6 +307,8 @@ ENTRY(savectx) str x30, [x0, #PCB_REGS + 30 * 8] /* And the old stack pointer */ mov x5, sp + mrs x6, tpidrro_el0 + str x6, [x0, #PCB_TPIDRRO] mrs x6, tpidr_el0 stp x5, x6, [x0, #PCB_SP] Modified: head/sys/arm64/include/pcb.h ============================================================================== --- head/sys/arm64/include/pcb.h Fri Jun 9 15:30:41 2017 (r319751) +++ head/sys/arm64/include/pcb.h Fri Jun 9 15:37:17 2017 (r319752) @@ -42,6 +42,7 @@ struct pcb { /* These two need to be in order as we access them together */ uint64_t pcb_sp; uint64_t pcb_tpidr_el0; + uint64_t pcb_tpidrro_el0; vm_offset_t pcb_l0addr; /* Fault handler, the error value is passed in x0 */