<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Target/ARM/ARMSLSHardening.cpp, branch users/nico/python-2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[aarch64][win] Update Called Globals info when updating Call Site info (#122762)</title>
<updated>2025-01-13T22:00:31+00:00</updated>
<author>
<name>Daniel Paoliello</name>
<email>danpao@microsoft.com</email>
</author>
<published>2025-01-13T22:00:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=19032bfe87fa0f4a3a7b3e68daafc93331b71e0d'/>
<id>19032bfe87fa0f4a3a7b3e68daafc93331b71e0d</id>
<content type='text'>
Fixes the "use after poison" issue introduced by #121516 (see
&lt;https://github.com/llvm/llvm-project/pull/121516#issuecomment-2585912395&gt;).

The root cause of this issue is that #121516 introduced "Called Global"
information for call instructions modeling how "Call Site" info is
stored in the machine function, HOWEVER it didn't copy the
copy/move/erase operations for call site information.

The fix is to rename and update the existing copy/move/erase functions
so they also take care of Called Global info.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes the "use after poison" issue introduced by #121516 (see
&lt;https://github.com/llvm/llvm-project/pull/121516#issuecomment-2585912395&gt;).

The root cause of this issue is that #121516 introduced "Called Global"
information for call instructions modeling how "Call Site" info is
stored in the machine function, HOWEVER it didn't copy the
copy/move/erase operations for call site information.

The fix is to rename and update the existing copy/move/erase functions
so they also take care of Called Global info.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Refactor and document ThunkInserter (#97468)</title>
<updated>2024-07-04T14:03:47+00:00</updated>
<author>
<name>Anatoly Trosinenko</name>
<email>atrosinenko@accesssoftek.com</email>
</author>
<published>2024-07-04T14:03:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b12449fb289708f3d31c107d6e7977044a01da62'/>
<id>b12449fb289708f3d31c107d6e7977044a01da62</id>
<content type='text'>
In preparation for supporting BLRA* instructions in SLS Hardening on
AArch64, refactor ThunkInserter class.

The main intention of this commit is to document the way to merge the
BLR-rewriting logic of the AArch64SLSHardening pass into the
SLSBLRThunkInserter class. This makes it possible to only call
createThunkFunction for the thunks that are actually referenced.
Ultimately, it will prevent SLSBLRThunkInserter from unconditionally
generating about 1800 thunk functions corresponding to every possible
combination of operands passed to BLRAA or BLRAB instructions.

This particular commit does not affect the generated machine code and
consists of the following changes:
* document the existing behavior of ThunkInserter class
* introduce ThunkInserterPass template class to get rid of mostly
identical boilerplate code in ARM, AArch64 and X86 implementations
* move the InsertedThunks parameter from `mayUseThunk` to `insertThunks`
method</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In preparation for supporting BLRA* instructions in SLS Hardening on
AArch64, refactor ThunkInserter class.

The main intention of this commit is to document the way to merge the
BLR-rewriting logic of the AArch64SLSHardening pass into the
SLSBLRThunkInserter class. This makes it possible to only call
createThunkFunction for the thunks that are actually referenced.
Ultimately, it will prevent SLSBLRThunkInserter from unconditionally
generating about 1800 thunk functions corresponding to every possible
combination of operands passed to BLRAA or BLRAB instructions.

This particular commit does not affect the generated machine code and
consists of the following changes:
* document the existing behavior of ThunkInserter class
* introduce ThunkInserterPass template class to get rid of mostly
identical boilerplate code in ARM, AArch64 and X86 implementations
* move the InsertedThunks parameter from `mayUseThunk` to `insertThunks`
method</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC] Use fold expressions to replace discarded initializer_lists (#83693)</title>
<updated>2024-03-02T22:44:17+00:00</updated>
<author>
<name>MagentaTreehouse</name>
<email>99200384+MagentaTreehouse@users.noreply.github.com</email>
</author>
<published>2024-03-02T22:44:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f505a92fc2e965f1fe2e6a25d1ff4f0d9d1297c6'/>
<id>f505a92fc2e965f1fe2e6a25d1ff4f0d9d1297c6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)</title>
<updated>2023-12-12T05:01:36+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2023-12-12T05:01:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=586ecdf205aa8b3d162da6f955170a6736656615'/>
<id>586ecdf205aa8b3d162da6f955170a6736656615</id>
<content type='text'>
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.</pre>
</div>
</content>
</entry>
<entry>
<title>[ARM] Add Thumb Attributes for thumb thunks created in SLSHarding</title>
<updated>2023-03-24T18:11:54+00:00</updated>
<author>
<name>David Green</name>
<email>david.green@arm.com</email>
</author>
<published>2023-03-24T18:11:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3ac5a123d95c4caa194b2f0b54ad963ce3034ca8'/>
<id>3ac5a123d95c4caa194b2f0b54ad963ce3034ca8</id>
<content type='text'>
Without this the function will be use an Arm subtarget, meaning the
instructions in it will be invalid for the current subtarget.

Differential Revision: https://reviews.llvm.org/D144733
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Without this the function will be use an Arm subtarget, meaning the
instructions in it will be invalid for the current subtarget.

Differential Revision: https://reviews.llvm.org/D144733
</pre>
</div>
</content>
</entry>
<entry>
<title>[ARM] Don't emit Arm speculation hardening thunks under Thumb and vice-versa</title>
<updated>2023-01-23T11:22:11+00:00</updated>
<author>
<name>David Green</name>
<email>david.green@arm.com</email>
</author>
<published>2023-01-23T11:22:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3770b4aa3c5a06efbf43b5c22b2b641794a41dca'/>
<id>3770b4aa3c5a06efbf43b5c22b2b641794a41dca</id>
<content type='text'>
Given a patch like D129506, using instructions not valid for the current
target feature set becomes an error. This means that emitting Arm
instructions in a Thumb target (or vice versa) becomes an error. When
running in Thumb mode only thumb thunks will be needed, and in Arm mode
only arm thunks are needed. This patch limits the emitted thunks to just
the ones valid for the current architecture.

Differential Revision: https://reviews.llvm.org/D129693
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Given a patch like D129506, using instructions not valid for the current
target feature set becomes an error. This means that emitting Arm
instructions in a Thumb target (or vice versa) becomes an error. When
running in Thumb mode only thumb thunks will be needed, and in Arm mode
only arm thunks are needed. This patch limits the emitted thunks to just
the ones valid for the current architecture.

Differential Revision: https://reviews.llvm.org/D129693
</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][CodeGen] Rename some functions in MachineInstr.h and remove duplicated comments</title>
<updated>2022-03-16T12:25:42+00:00</updated>
<author>
<name>Shengchen Kan</name>
<email>shengchen.kan@intel.com</email>
</author>
<published>2022-03-16T12:21:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=37b378386eefab39ef570db6172a8b8e660d7bfb'/>
<id>37b378386eefab39ef570db6172a8b8e660d7bfb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ARM][AArch64] SLSHardening: make non-comdat thunks possible</title>
<updated>2021-05-20T15:07:05+00:00</updated>
<author>
<name>Daniel Kiss</name>
<email>daniel.kiss@arm.com</email>
</author>
<published>2021-05-20T15:06:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=801ab71032e157eb7bcd38efeb6486742a7c53bb'/>
<id>801ab71032e157eb7bcd38efeb6486742a7c53bb</id>
<content type='text'>
Linker scripts might not handle COMDAT sections. SLSHardeing adds
new section for each __llvm_slsblr_thunk_xN. This new option allows
the generation of the thunks into the normal text section to handle these
exceptional cases.
,comdat or ,noncomdat can be added to harden-sls to control the codegen.
-mharden-sls=[all|retbr|blr],nocomdat.

Reviewed By: kristof.beyls

Differential Revision: https://reviews.llvm.org/D100546
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Linker scripts might not handle COMDAT sections. SLSHardeing adds
new section for each __llvm_slsblr_thunk_xN. This new option allows
the generation of the thunks into the normal text section to handle these
exceptional cases.
,comdat or ,noncomdat can be added to harden-sls to control the codegen.
-mharden-sls=[all|retbr|blr],nocomdat.

Reviewed By: kristof.beyls

Differential Revision: https://reviews.llvm.org/D100546
</pre>
</div>
</content>
</entry>
<entry>
<title>[ARM] harden-sls-blr: avoid r12 and lr in indirect calls.</title>
<updated>2020-12-19T12:39:59+00:00</updated>
<author>
<name>Kristof Beyls</name>
<email>kristof.beyls@arm.com</email>
</author>
<published>2020-11-26T13:45:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=df8ed3928377edc6e9241a56680b694ffa9f4d6d'/>
<id>df8ed3928377edc6e9241a56680b694ffa9f4d6d</id>
<content type='text'>
As a linker is allowed to clobber r12 on function calls, the code
transformation that hardens indirect calls is not correct in case a
linker does so.  Similarly, the transformation is not correct when
register lr is used.

This patch makes sure that r12 or lr are not used for indirect calls
when harden-sls-blr is enabled.

Differential Revision: https://reviews.llvm.org/D92469
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As a linker is allowed to clobber r12 on function calls, the code
transformation that hardens indirect calls is not correct in case a
linker does so.  Similarly, the transformation is not correct when
register lr is used.

This patch makes sure that r12 or lr are not used for indirect calls
when harden-sls-blr is enabled.

Differential Revision: https://reviews.llvm.org/D92469
</pre>
</div>
</content>
</entry>
<entry>
<title>[ARM] Harden indirect calls against SLS</title>
<updated>2020-12-19T12:33:42+00:00</updated>
<author>
<name>Kristof Beyls</name>
<email>kristof.beyls@arm.com</email>
</author>
<published>2020-11-20T16:11:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a4c1f5160e6d1de9a9959ecbf329c2acf4f3ed31'/>
<id>a4c1f5160e6d1de9a9959ecbf329c2acf4f3ed31</id>
<content type='text'>
To make sure that no barrier gets placed on the architectural execution
path, each indirect call calling the function in register rN, it gets
transformed to a direct call to __llvm_slsblr_thunk_mode_rN.  mode is
either arm or thumb, depending on the mode of where the indirect call
happens.

The llvm_slsblr_thunk_mode_rN thunk contains:

bx rN
&lt;speculation barrier&gt;

Therefore, the indirect call gets split into 2; one direct call and one
indirect jump.
This transformation results in not inserting a speculation barrier on
the architectural execution path.

The mitigation is off by default and can be enabled by the
harden-sls-blr subtarget feature.

As a linker is allowed to clobber r12 on function calls, the
above code transformation is not correct in case a linker does so.
Similarly, the transformation is not correct when register lr is used.
Avoiding r12/lr being used is done in a follow-on patch to make
reviewing this code easier.

Differential Revision: https://reviews.llvm.org/D92468
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To make sure that no barrier gets placed on the architectural execution
path, each indirect call calling the function in register rN, it gets
transformed to a direct call to __llvm_slsblr_thunk_mode_rN.  mode is
either arm or thumb, depending on the mode of where the indirect call
happens.

The llvm_slsblr_thunk_mode_rN thunk contains:

bx rN
&lt;speculation barrier&gt;

Therefore, the indirect call gets split into 2; one direct call and one
indirect jump.
This transformation results in not inserting a speculation barrier on
the architectural execution path.

The mitigation is off by default and can be enabled by the
harden-sls-blr subtarget feature.

As a linker is allowed to clobber r12 on function calls, the
above code transformation is not correct in case a linker does so.
Similarly, the transformation is not correct when register lr is used.
Avoiding r12/lr being used is done in a follow-on patch to make
reviewing this code easier.

Differential Revision: https://reviews.llvm.org/D92468
</pre>
</div>
</content>
</entry>
</feed>
