History

arm64/sve: Add prctl controls for userspace vector length management

This patch adds two arm64-specific prctls, to permit userspace to control its vector length: * PR_SVE_SET_VL: set the thread's SVE vector length and vector length inheritance mode. * PR_SVE_GET_VL: get the same information. Although these prctls resemble instruction set features in the SVE architecture, they provide additional control: the vector length inheritance mode is Linux-specific and nothing to do with the architecture, and the architecture does not permit EL0 to set its own vector length directly. Both can be used in portable tools without requiring the use of SVE instructions.

Dave Martin committed 9 years ago

Commit 2d2123b1 parent 43d4da25 files · +84 −0Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/prctl.h+4−0
@@ -198,7 +198,11 @@ struct prctl_mm_map { · 197 unmodified lines
198198 # define PR_CAP_AMBIENT_CLEAR_ALL 4
199199
200200 /* arm64 Scalable Vector Extension controls */
201+/* Flag values must be kept in sync with ptrace NT_ARM_SVE interface */
202+#define PR_SVE_SET_VL 50 /* set task vector length */
201203 # define PR_SVE_SET_VL_ONEXEC (1 << 18) /* defer effect until exec */
204+#define PR_SVE_GET_VL 51 /* get task vector length */
205+/* Bits common to PR_SVE_SET_VL and PR_SVE_GET_VL */
202206 # define PR_SVE_VL_LEN_MASK 0xffff
203207 # define PR_SVE_VL_INHERIT (1 << 17) /* inherit across exec */
204208

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t