Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux prctl add speculation control flags #2838

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,19 @@ pub const PTRACE_PEEKSIGINFO_SHARED: ::c_uint = 1;
pub const PTRACE_SYSEMU: ::c_uint = 31;
pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32;

pub const PR_GET_SPECULATION_CTRL: ::c_int = 52;
pub const PR_SET_SPECULATION_CTRL: ::c_int = 53;
pub const PR_SPEC_NOT_AFFECTED: ::c_uint = 0;
pub const PR_SPEC_PRCTL: ::c_uint = 1 << 0;
pub const PR_SPEC_ENABLE: ::c_uint = 1 << 1;
pub const PR_SPEC_DISABLE: ::c_uint = 1 << 2;
pub const PR_SPEC_FORCE_DISABLE: ::c_uint = 1 << 3;
pub const PR_SPEC_DISABLE_NOEXEC: ::c_uint = 1 << 4;
pub const PR_SPEC_STORE_BYPASS: ::c_int = 0;
pub const PR_SPEC_INDIRECT_BRANCH: ::c_int = 1;
// FIXME: perharps for later
//pub const PR_SPEC_L1D_FLUSH: ::c_int = 2;

pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;

Expand Down