Commit graph

128 commits

Author SHA1 Message Date
Jason White
f467cfa03c Add vdso patches for aarch64
Summary: This adds VDSO stubs for aarch64 so that we can intercept VDSO calls. See the comments in the code for more details.

Reviewed By: VladimirMakaev

Differential Revision: D40867428

fbshipit-source-id: 136818d9dbf52f4297dd4dae041e3e6dfe0764ae
2022-11-01 10:11:35 -07:00
David Tolnay
a3ed18f93a Update libc to 0.2.137
Summary: Update from 0.2.135 to 0.2.137, the latest version on crates.io, in preparation for backporting a PR in the diff after this one.

Reviewed By: zertosh

Differential Revision: D40874274

fbshipit-source-id: debf9dae82ecc20201470e634f10904a2b308e51
2022-11-01 02:16:19 -07:00
Jason White
ada1e3c542 Get tests building under aarch64
Reviewed By: VladimirMakaev

Differential Revision: D40701839

fbshipit-source-id: e60053c7d21696e7f7dd120420b896dee3d65ba7
2022-10-27 10:56:09 -07:00
Jason White
21f7f9a8a6 Fix rustc warnings
Reviewed By: VladimirMakaev

Differential Revision: D40701835

fbshipit-source-id: d74560c4c6b360f89ff6b8d37bc33890bf633947
2022-10-27 10:56:09 -07:00
Jason White
a16d576831 Fix perf timer related things on aarch64
Summary: To do proper feature detection on the CPU to know if we can get perf events, there is more work to do here. See the comment on `get_rcb_perf_config` for more info.

Reviewed By: VladimirMakaev

Differential Revision: D40701837

fbshipit-source-id: 4c7a7c00be0ab14e4fe9f4be09c8094567d5d031
2022-10-27 10:56:09 -07:00
Jason White
caf0f12131 Add generalized stack pointer access
Reviewed By: VladimirMakaev

Differential Revision: D40701834

fbshipit-source-id: 6cad4cedc0d22488117d3d991ae9a80b643ee037
2022-10-27 10:56:09 -07:00
Jason White
4f9ce11c70 Add aarch64 registers to gdbstub
Reviewed By: VladimirMakaev

Differential Revision: D40701836

fbshipit-source-id: 42c47be166d892bc208b68938d4c41746857b38c
2022-10-27 10:56:09 -07:00
Jason White
f200e9a8cf Rename Amd64CoreRegs -> CoreRegs
Summary: This is a more architecture-independent name.

Reviewed By: VladimirMakaev

Differential Revision: D40701833

fbshipit-source-id: 66b77c6f62886ecd776a3efbc0b71248f875914e
2022-10-27 10:56:09 -07:00
Jason White
4b8517a067 Move gdbstub regs definitions to arch-specific file
Summary: These definitions are x86_64-specific, so they should be defined in their own file. Later, we'll add definitions for aarch64.

Reviewed By: VladimirMakaev

Differential Revision: D40701840

fbshipit-source-id: 0c52334dc7eb9bb60020c45c3f2ef58077c20322
2022-10-27 10:56:09 -07:00
Jason White
e5fa5f367c Clean up gdbstub regs definitions
Reviewed By: VladimirMakaev

Differential Revision: D40701832

fbshipit-source-id: 8d5c95c624ae28313cecad3522078ccde4b4d75d
2022-10-27 10:56:09 -07:00
Jason White
5949b4023f Fix more things for aarch64
Summary: fixallthethings

Reviewed By: VladimirMakaev

Differential Revision: D40577286

fbshipit-source-id: 0fb2d83843886be12c46ec199ab0303d2087597d
2022-10-27 10:56:09 -07:00
Vladimir Makaev
03cbd6044d update hermetic_infra/** files with correct license header - 1/x
Summary:
Followed guide here https://www.internalfb.com/intern/wiki/Linting/License_Lint/ to add fbcode/hermetic_infra/** code to license linter. As we have parts of our code shipped as Open Source it's important to get this automated

This diff is updating existing file's licenses to not get conflict after lint rule enablement

Reviewed By: jasonwhite

Differential Revision: D40674080

fbshipit-source-id: da6ecac036f8964619cf7912058f3a911558e7b1
2022-10-26 12:18:14 -07:00
Jason White
8862833da4 Replace direct register accesses with abstraction
Reviewed By: wangbj

Differential Revision: D40577287

fbshipit-source-id: 8fe94d172ffb0f1d7c2e177ec6314b1b77f4e5c1
2022-10-21 12:09:36 -07:00
Jason White
6ad5309bb1 Add abstraction over register access
Summary:
This abstracts the set of general purpose registers so that we can more easily access special registers in an architecture-independent way.

The rest of the code will be refactored to use this new interface in a later change.

Reviewed By: wangbj

Differential Revision: D40577289

fbshipit-source-id: 313a3ab3863f09a506b6e61fb67093fc49eeae3e
2022-10-21 12:09:36 -07:00
Jason White
6e36d021a3 Add aarch64 support to safeptrace
Summary: Adds aarch64 support to the safeptrace crate.

Reviewed By: wangbj

Differential Revision: D40577290

fbshipit-source-id: e7748e00a3d37d13a576e33865a4b97917cb661d
2022-10-21 12:09:36 -07:00
Jason White
5049415db6 Get main reverie crate compiling on aarch64
Reviewed By: wangbj

Differential Revision: D40577288

fbshipit-source-id: 0cf76ef1fdae1a5bcd0aaf046ec59ed7b7478d91
2022-10-21 12:09:36 -07:00
David Tolnay
eb92a00594 Update to async-trait 0.1.58
Summary: This release makes async trait methods work better with rust-analyzer's "go to definition" and other IDE functionality.

Reviewed By: zertosh

Differential Revision: D40532047

fbshipit-source-id: 1871d1819ebe1aab0846b0135f051c45e6e8821b
2022-10-19 17:35:20 -07:00
Jason White
adc75712a7 Add FICLONE and FICLONERANGE ioctls
Reviewed By: igorsugak

Differential Revision: D40521846

fbshipit-source-id: 25ec8d85ee0fc3c4df07637c9623505460a6670b
2022-10-19 13:37:38 -07:00
Ryan Newton
4b910a9e2b bump the SKID_MARGIN from 50 to 60
Summary:
On devvm5443.atn0.facebook.com (Intel Xeon Processor (Skylake)), I observed a slippage a bit past the skid of 50:

    ✉ Timeout: hermetic_infra/hermit/tests:hermit_run_strict__sh_par_work - main (300.011)
    Test output:
    > from_execution_error::timeout::LocalExecutor::Timeout
    :: Run1...
    thread 'main' panicked at 'Clock perf counter exceeds target value at start of attempted single-step: 23417931 > 23417927. Consider increasing SKID_MARGIN_RCBS.', hermetic_infra/reverie/reverie-ptrace/src/timer.rs:562:9

Therefore I'm bumping it to 60.

This is unfortunate, because it directly slows down our chaos mode preemptions (until we eventually get an emulator), but I'm therefore bumping the skid margin.
We could also potentially set it differently for devvm and for bare metal.

Reviewed By: jasonwhite

Differential Revision: D40383171

fbshipit-source-id: 34bb8217a61fc2c77f1d45d23b8c28f91cae5efc
2022-10-18 12:27:28 -07:00
Nofel Yaseen
79de15c108 Enable aarch64 build
Summary: Get reverie-syscalls building on aarch64

Reviewed By: jasonwhite

Differential Revision: D40323777

fbshipit-source-id: bc7a326dc06deb2247a4b2a8f784b05745e961b7
2022-10-17 12:28:12 -07:00
Andrey Buchinskiy
a24e92eea4 bump tokio version to 1.21.2
Reviewed By: zertosh

Differential Revision: D40199323

fbshipit-source-id: 32355e73ea669a180ac759ddb02760db10c8b02b
2022-10-14 15:24:20 -07:00
Jeremy Fitzhardinge
f1336c3b2e third-party/rust: bump tracing-subscriber and tracing-glog
Summary:
tracing-glog -> 0.2.1 with minor formatting bugfix
tracing-subscriber -> 0.3.16 mostly to keep it fresh and share dependencies

Reviewed By: davidbarsky

Differential Revision: D40350661

fbshipit-source-id: e62ec53747a194da0a9b0ca2b63bb16df2479a6f
2022-10-14 13:32:47 -07:00
Sargun Dhillon
fa682caf9b Update Rust libc crate to 0.2.135
Summary: This updates the libc crate to 0.2.135, which includes the FICLONE constant needed to the given ioctl.

Reviewed By: justintrudell

Differential Revision: D40286796

fbshipit-source-id: acfa115479cd289f478d8d73937be34ced5c4bbb
2022-10-13 18:51:18 -07:00
Jason White
c4bd924994 Propagate typed_syscall!{} attributes
Differential Revision: D40329620

fbshipit-source-id: 5088249785601329aee6609c4873d991bdaf38f3
2022-10-13 10:15:47 -07:00
Igor Makaruks
f43ccb1c5c Cleaned up duplicate help messages
Summary: Ran regex `#\[clap.*?help` to locate single line clap options with help messages and manually went through several multiline ones.

Reviewed By: jasonwhite

Differential Revision: D40297841

fbshipit-source-id: 108d9da70f9a3bd096167e41c287a4a959b10c17
2022-10-13 05:25:03 -07:00
Jason White
b973b4ad42 Propagate syscall_list!{} attributes
Differential Revision: D40323825

fbshipit-source-id: 78deea76931058ed8eeb44250a0168ef400fee8a
2022-10-12 16:34:18 -07:00
Jason White
38a3818c48 third-party/rust: Update syscalls v0.6.6 -> v0.6.7
Reviewed By: rrnewton

Differential Revision: D40312880

fbshipit-source-id: b6386d3821507787e7d76c86c1f63c265be86319
2022-10-12 14:29:02 -07:00
Jason White
19d2c786d1 third-party/rust: Enable "env" feature for clap
Reviewed By: zertosh

Differential Revision: D40156451

fbshipit-source-id: 4843099d10b7ca51467c24e849144955503240e3
2022-10-06 19:35:54 -07:00
Sophia Sun
aadb1865e7 Update nix crate from 0.23 to 0.25
Summary:
When I was trying to use `nix::unistd::gethostname` in D39783468, the version `0.23.0` will require users to pass in a `buf` as a parameter, however, in `0.25.0`, there is no need to pass in a `buf` as a parameter. Hence, I would love to update `nix` crate from `0.23` to `0.25` in order to not pass a redundant `buf` while calling `nix::unistd::gethostname`.

I fixed conflicts reflected from the signals manually so this diff is more than a few lines of code in `Cargo.toml`.

Here are the [changes](https://github.com/nix-rust/nix/compare/v0.23.0..v0.25.0) between `0.23` and `0.25`. See `CHANGELOG.md` for the most significant changes in this version.

Reviewed By: bgw

Differential Revision: D39919100

fbshipit-source-id: 7f62585ff72230bd2608aeb5a4780dc0128795f7
2022-10-03 15:31:17 -07:00
Vladimir Makaev
be457c2dc3 Migrate from structopt to clap3
Summary:
See rationale in the linked task
I was planning to build a new CLI and decided to follow CLI Foundation recommentation. Since hermit is effectively not released it's a good time to migrate now which hasn't been hard mostly followed the fastmods on the task and and some manual fixes of the remaining code

Reviewed By: jasonwhite

Differential Revision: D39953166

fbshipit-source-id: 6e917c6a8ea2ee8258e7e6068e9c9e787ebf0989
2022-10-03 12:18:55 -07:00
Andres Suarez
42214f8ec2 update to rust 1.64.0
Summary: https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html

Reviewed By: diliop, dtolnay

Differential Revision: D39825734

fbshipit-source-id: 4a789f2c24707fbc6a14b506448d405d5a60a53d
2022-09-27 15:18:58 -07:00
Paul Saab
90da155f18 Fix aarch64 build for fbcode//hermetic_infra/reverie:reverie-process
Summary: aarch64 is unsigned char so cast to libc::c_char

Reviewed By: dmm-fb

Differential Revision: D39802725

fbshipit-source-id: edaef4a14d88519abbd59bffa6ef6a74a0a96397
2022-09-25 10:32:37 -07:00
Andres Suarez
2364202dfc Update raw-cpuid-10.2.0 to raw-cpuid-10.6.0
Reviewed By: dtolnay

Differential Revision: D39622388

fbshipit-source-id: 10329e7037400986fd7c08a0d0dfbbd48332088a
2022-09-19 10:25:55 -07:00
Vladimir Makayev
de2fea408e Handle 'sysinfo' system call deterministically: use static values
Summary: Currently 'sysinfo' isn't being captured and determinized this might be a source of some divergencies in heap & stack. This diff with handle 'sysinfo' with hardcoded reasonable values. Follow up diffs with further enhance this

Reviewed By: rrnewton

Differential Revision: D39546772

fbshipit-source-id: a5a49e882a0fea4512bf991d257b0f8072f7f792
2022-09-18 18:49:13 -07:00
Andres Suarez
0f60462d16 Update libc-0.2.125 to libc-0.2.132
Reviewed By: dtolnay

Differential Revision: D39578353

fbshipit-source-id: 800721931e82485678e8ecf997afcc6711f6d4cf
2022-09-16 20:06:28 -07:00
David Tolnay
3deaf0e0c0 third-party/rust: Revert D39418421 "unpin thiserror"
Summary: D39418421 (8fef664fab) prematurely upgraded `thiserror`. Various projects in fbcode use nightly features including std::backtrace but the current fbcode Rust toolchain is 1.63.0, in which the backtrace API is different from the API of the latest nightlies.

Reviewed By: quark-zju

Differential Revision: D39562441

fbshipit-source-id: d1f8a993ec776cf82b1736b242bd4466def21230
2022-09-15 17:20:40 -07:00
Edwin Smith
8fef664fab unpin thiserror
Reviewed By: bolinfest, zertosh

Differential Revision: D39418421

fbshipit-source-id: 2f0246f190403a6f481e8803834174f229c0849a
2022-09-13 07:15:29 -07:00
Michael Bolin
c013909676 pin libc crate to 0.2.125
Reviewed By: ImanolBarba

Differential Revision: D39433159

fbshipit-source-id: 4442651a0874ebc6724796206db02c20e455a1c0
2022-09-12 09:55:50 -07:00
Michael Bolin
3c618d400d use git-config@0.7.1 instead of patched version
Reviewed By: mzr

Differential Revision: D39331880

fbshipit-source-id: 5990d68d718297a6df72e5eea3c16fed5b84169e
2022-09-09 21:01:16 -07:00
Jan Mazur
0a18bdf95f futures 0.3.21 -> 0.3.24
Summary: We have some deprecated functions in GH builds.

Differential Revision: D38909563

fbshipit-source-id: 3e8b77b10c352bfdfcbfe344f0ea2e95d4a339ad
2022-09-05 13:49:07 -07:00
Facebook Community Bot
2f6328ac8d
Re-sync with internal repository (#16)
Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com>
2022-09-01 12:34:47 -07:00
Jason White
6e18487a85 Remove dead code
Reviewed By: johnhurt

Differential Revision: D39036935

fbshipit-source-id: ca5febf045b279d421e2547e102c26e98d725d10
2022-08-29 12:25:19 -07:00
Jason White
89e2e8e431 Refactor trace module into its own crate
Reviewed By: johnhurt

Differential Revision: D36788853

fbshipit-source-id: 8a3765fb58d94188514ed1aba406a2dcd1e6551a
2022-08-26 09:27:58 -07:00
Charles Cady
120fbac957 Populate mmapped page trampoline with aarch64 instructions
Summary: This will help reverie-ptrace slowly migrate towards supporting `aarch64` as well as `x86_64`.

Reviewed By: jasonwhite

Differential Revision: D38787872

fbshipit-source-id: e747c59da8f0c59f0b85a50888c884dbbed65824
2022-08-19 01:37:10 -07:00
Jason White
357e7cac79 third-party/rust: Update syscalls crate v0.6.5 -> v0.6.6
Summary:
Updates the `syscalls` crate.

Changelog:
 - Added aarch64 support.

Reviewed By: psaab

Differential Revision: D38730424

fbshipit-source-id: fa7e0f65401a11c669058c5ffe280cce605ca017
2022-08-17 01:21:44 -07:00
Stiopa Koltsov
df4fca7482 rustfmt.toml: group_imports = StdExternalCrate
Summary:
To be landed when reformat changes land.

[Context](https://fb.workplace.com/groups/rust.language/posts/9143028552412345).

Reviewed By: zertosh

Differential Revision: D38485268

fbshipit-source-id: 2a193d675b60f67860fc437b0e2ee4982af8706f
2022-08-06 12:33:42 -07:00
Stiopa Koltsov
e53c5ef362 Apply rustfmt
Reviewed By: zertosh

Differential Revision: D38485027

fbshipit-source-id: 0f5e5b743e002045c95aca427b76e969d6bce347
2022-08-06 08:21:44 -07:00
Eddie Shen
0eaea9b139 Codemod away ::{self}; (#71)
Summary:
X-link: https://github.com/facebookresearch/Private-ID/pull/71

Previous codemod left some crust. This commit cleans up useless uses to use less uses.

Reviewed By: stepancheg

Differential Revision: D38211793

fbshipit-source-id: c852dd1ec617fe81a1d9bd0d8a9e5d2357b9b502
2022-08-01 10:56:01 -07:00
Andres Suarez
d9836f722e Remove unnecessary prelude imports
Reviewed By: dtolnay

Differential Revision: D38192955

fbshipit-source-id: 1c4cb1399e08d6688b28b2556c5cbac891a71c0b
2022-07-27 14:19:15 -07:00
Stiopa Koltsov
4192366432 Remove ::{self}
Summary: Cleanup after reformat one import per line.

Reviewed By: zertosh

Differential Revision: D38207167

fbshipit-source-id: e463575513a72583ea8d6359636e8eaeebb488e2
2022-07-27 09:53:37 -07:00