From owner-dev-commits-src-all@freebsd.org Fri Apr 16 13:52:44 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 5AD7A5D2851; Fri, 16 Apr 2021 13:52:44 +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 4FMHhr25Zpz4S8r; Fri, 16 Apr 2021 13:52:44 +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 3AE4725F9B; Fri, 16 Apr 2021 13:52:44 +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 13GDqiSp021961; Fri, 16 Apr 2021 13:52:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13GDqi7q021960; Fri, 16 Apr 2021 13:52:44 GMT (envelope-from git) Date: Fri, 16 Apr 2021 13:52:44 GMT Message-Id: <202104161352.13GDqi7q021960@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 17b0a38d96fe - stable/13 - arm64: clear debug register state on fork MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 17b0a38d96feb77d4b019ab9108b2c5050273823 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: Fri, 16 Apr 2021 13:52:44 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=17b0a38d96feb77d4b019ab9108b2c5050273823 commit 17b0a38d96feb77d4b019ab9108b2c5050273823 Author: Mitchell Horne AuthorDate: 2021-04-07 19:23:46 +0000 Commit: Mitchell Horne CommitDate: 2021-04-16 13:47:32 +0000 arm64: clear debug register state on fork Following the analogous change for amd64 and i386 in 8223717ce62c, ensure that new processes start with these registers inactive. PR: 254661 Reported by: Michał Górny Reviewed by: kib, emaste Sponsored by: The FreeBSD Foundation (cherry picked from commit 1fd001db9c330f133708f3c04c8852f8b07cfed9) --- sys/arm64/arm64/vm_machdep.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index ac2a47597a8c..b2ab8bb463b0 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -93,6 +93,9 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) td2->td_pcb = pcb2; bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); + /* Clear the debug register state. */ + bzero(&pcb2->pcb_dbg_regs, sizeof(pcb2->pcb_dbg_regs)); + tf = (struct trapframe *)STACKALIGN((struct trapframe *)pcb2 - 1); bcopy(td1->td_frame, tf, sizeof(*tf)); tf->tf_x[0] = 0;