From owner-svn-src-head@freebsd.org Fri Dec 29 20:25:16 2017 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 EC241EAEC9C; Fri, 29 Dec 2017 20:25:16 +0000 (UTC) (envelope-from nwhitehorn@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 B68A87A4C4; Fri, 29 Dec 2017 20:25:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBTKPFcm006139; Fri, 29 Dec 2017 20:25:15 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBTKPFjC006138; Fri, 29 Dec 2017 20:25:15 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712292025.vBTKPFjC006138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 29 Dec 2017 20:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327357 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 327357 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: Fri, 29 Dec 2017 20:25:17 -0000 Author: nwhitehorn Date: Fri Dec 29 20:25:15 2017 New Revision: 327357 URL: https://svnweb.freebsd.org/changeset/base/327357 Log: Maintain alignment of in-code 64-bit quantities by design rather than luck. If these are not aligned, the linker has to emit a different type of relocation that the early boot self-relocation code cannot handle, even in principle, resulting in them being set to zero and the kernel crashing. MFC after: 1 week Modified: head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Fri Dec 29 20:00:19 2017 (r327356) +++ head/sys/powerpc/aim/trap_subr64.S Fri Dec 29 20:25:15 2017 (r327357) @@ -297,7 +297,8 @@ dtrace_invop_calltrap_addr: * not still hanging around in the trap handling region * once the MMU is turned on. */ - .globl CNAME(rstcode), CNAME(rstcodeend) + .globl CNAME(rstcode), CNAME(rstcodeend), CNAME(cpu_reset_handler) + .p2align 3 CNAME(rstcode): /* Explicitly set MSR[SF] */ mfmsr %r9 @@ -305,8 +306,9 @@ CNAME(rstcode): insrdi %r9,%r8,1,0 mtmsrd %r9 isync + bl 1f - .llong cpu_reset + .llong cpu_reset_handler /* Make sure to maintain 8-byte alignment */ 1: mflr %r9 ld %r9,0(%r9) mtlr %r9 @@ -314,7 +316,7 @@ CNAME(rstcode): blr CNAME(rstcodeend): -cpu_reset: +cpu_reset_handler: GET_TOCBASE(%r2) ld %r1,TOC_REF(tmpstk)(%r2) /* get new SP */ @@ -569,6 +571,7 @@ CNAME(aliend): * Has to handle standard pagetable spills */ .globl CNAME(dsitrap),CNAME(dsiend) + .p2align 3 CNAME(dsitrap): mtsprg1 %r1 /* save SP */ GET_CPUINFO(%r1) @@ -831,6 +834,7 @@ dbleave: * In case of KDB we want a separate trap catcher for it */ .globl CNAME(dblow),CNAME(dbend) + .p2align 3 CNAME(dblow): mtsprg1 %r1 /* save SP */ mtsprg2 %r29 /* save r29 */ @@ -859,6 +863,7 @@ CNAME(dblow): std %r30,(PC_DBSAVE+CPUSAVE_R30)(%r1) /* free r30 */ std %r31,(PC_DBSAVE+CPUSAVE_R31)(%r1) /* free r31 */ mflr %r28 /* save LR */ + nop /* alignment */ bl 9f /* Begin branch */ .llong dbtrap 9: mflr %r1