From owner-dev-commits-src-all@freebsd.org Sat Mar 6 21:47:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AED80573B20; Sat, 6 Mar 2021 21:47:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DtJ9c4YxNz4t15; Sat, 6 Mar 2021 21:47:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F71828CB; Sat, 6 Mar 2021 21:47:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 126LlWjq079867; Sat, 6 Mar 2021 21:47:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126LlWMl079866; Sat, 6 Mar 2021 21:47:32 GMT (envelope-from git) Date: Sat, 6 Mar 2021 21:47:32 GMT Message-Id: <202103062147.126LlWMl079866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brandon Bergren Subject: git: bad9fa56620e - main - [PowerPC] Fix AP bringup on 32-bit AIM SMP MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdragon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bad9fa56620eb82395c5ab66d300e91a0222dde2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 21:47:32 -0000 The branch main has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=bad9fa56620eb82395c5ab66d300e91a0222dde2 commit bad9fa56620eb82395c5ab66d300e91a0222dde2 Author: Brandon Bergren AuthorDate: 2021-03-06 21:26:16 +0000 Commit: Brandon Bergren CommitDate: 2021-03-06 21:46:28 +0000 [PowerPC] Fix AP bringup on 32-bit AIM SMP In r361544, the pmap drivers were converted to ifuncs. When doing so, this changed the call type of pmap functions to be called via the secure-plt stubs. These stubs depend on the TOC base being loaded to r30 to run properly. On SMP AIM (i.e. a dual processor G4 or running 32-bit on G5), since the APs were being started up from the reset vector instead of going through __start, they had never had r30 initialized properly, so when the cpu_reset code in trap_subr32.S attempted to branch to pmap_cpu_bootstrap(), it was loading the target from the wrong location. Ensure r30 is set up directly in the cpu_reset trap code, so we can make PLT calls as normal. Fixes boot on my SMP G4. Reviewed by: jhibbits MFC after: 3 days Sponsored by: Tag1 Consulting, Inc. --- sys/powerpc/aim/trap_subr32.S | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/powerpc/aim/trap_subr32.S b/sys/powerpc/aim/trap_subr32.S index 710a222fd84c..9664dcc92d2d 100644 --- a/sys/powerpc/aim/trap_subr32.S +++ b/sys/powerpc/aim/trap_subr32.S @@ -316,6 +316,7 @@ cpu_reset: 1: mflr %r1 addi %r1,%r1,(124-16)@l + lwz %r30,TRAP_TOCBASE(0) bl CNAME(cpudep_ap_early_bootstrap) lis %r3,1@l