From nobody Wed Jun 12 15:51:05 2024 X-Original-To: dev-commits-src-main@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 4VzqlG0sFcz5Mxlk; Wed, 12 Jun 2024 15:51:06 +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 4VzqlF5bQgz4YsT; Wed, 12 Jun 2024 15:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718207465; 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=M5iQbyXcI/ur+4ygYGe6W0/oBTCCLvEyVLaNXvvWmB4=; b=X2hz3gaiHkbEiwi9BOBOdaqdVwOuSwKCaqD2jD48niq9+DBilosQasvrQuqK92b/k2tWOj FvjVjwUE00HChuk0d5q2G4rW+tOcGkXELdWvwZ/gOQcUoG6q4wTOi9+cn7Lj6G7DE7t28V 89dQIPHF2rGyKjPTEUBq+T5JjFlT4PWx9No9lG2sG7VOfr4UTUE+WdhKLsW18jhwBWvvgp 4CNoor7Va4K9BYIrmf7CnfqiDQa3NV1eyhWOHmTylR+X6RRJ4F3FSQqEtPhwzfHq4qwjS7 mwF3OFUu4D814cW6dgNDenO8UFDCL5lf5TQA6yB+n+7vlf8t+7gusbi7lciTYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718207465; a=rsa-sha256; cv=none; b=jkhyu1MAKXYv11PvneRJcxVQiOxRalCLYYxycfXBrP+f9is3wDfeDzOwuXtepPuKataV4y N4v2ClJ4DSZIcGLG1yCUBf9iOhXMm/1V4byker23Z0gClN8ODT4Ky8UjB5yTerrfe0lyPF MTlCZNCb5sUmcO7bnjvRevKB4jBHKeqIH4VchwDGKEp4OH5NUfIap6NvCXzhKEmt2Iwt0e cOvWPOqgYbgfMR2TFAZM+2hQ2KCOKM/m/AnB63KmQD1XeO25Ey3XYTcd668WwaOcGPPzDJ WVio5Ivap2d9joP+y2xOyDyGw41RByszJnbSk1l9zBVexxwUtMrpUaU+CUZjCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718207465; 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=M5iQbyXcI/ur+4ygYGe6W0/oBTCCLvEyVLaNXvvWmB4=; b=t6T06iRpCNNYsheuGMj8wZzmZHthkFcjI7RTwwfaY6G3BFqxYJUniWoficsOWapJhleGwC 5OPOR2JnN/vxtHpO/0dsJcSfNuW+CIhmOPJcAE4SWJsav/BKN98eIUZENb+TZCiqvev7cT UTxGNu6ydUZCOYdjrEv7919Li0L7QDQRC2gF0R952vTwvMo4B4RLMJeQrnFgUceVH3XqBS GO/rnJQgWDYkWjxGDFNszx0JXUyXpuJXfVVO76qvN6WRj8vSuLDQrMAkpJbM4+o1G0VkUt 4SblF+3DCiQQmsqLzLVP5QXxL+GSsNXldzkTcyUy+jEakmkMHWVQKuA78CTjyQ== 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 4VzqlF59cCzyYf; Wed, 12 Jun 2024 15:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45CFp5nG057576; Wed, 12 Jun 2024 15:51:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45CFp5Ta057573; Wed, 12 Jun 2024 15:51:05 GMT (envelope-from git) Date: Wed, 12 Jun 2024 15:51:05 GMT Message-Id: <202406121551.45CFp5Ta057573@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: a30149b2a9c6 - main - arm64: Create a version of vfp_save_state for cpu_switch List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a30149b2a9c6ac5280523eea9570e5b5e5f1fdf8 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a30149b2a9c6ac5280523eea9570e5b5e5f1fdf8 commit a30149b2a9c6ac5280523eea9570e5b5e5f1fdf8 Author: Andrew Turner AuthorDate: 2024-06-12 13:09:14 +0000 Commit: Andrew Turner CommitDate: 2024-06-12 13:09:14 +0000 arm64: Create a version of vfp_save_state for cpu_switch This will be used when we add SVE support to reduce the registers needed to be saved on context switch. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D43305 --- sys/arm64/arm64/swtch.S | 4 +--- sys/arm64/arm64/vfp.c | 8 ++++++++ sys/arm64/include/vfp.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/swtch.S b/sys/arm64/arm64/swtch.S index ca00d473fd47..6af70ca839a0 100644 --- a/sys/arm64/arm64/swtch.S +++ b/sys/arm64/arm64/swtch.S @@ -148,9 +148,7 @@ ENTRY(cpu_switch) mov x21, x2 #ifdef VFP - /* Load the pcb address */ - mov x1, x4 - bl vfp_save_state + bl vfp_save_state_switch mov x0, x20 #else mov x0, x1 diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c index f35cd960702b..c65108a83399 100644 --- a/sys/arm64/arm64/vfp.c +++ b/sys/arm64/arm64/vfp.c @@ -216,6 +216,14 @@ vfp_save_state_savectx(struct pcb *pcb) vfp_save_state_common(curthread, pcb); } +void +vfp_save_state_switch(struct thread *td) +{ + KASSERT(td != NULL, ("NULL vfp thread")); + + vfp_save_state_common(td, td->td_pcb); +} + /* * Update the VFP state for a forked process or new thread. The PCB will * have been copied from the old thread. diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h index 7f4c86e7737d..47d068d6050c 100644 --- a/sys/arm64/include/vfp.h +++ b/sys/arm64/include/vfp.h @@ -79,6 +79,7 @@ void vfp_reset_state(struct thread *, struct pcb *); void vfp_restore_state(void); void vfp_save_state(struct thread *, struct pcb *); void vfp_save_state_savectx(struct pcb *); +void vfp_save_state_switch(struct thread *); struct fpu_kern_ctx;