From owner-svn-src-all@FreeBSD.ORG Sat May 23 23:27:02 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61B6B518; Sat, 23 May 2015 23:27:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4FD941B93; Sat, 23 May 2015 23:27:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4NNR2mw062414; Sat, 23 May 2015 23:27:02 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4NNR1mU062403; Sat, 23 May 2015 23:27:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505232327.t4NNR1mU062403@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 23 May 2015 23:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283339 - in stable/10/sys: arm/arm arm/include conf X-SVN-Group: stable-10 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.20 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: Sat, 23 May 2015 23:27:02 -0000 Author: ian Date: Sat May 23 23:27:00 2015 New Revision: 283339 URL: https://svnweb.freebsd.org/changeset/base/283339 Log: MFC r280278, r280402: Allow to override default kernel virtual address assignment on ARM. Do not save/restore the TLS pointer on context switch for armv6. Modified: stable/10/sys/arm/arm/swtch.S stable/10/sys/arm/arm/sys_machdep.c stable/10/sys/arm/arm/vm_machdep.c stable/10/sys/arm/include/vmparam.h stable/10/sys/conf/options.arm Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/swtch.S ============================================================================== --- stable/10/sys/arm/arm/swtch.S Sat May 23 23:08:54 2015 (r283338) +++ stable/10/sys/arm/arm/swtch.S Sat May 23 23:27:00 2015 (r283339) @@ -255,7 +255,7 @@ ENTRY(cpu_switch) mov r4, r0 /* Save the old thread. */ #ifdef ARM_TP_ADDRESS - /* Store the old tp */ + /* Store the old tp; userland can change it on armv4. */ ldr r3, =ARM_TP_ADDRESS ldr r9, [r3] str r9, [r0, #(TD_MD + MD_TP)] @@ -272,11 +272,10 @@ ENTRY(cpu_switch) ldr r9, [r1, #(TD_MD + MD_RAS_END)] str r9, [r3, #8] #else - /* Store the old tp */ - mrc p15, 0, r9, c13, c0, 3 - str r9, [r0, #(TD_MD + MD_TP)] - - /* Set the new tp */ + /* + * Set new tp. No need to store the old one first, userland can't + * change it directly on armv6. + */ ldr r9, [r1, #(TD_MD + MD_TP)] mcr p15, 0, r9, c13, c0, 3 #endif Modified: stable/10/sys/arm/arm/sys_machdep.c ============================================================================== --- stable/10/sys/arm/arm/sys_machdep.c Sat May 23 23:08:54 2015 (r283338) +++ stable/10/sys/arm/arm/sys_machdep.c Sat May 23 23:27:00 2015 (r283339) @@ -84,13 +84,11 @@ static int arm32_set_tp(struct thread *td, void *args) { - if (td != curthread) - td->td_md.md_tp = (register_t)args; - else + td->td_md.md_tp = (register_t)args; #ifndef ARM_TP_ADDRESS - set_tls(args); + set_tls(args); #else - *(register_t *)ARM_TP_ADDRESS = (register_t)args; + *(register_t *)ARM_TP_ADDRESS = (register_t)args; #endif return (0); } @@ -99,13 +97,10 @@ static int arm32_get_tp(struct thread *td, void *args) { - if (td != curthread) - td->td_retval[0] = td->td_md.md_tp; - else #ifndef ARM_TP_ADDRESS - td->td_retval[0] = (register_t)get_tls(); + td->td_retval[0] = td->td_md.md_tp; #else - td->td_retval[0] = *(register_t *)ARM_TP_ADDRESS; + td->td_retval[0] = *(register_t *)ARM_TP_ADDRESS; #endif return (0); } Modified: stable/10/sys/arm/arm/vm_machdep.c ============================================================================== --- stable/10/sys/arm/arm/vm_machdep.c Sat May 23 23:08:54 2015 (r283338) +++ stable/10/sys/arm/arm/vm_machdep.c Sat May 23 23:27:00 2015 (r283339) @@ -182,7 +182,7 @@ cpu_fork(register struct thread *td1, re #ifdef ARM_TP_ADDRESS td2->td_md.md_tp = *(register_t *)ARM_TP_ADDRESS; #else - td2->td_md.md_tp = (register_t) get_tls(); + td2->td_md.md_tp = td1->td_md.md_tp; #endif } @@ -411,7 +411,7 @@ cpu_set_user_tls(struct thread *td, void #ifdef ARM_TP_ADDRESS *(register_t *)ARM_TP_ADDRESS = (register_t)tls_base; #else - set_tls((void *)tls_base); + set_tls(tls_base); #endif critical_exit(); } Modified: stable/10/sys/arm/include/vmparam.h ============================================================================== --- stable/10/sys/arm/include/vmparam.h Sat May 23 23:08:54 2015 (r283338) +++ stable/10/sys/arm/include/vmparam.h Sat May 23 23:27:00 2015 (r283339) @@ -68,7 +68,9 @@ * The line between user space and kernel space * Mappings >= KERNEL_BASE are constant across all processes */ +#ifndef KERNBASE #define KERNBASE 0xc0000000 +#endif /* * max number of non-contig chunks of physical RAM you can have Modified: stable/10/sys/conf/options.arm ============================================================================== --- stable/10/sys/conf/options.arm Sat May 23 23:08:54 2015 (r283338) +++ stable/10/sys/conf/options.arm Sat May 23 23:27:00 2015 (r283339) @@ -28,6 +28,7 @@ IPI_IRQ_START opt_smp.h IPI_IRQ_END opt_smp.h FREEBSD_BOOT_LOADER opt_global.h IXP4XX_FLASH_SIZE opt_global.h +KERNBASE opt_global.h KERNPHYSADDR opt_global.h KERNVIRTADDR opt_global.h LINUX_BOOT_ABI opt_global.h