-
Notifications
You must be signed in to change notification settings - Fork 47
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
Making zero_mem_region() and control regs helpers unsafe #546
Conversation
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.
Once you remove the unsafe
marker on the TLB flush routine (for the reasons I wrote there), you can also remove unsafe
from all of the routines that request TLB flush.
Fixed now, thanks for the input Jon! |
As advised by @Freax13 in coconut-svsm#359, if misused, zero_mem_region() can corrupt valid memory by writing zeroes to it. Therefore, it should be unsafe so that callers verfies that it points to the intended memory. Signed-off-by: Thomas Leroy <[email protected]>
Some functions only reading and/or writing to control registers can be linlined. Signed-off-by: Thomas Leroy <[email protected]>
zero_mem_region()
should be unsafe.flush_tlb_global_percpu()
unsafe too. Since I don't know perfectly the TLB code, maybe it's not necessary. Comments are very welcome here. Also, if it's correct to makeflush_tlb_global_percpu()
unsafe, for consistency reason I guess we should put other TLB helpers unsafe (again, comments are welcome here).