mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +00:00
Kernel: Always inline stac(), clac() and SmapDisabler
Let's not be paying the function call overhead for these tiny ops. Maybe there's an argument for having fewer gadgets in the kernel but for now we're actually seeing stac() in profiles so let's put that above theoretical security issues.
This commit is contained in:
parent
e10183a6c5
commit
81d35c6891
2 changed files with 17 additions and 20 deletions
|
@ -734,22 +734,6 @@ void cpu_detect()
|
|||
g_cpu_supports_umip = (extended_features.ecx() & (1 << 2));
|
||||
}
|
||||
|
||||
void stac()
|
||||
{
|
||||
if (!g_cpu_supports_smap)
|
||||
return;
|
||||
asm volatile("stac" ::
|
||||
: "cc");
|
||||
}
|
||||
|
||||
void clac()
|
||||
{
|
||||
if (!g_cpu_supports_smap)
|
||||
return;
|
||||
asm volatile("clac" ::
|
||||
: "cc");
|
||||
}
|
||||
|
||||
void cpu_setup()
|
||||
{
|
||||
cpu_detect();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue