From nobody Mon Sep 30 12:23:38 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 4XHKx63ZRKz5YDHP; Mon, 30 Sep 2024 12:23:38 +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 4XHKx62B2Xz4Ls9; Mon, 30 Sep 2024 12:23:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727699018; 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=fYhiDDcyDu7HkrbuXSVG0B8veK7Tbznc5pRdBE++aEA=; b=ENq7pshurJ+BuM9P+ZMUqUSkZuKhkxcWPtvIzbyjypDLrwkvkpAdOPEaQospLUxtBrXrf2 sht/Y/ti+e/2/0lD8Sw87ffZ2W8plARCdnMuv77gVGXk3MhoHzfzedKmMyEaemG2+JgORU ZHuXtEDkDEW90eslyoWUtpkECJhO2hvDLaLz8wnsD8MTV0G8TS9/yKnItdB64pIyGF7iEG xvZeNUOeJl6OSI2yvDaBZLm8zYPGrt0rK6fk7bMy+R3Qw3rrovnjO6VYyX2khCKuSQFfPa 5Z5V63pMAsW2NdxGUk1XraIXn02BL7plTwgcS8HwWLd3YzdADzjuRVTAQR6ACg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727699018; 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=fYhiDDcyDu7HkrbuXSVG0B8veK7Tbznc5pRdBE++aEA=; b=TQWz4yJPf5g2ROynwvRKLN9mJi/3H8kDc5JuASvi8cf+IqcnoJpfFyrYdQfYxv5TY6amUH KZZ893ogD1HxnBteLkjWh1dyfP2opTTvBgQKz7wNN7wnCNJPZ42Xn+WVi8+Z0CFgbWZCuB EFKieUsaFKakAAO1nAzOJNekvrHXsOU0id601lPWa1uex+ejt89PtcYuJlQMjCfNDRp8J+ tS4fAzdY7dBfoRYrIz2TB8hrJczOJa5abh67Xy65FzXO8YXsCl8VlqL56GsI0vqHygl87F APjiLq7YVW6NwO3I4JQN14DlP0YUPj/Q5Qyr+qRwsP/lBqbUEmciruo9KW0LoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727699018; a=rsa-sha256; cv=none; b=npER8E6xeCSS7PAP/DGgVDfm7IqvrUo5Xa0X4kMlnkOrceH+Js9yVx0+vVL705+XLQMy+M 9GH5fV/yTcZ/9LCkAOJA31dSGL8Qowiqhy3W0mkakeAeAdq++b152xTqxl0F7oglSIuKB1 G0ZRuBQDaTsfKvG6GsIM73nU7l0dUjSFh3HnxtBh9jQ+P7HRWW9vWFewVHFoUbHju5oQua OCMH17G3/aMtGMuaFDjJReClR36kOXH1tOLQlUBeXZ+ek6sZ7HCQqWB1LS7R8hWLQ0WGFx 0Ta+imXKzp7/93NGFUOS/7xTLHZKMkkQN5Ryf53TH4lEuyrEwSyCd7NIGYj20g== 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 4XHKx61p6VzsCD; Mon, 30 Sep 2024 12:23:38 +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 48UCNcxa070960; Mon, 30 Sep 2024 12:23:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48UCNcJM070957; Mon, 30 Sep 2024 12:23:38 GMT (envelope-from git) Date: Mon, 30 Sep 2024 12:23:38 GMT Message-Id: <202409301223.48UCNcJM070957@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: 87a58d931db7 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 87a58d931db7b40d8d225a7edb82b78937078b7f Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=87a58d931db7b40d8d225a7edb82b78937078b7f commit 87a58d931db7b40d8d225a7edb82b78937078b7f Author: Andrew Turner AuthorDate: 2024-09-27 13:37:10 +0000 Commit: Andrew Turner CommitDate: 2024-09-30 12:04:23 +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 --- sys/arm64/arm64/sys_machdep.c | 13 +++++++++++++ sys/arm64/include/sysarch.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/sys/arm64/arm64/sys_machdep.c b/sys/arm64/arm64/sys_machdep.c index eedc57f7c572..81b8ef73d9c0 100644 --- a/sys/arm64/arm64/sys_machdep.c +++ b/sys/arm64/arm64/sys_machdep.c @@ -28,6 +28,7 @@ */ #include +#include #include #include #include @@ -36,14 +37,19 @@ #include #include +#include #include #include +#include + int sysarch(struct thread *td, struct sysarch_args *uap) { struct arm64_guard_page_args gp_args; + struct pcb *pcb; vm_offset_t eva; + unsigned long sve_len; int error; switch (uap->op) { @@ -73,6 +79,13 @@ sysarch(struct thread *td, struct sysarch_args *uap) error = pmap_bti_set(vmspace_pmap(td->td_proc->p_vmspace), trunc_page(gp_args.addr), round_page(eva)); break; + 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; diff --git a/sys/arm64/include/sysarch.h b/sys/arm64/include/sysarch.h index 83094943423a..b7846651c031 100644 --- a/sys/arm64/include/sysarch.h +++ b/sys/arm64/include/sysarch.h @@ -46,6 +46,9 @@ struct arm64_guard_page_args { __size_t len; }; +#define ARM64_GET_SVE_VL 0x200 +/* Reserved ARM64_SET_SVE_VL 0x201 */ + #ifndef _KERNEL __BEGIN_DECLS