From nobody Mon Oct 21 15:05:12 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 4XXJWr6ly0z5ZP24; Mon, 21 Oct 2024 15:05:12 +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 4XXJWr3Tm4z4fNH; Mon, 21 Oct 2024 15:05:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729523112; 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=ct16RH/8KacMemrXOgO07yiHrmg6vkbzgpc3TfBwQzU=; b=iEzDJYvcDFDY/jpsa6pUfmU1fB92IrrF5xYm6LjIMhu68xT4Z8jL7kcc37FfhttFw2EPZB VxVpKAEwQT2uPnyaSfrjSnDzyNJ7sYxGe/xzCidZe0a5OoK6rCTGf09dkQMYIiwXFLrGb2 THWBgeERTO3Z2mWgikZnfGLR3Ac7syLbr54zoa3yf60XLxMzphs90pihMwuzy5epwO0IfC pOrsMUAXaysLAJpp9wtBJm9M3EDtcyrz5GBTa+9rtxS3wPgp+QrvaO0IDaLv7ckCLVD6GF 8AuU5oMht6g9K56tV+Cq1jesrCll/1JRn8Xp5v9cYu6wVhXXm5KlaU875wLBSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729523112; 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=ct16RH/8KacMemrXOgO07yiHrmg6vkbzgpc3TfBwQzU=; b=jnvoJyy7VPng3YHJF8hTU9o6qQWs6HfaSD5fCxvaUkgr3CvHCvkzqGjFBKP65Rj+F8DQDP qZNEQYLw7U2q887UzGnWANVPD9HyQJbZrB8YgRUTPagzyUUhmFQstnjrb5uPQcy5xShKmi PoIdi6p1BPj/QcNkvqvqQUiRj5HcZDwxMYGyYQSddqsbkIUBHYioF8w89wWHVK52oYMjH9 ftJWBu7Od6u9X/9BfWS7NANGl9cV4YVcBdpwRLodNNw94lfUOC/XxLVYdp7+Ye59rJG1mT FdqZEVtl3B5u0GlIWG7/ZdnzuUXf2n/rnAxTYicZpNOGiAEtfrDUJWlNx53sQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729523112; a=rsa-sha256; cv=none; b=Id6G4hj8+55Z7oW3W0BNKxtBsxj/zss0k0DLsyIpRujC5grf1I8L9WsbBQDbYBifK1lLqI 2cOoz06heb+eWEGayobZWVHYQgEgZGv7+83T8ldA5DNyIKBB3drEFIcJnvbacy8njAnif0 lcDZicCjy+Tg8bOvTOINZD9uhvpG4rglpxZHih3itoIpbiWl0vwTeZHbRZEew3E3V6ZfI2 Jv2xgHjnUaNp0vIU+i01pgCSpUHSy8Fic/gDVZYQqmCOvNm2An7a/0G3YZiYS5UsKZZuyd MBD3wN2oIpMRuDRmzkKzAfrabB8+3Io1kuE3fAlacXTY7rpHRsopDCg6tmbEkA== 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 4XXJWr2RPVzZg0; Mon, 21 Oct 2024 15:05:12 +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 49LF5Cnc047035; Mon, 21 Oct 2024 15:05:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49LF5CQY047032; Mon, 21 Oct 2024 15:05:12 GMT (envelope-from git) Date: Mon, 21 Oct 2024 15:05:12 GMT Message-Id: <202410211505.49LF5CQY047032@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: aa594ddcc854 - stable/14 - arm64: Add an SVE sysarch 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aa594ddcc85459ed342694816df26434e96ba88a Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=aa594ddcc85459ed342694816df26434e96ba88a commit aa594ddcc85459ed342694816df26434e96ba88a Author: Andrew Turner AuthorDate: 2024-09-27 13:37:10 +0000 Commit: Andrew Turner CommitDate: 2024-10-21 15:03:26 +0000 arm64: Add an SVE sysarch To allow for user space to read the SVE vector length add a sysarch handler to return the value to userspace. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D43308 (cherry picked from commit 87a58d931db7b40d8d225a7edb82b78937078b7f) --- sys/arm64/arm64/sys_machdep.c | 22 +++++++++++++++++++++- sys/arm64/include/sysarch.h | 3 +++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/sys_machdep.c b/sys/arm64/arm64/sys_machdep.c index c50b745cfba0..aba864b9526e 100644 --- a/sys/arm64/arm64/sys_machdep.c +++ b/sys/arm64/arm64/sys_machdep.c @@ -29,14 +29,34 @@ #include #include +#include #include #include +#include #include +#include + int sysarch(struct thread *td, struct sysarch_args *uap) { + struct pcb *pcb; + unsigned long sve_len; + int error; + + switch (uap->op) { + case ARM64_GET_SVE_VL: + pcb = td->td_pcb; + sve_len = pcb->pcb_sve_len; + error = EINVAL; + if (sve_len != 0) + error = copyout(&sve_len, uap->parms, sizeof(sve_len)); + break; + default: + error = EINVAL; + break; + } - return (ENOTSUP); + return (error); } diff --git a/sys/arm64/include/sysarch.h b/sys/arm64/include/sysarch.h index 2bd45d384743..f72d3427602e 100644 --- a/sys/arm64/include/sysarch.h +++ b/sys/arm64/include/sysarch.h @@ -39,6 +39,9 @@ #ifndef _MACHINE_SYSARCH_H_ #define _MACHINE_SYSARCH_H_ +#define ARM64_GET_SVE_VL 0x200 +/* Reserved ARM64_SET_SVE_VL 0x201 */ + #ifndef _KERNEL __BEGIN_DECLS