-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
arm64/mte: Add support for arm64 mte #14978
Conversation
[Experimental Bot, please feedback here] This PR description does not fully meet the NuttX requirements, although it's closer than many. Here's a breakdown: Strengths:
Weaknesses:
Recommendations for Improvement:
By addressing these weaknesses, the PR description will be much more complete and comply with the NuttX requirements. This will help reviewers quickly understand and evaluate the changes. |
ee801dc
to
1cf29fb
Compare
@W-M-R it is important to have Documentation/ about MTE. Also the board profile should be included at https://nuttx.apache.org/docs/latest/platforms/arm64/qemu/boards/qemu-armv8a/index.html (it needs to be converted to RST format) |
Signed-off-by: wangmingrong1 <[email protected]>
Signed-off-by: wangmingrong1 <[email protected]>
For details, please refer to the kernel's introduction to this at "https://docs.kernel.org/arch/arm64/memory-tagging-extension.html" and Android's introduction to this at "https://source.android.com/docs/security/test/memory-safety/arm-mte" Of course, there is also the following detailed principle introduction https://developer.arm.com/-/media/Arm%20Developer%20Community/PDF/Arm_Memory_Tagging_Extension_Whitepaper.pdf The modification of this patch is only to merge the simplest MTE function support. In the future, the MTE function will be integrated into the kernel to a greater extent, for example, hardware MTE Kasan will be supported in the future. Signed-off-by: wangmingrong1 <[email protected]>
* Private Functions | ||
****************************************************************************/ | ||
|
||
static int arm64_mte_is_support(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int->bool
@@ -159,6 +159,11 @@ | |||
#define TCR_KASAN_SW_FLAGS 0 | |||
#endif | |||
|
|||
#ifdef CONFIG_ARM64_MTE | |||
#define TCR_MTE_FLAGS (TCR_TCMA1 | TCR_TBI0 | TCR_TBI1 | TCR_ASID_8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add space from line 135 to line 164
Note: Please adhere to Contributing Guidelines.
Summary
arm64/mte: Add support for arm64 mte
arm64/qemu: Add arm64 mte defconfig support
arm64/qemu: Add support for arm64 qemu's maximum feature cpu
Impact
This feature can only be run on qemu for now, see "Testing" for details
For details, please refer to the kernel's introduction to this at "https://docs.kernel.org/arch/arm64/memory-tagging-extension.html" and Android's introduction to this at "https://source.android.com/docs/security/test/memory-safety/arm-mte"
Of course, there is also the following detailed principle introduction
https://developer.arm.com/-/media/Arm%20Developer%20Community/PDF/Arm_Memory_Tagging_Extension_Whitepaper.pdf
The modification of this patch is only to merge the simplest MTE function support. In the future, the MTE function will be integrated into the kernel to a greater extent, for example, hardware MTE Kasan will be supported in the future.
Testing
Please compile my newly added arm64/qemu:mte.
Then run it with the following command
Add the following app to test the mte function:
It will run with an error and enter the tag synchronization detection exception:
Of course, if you use the labeled p1 pointer to access, this error will not be reported.