Commit 398d0eb
authored
cpufeatures: add Speculation Barrier (SB) support for AArch64 (#1536)
As suggested in #1472, this instruction is needed by the `aarch64-dit`
crate to properly implement Data-Independent Timing:
https://support.arm.com/documentation/ddi0487/mb/-Part-B-The-AArch64-Application-Level-Architecture/-Chapter-B2-The-AArch64-Application-Level-Memory-Model/-B2-6-Memory-barriers/-B2-6-3-Speculation-Barrier
The usage on Apple targets is covered here:
https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Enable-DIT-for-constant-time-cryptographic-operations
> "To ensure that subsequent instruction timing reflects the updated DIT
> processor state, add a speculation barrier after turning on DIT.
> Use the sb instruction to add a speculation barrier"
This PR is effectively an extraction of the `cpufeatures`-related
changes originally suggested in this patch from #1472:
f31f41c1 parent 98d49ed commit 398d0eb
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
| |||
0 commit comments