mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
This is a subset of the Rust `zerocopy` crate, version v0.8.50 (released
2026-05-31), licensed under "BSD-2-Clause OR Apache-2.0 OR MIT", from:
https://github.com/google/zerocopy/tree/v0.8.50
The files are copied as-is, with no modifications whatsoever (not even
adding the SPDX identifiers).
The `benches` folder is added (i.e. not just `src` like in other cases)
since the files there are included in the rendered documentation,
as well as the `rustdoc` CSS style file that is needed to make those
visually more understandable.
For copyright details, please see:
https://github.com/google/zerocopy/blob/v0.8.50/README.md?plain=1
https://github.com/google/zerocopy/blob/v0.8.50/LICENSE-BSD
https://github.com/google/zerocopy/blob/v0.8.50/LICENSE-APACHE
https://github.com/google/zerocopy/blob/v0.8.50/LICENSE-MIT
The next two patches modify these files as needed for use within the
kernel. This patch split allows reviewers to double-check the import
and to clearly see the differences introduced.
The following script may be used to verify the contents:
for path in $(cd rust/zerocopy/ && find . -type f); do
curl --silent --show-error --location \
https://github.com/google/zerocopy/raw/v0.8.50/$path \
| diff --unified rust/zerocopy/$path - && echo $path: OK
done
Cc: Joshua Liebow-Feeser <joshlf@google.com>
Cc: Jack Wrenn <jswrenn@google.com>
Link: https://patch.msgid.link/20260608141439.182634-9-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
114 lines
5.6 KiB
Plaintext
114 lines
5.6 KiB
Plaintext
Iterations: 100
|
|
Instructions: 3700
|
|
Total Cycles: 3486
|
|
Total uOps: 4600
|
|
|
|
Dispatch Width: 4
|
|
uOps Per Cycle: 1.32
|
|
IPC: 1.06
|
|
Block RThroughput: 12.0
|
|
|
|
|
|
Instruction Info:
|
|
[1]: #uOps
|
|
[2]: Latency
|
|
[3]: RThroughput
|
|
[4]: MayLoad
|
|
[5]: MayStore
|
|
[6]: HasSideEffects (U)
|
|
|
|
[1] [2] [3] [4] [5] [6] Instructions:
|
|
1 1 0.33 mov rax, rdi
|
|
1 1 0.33 movabs rcx, 1537228672809129301
|
|
1 1 0.33 cmp rsi, rcx
|
|
1 1 1.00 ja .LBB5_5
|
|
1 1 0.33 test rsi, rsi
|
|
1 1 1.00 je .LBB5_2
|
|
2 5 1.00 * push r15
|
|
2 5 1.00 * push r14
|
|
2 5 1.00 * push rbx
|
|
1 1 0.50 lea rcx, [rsi + rsi]
|
|
1 1 0.50 lea rbx, [rcx + 2*rcx]
|
|
1 1 0.33 mov r14, rax
|
|
1 1 0.33 mov r15, rsi
|
|
4 7 1.00 * call qword ptr [rip + __rustc::__rust_no_alloc_shim_is_unstable_v2@GOTPCREL]
|
|
1 1 0.33 mov esi, 2
|
|
1 1 0.33 mov rdi, rbx
|
|
4 7 1.00 * call qword ptr [rip + __rustc::__rust_alloc_zeroed@GOTPCREL]
|
|
1 1 0.33 mov rsi, r15
|
|
1 1 0.33 mov rcx, rax
|
|
1 1 0.33 mov rax, r14
|
|
1 1 0.33 test rcx, rcx
|
|
1 6 0.50 * pop rbx
|
|
1 6 0.50 * pop r14
|
|
1 6 0.50 * pop r15
|
|
1 1 1.00 je .LBB5_5
|
|
1 1 1.00 * mov qword ptr [rax], rsi
|
|
1 1 1.00 * mov qword ptr [rax + 8], rcx
|
|
1 1 1.00 * mov qword ptr [rax + 16], rsi
|
|
1 1 1.00 U ret
|
|
1 1 0.33 movabs rcx, -9223372036854775808
|
|
1 1 1.00 * mov qword ptr [rax], rcx
|
|
1 1 1.00 U ret
|
|
1 1 0.33 mov ecx, 2
|
|
1 1 1.00 * mov qword ptr [rax], rsi
|
|
1 1 1.00 * mov qword ptr [rax + 8], rcx
|
|
1 1 1.00 * mov qword ptr [rax + 16], rsi
|
|
1 1 1.00 U ret
|
|
|
|
|
|
Resources:
|
|
[0] - SBDivider
|
|
[1] - SBFPDivider
|
|
[2] - SBPort0
|
|
[3] - SBPort1
|
|
[4] - SBPort4
|
|
[5] - SBPort5
|
|
[6.0] - SBPort23
|
|
[6.1] - SBPort23
|
|
|
|
|
|
Resource pressure per iteration:
|
|
[0] [1] [2] [3] [4] [5] [6.0] [6.1]
|
|
- - 6.99 6.99 12.00 10.02 8.00 9.00
|
|
|
|
Resource pressure by instruction:
|
|
[0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions:
|
|
- - 0.01 0.98 - 0.01 - - mov rax, rdi
|
|
- - 0.98 0.02 - - - - movabs rcx, 1537228672809129301
|
|
- - 0.02 0.98 - - - - cmp rsi, rcx
|
|
- - - - - 1.00 - - ja .LBB5_5
|
|
- - 0.98 - - 0.02 - - test rsi, rsi
|
|
- - - - - 1.00 - - je .LBB5_2
|
|
- - - - 1.00 - - 1.00 push r15
|
|
- - - - 1.00 - 1.00 - push r14
|
|
- - - - 1.00 - - 1.00 push rbx
|
|
- - - 1.00 - - - - lea rcx, [rsi + rsi]
|
|
- - - 1.00 - - - - lea rbx, [rcx + 2*rcx]
|
|
- - 1.00 - - - - - mov r14, rax
|
|
- - 1.00 - - - - - mov r15, rsi
|
|
- - - - 1.00 1.00 2.00 - call qword ptr [rip + __rustc::__rust_no_alloc_shim_is_unstable_v2@GOTPCREL]
|
|
- - - 0.01 - 0.99 - - mov esi, 2
|
|
- - 0.01 0.99 - - - - mov rdi, rbx
|
|
- - - - 1.00 1.00 - 2.00 call qword ptr [rip + __rustc::__rust_alloc_zeroed@GOTPCREL]
|
|
- - 0.01 - - 0.99 - - mov rsi, r15
|
|
- - 0.99 0.01 - - - - mov rcx, rax
|
|
- - - 0.99 - 0.01 - - mov rax, r14
|
|
- - 0.99 0.01 - - - - test rcx, rcx
|
|
- - - - - - - 1.00 pop rbx
|
|
- - - - - - 1.00 - pop r14
|
|
- - - - - - - 1.00 pop r15
|
|
- - - - - 1.00 - - je .LBB5_5
|
|
- - - - 1.00 - 1.00 - mov qword ptr [rax], rsi
|
|
- - - - 1.00 - - 1.00 mov qword ptr [rax + 8], rcx
|
|
- - - - 1.00 - 1.00 - mov qword ptr [rax + 16], rsi
|
|
- - - - - 1.00 - - ret
|
|
- - 0.01 0.99 - - - - movabs rcx, -9223372036854775808
|
|
- - - - 1.00 - - 1.00 mov qword ptr [rax], rcx
|
|
- - - - - 1.00 - - ret
|
|
- - 0.99 0.01 - - - - mov ecx, 2
|
|
- - - - 1.00 - 1.00 - mov qword ptr [rax], rsi
|
|
- - - - 1.00 - - 1.00 mov qword ptr [rax + 8], rcx
|
|
- - - - 1.00 - 1.00 - mov qword ptr [rax + 16], rsi
|
|
- - - - - 1.00 - - ret
|