From nobody Thu Dec 12 21:10:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y8Q9C3bZQz5glZQ; Thu, 12 Dec 2024 21:10:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y8Q9C1CT4z4KqK; Thu, 12 Dec 2024 21:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734037823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/H7koBHu0gb6Y1UcZ6LyTp6bvjUozgWe4QUUOZznboo=; b=p7ZGTlboQCZdFEA3r8xR7Tm5mYQyj30QLLO8IayePoXlsUkSOkfvHeminiVRrqZz08hMvW d6hGn++psHc/mrWXe0LPos9li6o+GJPMeXdBTgH42VVAWUhjw3YmRp8KJrJoTUQgthY57s V/JBYYUTw7NlSatecAlyFl8nsQpwQDJKyhgDO94O831GtmQPA1i4Vfnm4GHN5IcRFnjcEy yCb3bRHdui2SyoyHFQNDs+XfgdLI3XNb9tiHCsZ2QnuTtcD1gDKZ+sYtoTf33mPEBGZlVl b6mRxsyE7Jlburxn/PYC3dzpuLXT6GEI+H7oudAoWoSgpehno2GsyjN5p+L3IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734037823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/H7koBHu0gb6Y1UcZ6LyTp6bvjUozgWe4QUUOZznboo=; b=tmDAsy5PCc1R07IFiuxiooE45HEdhFny813psvueyvEo1p2b7BjaZTl7y3sCvJtTJPRoXb KhHPieg7ZKctizKOetveIsMZj5+FyJetiu4hhl7PSznFGKNsqxU/ECwl8OyT4NCUhoFg2h na8q8BIDqVqq1opjnc6T9vB3R5xL+VxZ6Euj713Ay5lRlM65qOsSDcP82ZxHMcGXP3790y s4ApatLU7VEaC+KyV/LxVa6KRNpS7LRSnBtvYLw2Ol9SZnG/wSm6NHk81oQeNufksBiNPR oa3aa2piO4YyYCIFjGiIcUlfBg97CrHq3qciMYlxbv6rKXRGJ1Qa7w8xxSrNVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734037823; a=rsa-sha256; cv=none; b=qNwWxtEUiv+W3NzBMO9YMo71JvumNGHyWzPhZWaoFLYbjAb3xGvft2Z6NhFsZnYc2XKqaU laj2yiWXtVjTy7s74Xq6iBxEIwmEzJ946KS68AyMCWtBbPjGliN/1u+68wA889HEbbyrW9 pImOT/JadeOjbkWMb6myZXg6cihhHraEC/6cb1U9qfpzj33z4XizncCQDeDzbCcioZGVoy 8ktPVIcgP73gkyDUKaMDrUK223C+d+DE3Z0JL0YPt+ujmqV9kqWrsj5/2qPhVwp2BTBLeu GLcw/gOo0XziB1V0m+g1bf08yUt5VDP7fimd0g8E2xvdLuzveV+5iK0tkQoGjg== 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 4Y8Q9B0qjmz189b; Thu, 12 Dec 2024 21:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BCLALpf024117; Thu, 12 Dec 2024 21:10:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BCLALaw024114; Thu, 12 Dec 2024 21:10:21 GMT (envelope-from git) Date: Thu, 12 Dec 2024 21:10:21 GMT Message-Id: <202412122110.4BCLALaw024114@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: cc521bcf790b - stable/13 - mips/malta: Explicitly set AP entry point to _locore List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cc521bcf790bdcc76fddd619f35d0279f22e535a Auto-Submitted: auto-generated The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=cc521bcf790bdcc76fddd619f35d0279f22e535a commit cc521bcf790bdcc76fddd619f35d0279f22e535a Author: Jessica Clarke AuthorDate: 2024-12-12 21:07:14 +0000 Commit: Jessica Clarke CommitDate: 2024-12-12 21:07:14 +0000 mips/malta: Explicitly set AP entry point to _locore Otherwise we rely on the firmware implicitly ending up there without faulting. Perhaps the hardware this was tested on does so, but on QEMU this is not the case, as the AP will otherwise re-run bootloader code that tries to reconfigure PCI BARs and ends up faulting, so the AP is never seen by FreeBSD to have started. This matches Linux's arch/mips/kernel/smp-mt.c:vsmp_boot_secondary, which unconditionally writes to TCRestart (this register), albeit using a separate entry point, whilst ours is shared. This is a direct commit to stable/13 as mips no longer exists in main. Obtained from: CheriBSD (diagnosis; patch rewritten from scratch) --- sys/mips/malta/malta_mp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/mips/malta/malta_mp.c b/sys/mips/malta/malta_mp.c index 693c6b13248e..fe284501dffb 100644 --- a/sys/mips/malta/malta_mp.c +++ b/sys/mips/malta/malta_mp.c @@ -44,6 +44,9 @@ #include #include +void _locore(__register_t a0, __register_t a1, __register_t a2, + __register_t a3); + #define VPECONF0_VPA (1 << 0) #define MVPCONTROL_VPC (1 << 1) #define MVPCONF0_PVPE_SHIFT 10 @@ -235,11 +238,8 @@ platform_start_ap(int cpuid) set_thread_context(cpuid); - /* - * Hint: how to set entry point. - * reg = 0x80000000; - * mttc0(2, 3, reg); - */ + /* Set entry point */ + mttc0(2, 3, (register_t)&_locore); /* Enable thread */ reg = mftc0(2, 1);