Skip to content
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

Allow modifying static keys in multi-thread environment #2

Open
Evian-Zhang opened this issue Jul 28, 2024 · 2 comments
Open

Allow modifying static keys in multi-thread environment #2

Evian-Zhang opened this issue Jul 28, 2024 · 2 comments
Assignees

Comments

@Evian-Zhang
Copy link
Owner

See FAQ for reason to only allow modifying in single-thread environment. See discussions in Announcing static-keys, reimplementaion of Linux kernel’s static keys mechanism for Rust userland for difficulties in implementing such feature.

To allow modify static keys in multi-thread environment, we shall implement a text_poke in userland, which is worth investigating.

@Evian-Zhang Evian-Zhang self-assigned this Jul 28, 2024
@heiher
Copy link

heiher commented Aug 9, 2024

I think it is necessary to ensure that the 5-byte NOP and JMP instruction on x86 is contained within the same cache line. This prevents fetching the instruction from requiring two memory accesses. If fetching requires two memory accesses and a memory mapping replacement occurs almost simultaneously, unpredictable results may occur.

@Evian-Zhang
Copy link
Owner Author

Having been struggling with this problem for nearly a week. Found something extremely useful: https://stackoverflow.com/a/70180507/10005095. Still reading and understanding it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants