<s>
Kernel	B-Application
page-table	I-Application
isolation	I-Application
(	O
KPTI	B-Application
or	O
PTI	O
,	O
previously	O
called	O
KAISER	B-Application
)	O
is	O
a	O
Linux	B-Operating_System
kernel	I-Operating_System
feature	O
that	O
mitigates	O
the	O
Meltdown	B-Architecture
security	I-Architecture
vulnerability	I-Architecture
(	O
affecting	O
mainly	O
Intel	B-Device
's	I-Device
x86	I-Device
CPUs	I-Device
)	O
and	O
improves	O
kernel	B-Operating_System
hardening	O
against	O
attempts	O
to	O
bypass	O
kernel	B-Operating_System
address	O
space	O
layout	O
randomization	O
(	O
KASLR	O
)	O
.	O
</s>
<s>
It	O
works	O
by	O
better	O
isolating	O
user	B-Operating_System
space	I-Operating_System
and	I-Operating_System
kernel	I-Operating_System
space	I-Operating_System
memory	O
.	O
</s>
<s>
KPTI	B-Application
was	O
merged	O
into	O
Linux	B-Operating_System
kernel	I-Operating_System
version	O
4.15	O
,	O
and	O
backported	O
to	O
Linux	B-Operating_System
kernels	I-Operating_System
4.14.11	O
,	O
4.9.75	O
,	O
and	O
4.4.110	O
.	O
</s>
<s>
Windows	B-Application
and	O
macOS	B-Application
released	O
similar	O
updates	O
.	O
</s>
<s>
KPTI	B-Application
does	O
not	O
address	O
the	O
related	O
Spectre	B-Error_Name
vulnerability	I-Error_Name
.	O
</s>
<s>
The	O
KPTI	B-Application
patches	O
were	O
based	O
on	O
KAISER	B-Application
(	O
short	O
for	O
Kernel	B-Application
Address	I-Application
Isolation	I-Application
to	I-Application
have	I-Application
Side-channels	I-Application
Efficiently	I-Application
Removed	I-Application
)	O
,	O
a	O
technique	O
conceived	O
in	O
2016	O
and	O
published	O
in	O
June	O
2017	O
back	O
when	O
Meltdown	B-Architecture
was	O
not	O
known	O
yet	O
.	O
</s>
<s>
KAISER	B-Application
makes	O
it	O
harder	O
to	O
defeat	O
KASLR	O
,	O
a	O
2014	O
mitigation	O
for	O
a	O
much	O
less	O
severe	O
issue	O
.	O
</s>
<s>
In	O
2014	O
,	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
adopted	O
kernel	B-Operating_System
address	O
space	O
layout	O
randomization	O
(	O
KASLR	O
)	O
,	O
which	O
makes	O
it	O
more	O
difficult	O
to	O
exploit	O
other	O
kernel	B-Operating_System
vulnerabilities	O
,	O
which	O
relies	O
on	O
kernel	B-Operating_System
address	O
mappings	O
remaining	O
hidden	O
from	O
user	B-Operating_System
space	I-Operating_System
.	O
</s>
<s>
Despite	O
prohibiting	O
access	O
to	O
these	O
kernel	B-Operating_System
mappings	O
,	O
it	O
turns	O
out	O
that	O
there	O
are	O
several	O
side-channel	O
attacks	O
in	O
modern	O
processors	O
that	O
can	O
leak	O
the	O
location	O
of	O
this	O
memory	O
,	O
making	O
it	O
possible	O
to	O
work	O
around	O
KASLR	O
.	O
</s>
<s>
KAISER	B-Application
addressed	O
these	O
problems	O
in	O
KASLR	O
by	O
eliminating	O
some	O
sources	O
of	O
address	O
leakage	O
.	O
</s>
<s>
Whereas	O
KASLR	O
merely	O
prevents	O
address	O
mappings	O
from	O
leaking	O
,	O
KAISER	B-Application
also	O
prevents	O
the	O
data	O
from	O
leaking	O
,	O
thereby	O
covering	O
the	O
Meltdown	B-Architecture
case	O
.	O
</s>
<s>
KPTI	B-Application
is	O
based	O
on	O
KAISER	B-Application
.	O
</s>
<s>
Without	O
KPTI	B-Application
enabled	O
,	O
whenever	O
executing	O
user-space	B-Operating_System
code	O
(	O
applications	O
)	O
,	O
Linux	B-Operating_System
would	O
also	O
keep	O
its	O
entire	O
kernel	B-Operating_System
memory	O
mapped	O
in	O
page	B-General_Concept
tables	I-General_Concept
,	O
although	O
protected	O
from	O
access	O
.	O
</s>
<s>
The	O
advantage	O
is	O
that	O
when	O
the	O
application	O
makes	O
a	O
system	B-Operating_System
call	I-Operating_System
into	O
the	O
kernel	B-Operating_System
or	O
an	O
interrupt	B-Application
is	O
received	O
,	O
kernel	B-Operating_System
page	B-General_Concept
tables	I-General_Concept
are	O
always	O
present	O
,	O
so	O
most	O
context	O
switching-related	O
overheads	O
(	O
TLB	B-Architecture
flush	I-Architecture
,	O
page-table	O
swapping	O
,	O
etc	O
)	O
can	O
be	O
avoided	O
.	O
</s>
<s>
In	O
January	O
2018	O
,	O
the	O
Meltdown	B-Architecture
vulnerability	I-Architecture
was	O
published	O
,	O
known	O
to	O
affect	O
Intel	B-Device
's	I-Device
x86	I-Device
CPUs	I-Device
and	O
ARM	O
Cortex-A75	O
.	O
</s>
<s>
It	O
was	O
a	O
far	O
more	O
severe	O
vulnerability	O
than	O
the	O
KASLR	O
bypass	O
that	O
KAISER	B-Application
originally	O
intended	O
to	O
fix	O
:	O
It	O
was	O
found	O
that	O
contents	O
of	O
kernel	B-Operating_System
memory	O
could	O
also	O
be	O
leaked	O
,	O
not	O
just	O
the	O
locations	O
of	O
memory	O
mappings	O
,	O
as	O
previously	O
thought	O
.	O
</s>
<s>
KPTI	B-Application
(	O
conceptually	O
based	O
on	O
KAISER	B-Application
)	O
prevents	O
Meltdown	B-Architecture
by	O
preventing	O
most	O
protected	O
locations	O
from	O
being	O
mapped	O
to	O
user	B-Operating_System
space	I-Operating_System
.	O
</s>
<s>
AMD	O
x86	B-Operating_System
processors	O
are	O
not	O
currently	O
known	O
to	O
be	O
affected	O
by	O
Meltdown	B-Architecture
and	O
do	O
n't	O
need	O
KPTI	B-Application
to	O
mitigate	O
them	O
.	O
</s>
<s>
However	O
,	O
AMD	O
processors	O
are	O
still	O
susceptible	O
to	O
KASLR	O
bypass	O
when	O
KPTI	B-Application
is	O
disabled	O
.	O
</s>
<s>
KPTI	B-Application
fixes	O
these	O
leaks	O
by	O
separating	O
user-space	B-Operating_System
and	O
kernel-space	B-Operating_System
page	B-General_Concept
tables	I-General_Concept
entirely	O
.	O
</s>
<s>
One	O
set	O
of	O
page	B-General_Concept
tables	I-General_Concept
includes	O
both	O
kernel-space	B-Operating_System
and	O
user-space	B-Operating_System
addresses	O
same	O
as	O
before	O
,	O
but	O
it	O
is	O
only	O
used	O
when	O
the	O
system	O
is	O
running	O
in	O
kernel	B-Operating_System
mode	O
.	O
</s>
<s>
The	O
second	O
set	O
of	O
page	B-General_Concept
tables	I-General_Concept
for	O
use	O
in	O
user	B-Operating_System
mode	I-Operating_System
contains	O
a	O
copy	O
of	O
user-space	B-Operating_System
and	O
a	O
minimal	O
set	O
of	O
kernel-space	B-Operating_System
mappings	O
that	O
provides	O
the	O
information	O
needed	O
to	O
enter	O
or	O
exit	O
system	B-Operating_System
calls	I-Operating_System
,	O
interrupts	B-Application
and	O
exceptions	O
.	O
</s>
<s>
On	O
processors	O
that	O
support	O
the	O
process-context	O
identifiers	O
(	O
PCID	O
)	O
,	O
a	O
translation	B-Architecture
lookaside	I-Architecture
buffer	I-Architecture
(	O
TLB	O
)	O
flush	O
can	O
be	O
avoided	O
,	O
but	O
even	O
then	O
it	O
comes	O
at	O
a	O
significant	O
performance	O
cost	O
,	O
particularly	O
in	O
syscall-heavy	O
and	O
interrupt-heavy	O
workloads	O
.	O
</s>
<s>
The	O
overhead	O
was	O
measured	O
to	O
be	O
0.28	O
%	O
according	O
to	O
KAISER	B-Application
's	O
original	O
authors	O
;	O
a	O
Linux	B-Operating_System
developer	O
measured	O
it	O
to	O
be	O
roughly	O
5%	O
for	O
most	O
workloads	O
and	O
up	O
to	O
30%	O
in	O
some	O
cases	O
,	O
even	O
with	O
the	O
PCID	O
optimization	O
;	O
for	O
database	O
engine	O
PostgreSQL	B-Application
the	O
impact	O
on	O
read-only	O
tests	O
on	O
an	O
Intel	B-Architecture
Skylake	I-Architecture
processor	O
was	O
7	O
–	O
17%	O
(	O
or	O
16	O
–	O
23%	O
without	O
PCID	O
)	O
,	O
while	O
a	O
full	O
benchmark	O
lost	O
13	O
–	O
19%	O
(	O
Coffee	B-Device
Lake	I-Device
vs.	O
Broadwell-E	B-General_Concept
)	O
.	O
</s>
<s>
Many	O
benchmarks	O
have	O
been	O
done	O
by	O
Phoronix	O
,	O
Redis	B-Operating_System
slowed	O
by	O
6	O
–	O
7%	O
.	O
</s>
<s>
Linux	B-Operating_System
kernel	I-Operating_System
compilation	O
slowed	O
down	O
by	O
5%	O
on	O
Haswell	B-Device
.	O
</s>
<s>
KPTI	B-Application
can	O
partially	O
be	O
disabled	O
with	O
the	O
"	O
nopti	O
"	O
kernel	B-Operating_System
boot	O
option	O
.	O
</s>
<s>
Also	O
provisions	O
were	O
created	O
to	O
disable	O
KPTI	B-Application
if	O
newer	O
processors	O
fix	O
the	O
information	O
leaks	O
.	O
</s>
