From nobody Mon Oct 21 15:05:08 2024 X-Original-To: dev-commits-src-branches@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 4XXJWn1cgyz5ZNbv; Mon, 21 Oct 2024 15:05:09 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XXJWn0Qbrz4fSc; Mon, 21 Oct 2024 15:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729523109; 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=b6FFuIiOSOQWlPpvh6gU3koZDiQC3nJCpSqKE9SV/2g=; b=JROOTpvDXOGqTJeAnXKzGFg6qzGYzCkILwwCEtPaCT9WafOrA0BwuvZSaNXX9DQg26v4X+ J7GnrRj9/DlRp8kC5fI6G2hENRHS6jAP4oKDprwtC9yKP0GhW4kmvssvsRTz2I0aXNwV6A JyYut9GU7nH42aZN+suL6OM/tIsBBYxaRme6BZBzj0XwAtA736gacnA7nvt7OfXTL1+3Xh 1BpFQrOEXX0OpleLIVkdR3T9uGIgCTB0YdYP7wecf5jQyOLk1T3Du430cvBMdeArAlxNVx BHYu+zvuGlHFNUZFPHcu0FZ7xBMbn4xBfeGR+0pvOpQY4Vfl64PKPF+FdCRQ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729523109; 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=b6FFuIiOSOQWlPpvh6gU3koZDiQC3nJCpSqKE9SV/2g=; b=xJizbtThzG3GBgy5rJ5mVSz7uqWnHT+5zVVRVm4g1DYI9WTmF1pvp79KvOGoq4yWSNvAou l0YU+kZwCFyUe85CEiBtyLwAiNq1Ltje0SYO4aoEaIftjyuCozjPuGLFuZw9Ki/UHZUgAZ 3v1eh3YxI72Fs0rTPMdrpqfc/LV45PmqflRfHaO9JcHNwGTq3hJ9cIcTKbpLd1Ols2vS1h +ZASL+iV/d2RZDrXLw0DlA152BClh3z4bertU9c9ONWx7pmeddr3TODeiCyT+8jccthEae 2d6adwg9YhkRVpKc7ElW68EQLCGMcxPzcSxBsDi2VR3RSgDO4iv9zF20XNsWeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729523109; a=rsa-sha256; cv=none; b=Z9kKEdb/C1xgCHEVjS1GrwsISTV3p9i2q+fqMQ6WvDG3FvVMnv09qWhWOkeFAa0LxUy78V EpaNJ/drv6HfdoSaqme9TwgPKBb2GTJcmcB5Pu6uEqOs4jK4vOyBzjZ1Uwytmaw0Y+CGvd EycjdjV+AwMoZ2siCMHVkOTnX6X03b9jEg/IoS1iNA1MYOX60AlcxQ8P8uh0KgmFPXFJqs e8lQsRtwDrkuA2Y6n5Yoo8MMMY8K+XJoyvOQVXUg7B8jhJ9UZmVpWdnKXUxelBVKu6Idoi fpUWhDNFMxZk/hCirVbWB52v8LWZYymGidGb3jKsODbWh6589aFSnyiq/xlfNA== 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 4XXJWm739dzbQl; Mon, 21 Oct 2024 15:05:08 +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 49LF580J046868; Mon, 21 Oct 2024 15:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49LF58n8046865; Mon, 21 Oct 2024 15:05:08 GMT (envelope-from git) Date: Mon, 21 Oct 2024 15:05:08 GMT Message-Id: <202410211505.49LF58n8046865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 3f2ed1883896 - stable/14 - arm64: Create a version of vfp_save_state for cpu_switch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 3f2ed1883896651e51a98060f34808457d24f679 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3f2ed1883896651e51a98060f34808457d24f679 commit 3f2ed1883896651e51a98060f34808457d24f679 Author: Andrew Turner AuthorDate: 2024-06-12 13:09:14 +0000 Commit: Andrew Turner CommitDate: 2024-10-21 15:03:26 +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 (cherry picked from commit a30149b2a9c6ac5280523eea9570e5b5e5f1fdf8) --- 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 9c43de3a9eae..882bfd7cf05a 100644 --- a/sys/arm64/arm64/swtch.S +++ b/sys/arm64/arm64/swtch.S @@ -146,9 +146,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;