++--
4 files changed, 5 insertions(+), 5 deletions(-)
Reviewed-by: Alexandre Chartre
alex.
+--
1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Alexandre Chartre
And it is probably worth adding a 'Fixes:' tag:
Fixes: 334872a09198 ("x86/traps: Attempt to fixup exceptions in vDSO before
signaling")
alex.
instrumentation markers are only active when CONFIG_DEBUG_ENTRY is
enabled as the end marker emits a NOP to prevent the compiler from merging
the annotation points. This means the objtool verification requires a
kernel compiled with this option.
Signed-off-by: Thomas Gleixner
Reviewed-by: Alexandre
On 11/19/20 8:10 PM, Thomas Gleixner wrote:
On Mon, Nov 16 2020 at 19:10, Alexandre Chartre wrote:
On 11/16/20 5:57 PM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre
wrote:
When executing more code in the kernel, we are likely to reach a point
where we need to
On 11/19/20 5:06 PM, Andy Lutomirski wrote:
On Thu, Nov 19, 2020 at 4:06 AM Alexandre Chartre
wrote:
On 11/19/20 9:05 AM, Alexandre Chartre wrote:
When entering the kernel from userland, use the per-task PTI stack
instead of the per-cpu trampoline stack. Like the trampoline stack,
the PTI
On 11/19/20 9:05 AM, Alexandre Chartre wrote:
When entering the kernel from userland, use the per-task PTI stack
instead of the per-cpu trampoline stack. Like the trampoline stack,
the PTI stack is mapped both in the kernel and in the user page-table.
Using a per-task stack which is mapped
On 11/19/20 2:49 AM, Andy Lutomirski wrote:
On Tue, Nov 17, 2020 at 8:59 AM Alexandre Chartre
wrote:
On 11/17/20 4:52 PM, Andy Lutomirski wrote:
On Tue, Nov 17, 2020 at 7:07 AM Alexandre Chartre
wrote:
On 11/16/20 7:34 PM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 10:10 AM
On 11/18/20 12:29 PM, Borislav Petkov wrote:
On Wed, Nov 18, 2020 at 08:41:42AM +0100, Alexandre Chartre wrote:
Well, it looks like I wrongfully assume that KPTI was a well known performance
overhead since it was introduced (because it adds extra page-table switches),
but you are right I
On 11/18/20 2:22 PM, David Laight wrote:
From: Alexandre Chartre
Sent: 18 November 2020 10:30
...
Correct, this RFC is not changing the overhead. However, it is a step forward
for being able to execute some selected syscalls or interrupt handlers without
switching to the kernel page-table
On 11/18/20 10:30 AM, David Laight wrote:
From: Alexandre Chartre
Sent: 18 November 2020 07:42
On 11/17/20 10:26 PM, Borislav Petkov wrote:
On Tue, Nov 17, 2020 at 07:12:07PM +0100, Alexandre Chartre wrote:
Some benchmarks are available, in particular from phoronix:
What I was expecting
On 11/17/20 10:26 PM, Borislav Petkov wrote:
On Tue, Nov 17, 2020 at 07:12:07PM +0100, Alexandre Chartre wrote:
Some benchmarks are available, in particular from phoronix:
What I was expecting was benchmarks *you* have run which show that
perf penalty, not something one can find quickly on
On 11/17/20 10:23 PM, Borislav Petkov wrote:
On Tue, Nov 17, 2020 at 08:02:51PM +0100, Alexandre Chartre wrote:
No. This prevents the guest VM from gathering data from the host
kernel on the same cpu-thread. But there's no mitigation for a guest
VM running on a cpu-thread attacking an
On 11/17/20 7:28 PM, Borislav Petkov wrote:
On Tue, Nov 17, 2020 at 07:12:07PM +0100, Alexandre Chartre wrote:
Yes. L1TF/MDS allow some inter cpu-thread attacks which are not mitigated at
the moment. In particular, this allows a guest VM to attack another guest VM
or the host kernel running
On 11/17/20 6:07 PM, Borislav Petkov wrote:
On Tue, Nov 17, 2020 at 09:19:01AM +0100, Alexandre Chartre wrote:
We are not reversing PTI, we are extending it.
You're reversing it in the sense that you're mapping more kernel memory
into the user page table than what is mapped
On 11/17/20 5:55 PM, Borislav Petkov wrote:
On Tue, Nov 17, 2020 at 08:56:23AM +0100, Alexandre Chartre wrote:
The main goal of ASI is to provide KVM address space isolation to
mitigate guest-to-host speculative attacks like L1TF or MDS.
Because the current L1TF and MDS mitigations are
On 11/17/20 4:52 PM, Andy Lutomirski wrote:
On Tue, Nov 17, 2020 at 7:07 AM Alexandre Chartre
wrote:
On 11/16/20 7:34 PM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 10:10 AM Alexandre Chartre
wrote:
On 11/16/20 5:57 PM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 6:47 AM
On 11/16/20 7:34 PM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 10:10 AM Alexandre Chartre
wrote:
On 11/16/20 5:57 PM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre
wrote:
When entering the kernel from userland, use the per-task PTI stack
instead of the
On 11/17/20 12:06 AM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 12:18 PM Alexandre Chartre
wrote:
On 11/16/20 8:48 PM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 6:49 AM Alexandre Chartre
wrote:
Extend PTI user mappings so that more kernel entry code can be executed
with the
On 11/16/20 10:24 PM, David Laight wrote:
From: Alexandre Chartre
Sent: 16 November 2020 18:10
On 11/16/20 5:57 PM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre
wrote:
When entering the kernel from userland, use the per-task PTI stack
instead of the per-cpu
On 11/16/20 9:24 PM, Borislav Petkov wrote:
On Mon, Nov 16, 2020 at 03:47:36PM +0100, Alexandre Chartre wrote:
Deferring CR3 switch to C code means that we need to run more of the
kernel entry code with the user page-table. To do so, we need to:
- map more syscall, interrupt and exception
On 11/16/20 9:17 PM, Borislav Petkov wrote:
On Mon, Nov 16, 2020 at 03:47:36PM +0100, Alexandre Chartre wrote:
This RFC proposes to defer the PTI CR3 switch until we reach C code.
The benefit is that this simplifies the assembly entry code, and make
the PTI CR3 switch code easier to
On 11/16/20 8:48 PM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 6:49 AM Alexandre Chartre
wrote:
Extend PTI user mappings so that more kernel entry code can be executed
with the user page-table. To do so, we need to map syscall and interrupt
entry code, per cpu offsets (__per_cpu_offset
On 11/16/20 7:34 PM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 10:10 AM Alexandre Chartre
wrote:
On 11/16/20 5:57 PM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre
wrote:
When entering the kernel from userland, use the per-task PTI stack
instead of the
On 11/16/20 5:56 PM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 6:48 AM Alexandre Chartre
wrote:
Using stack protector requires the stack canary to be mapped into
the current page-table. Now that the page-table switch between the
user and kernel page-table is deferred to C code, stack
On 11/16/20 5:57 PM, Andy Lutomirski wrote:
On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre
wrote:
When entering the kernel from userland, use the per-task PTI stack
instead of the per-cpu trampoline stack. Like the trampoline stack,
the PTI stack is mapped both in the kernel and in the
With PTI, syscall/interrupt/exception entries switch the CR3 register
to change the page-table in assembly code. Move the CR3 register switch
inside the C code of syscall/interrupt/exception entry handlers.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/common.c | 15
kernel data leak to the userland
through the stack.
For now, only changes IDT handlers which have no argument other
than the pt_regs registers.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 43 +++--
arch/x86/kernel/cpu/mce/core.c | 2 +-
arch
IST entries from the kernel use paranoid entry and exit
assembly functions to ensure the CR3 and GS registers are
updated with correct values for the kernel. Move the update
of the CR3 inside the C code of IST handlers.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S | 34
PTI has a function to clone page-table entries but only from the
init_mm page-table. Provide a new function to clone page-table
entries from a specified mm page-table.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/pti.h | 10 ++
arch/x86/mm/pti.c | 32
Page Table Isolation (PTI) use assembly macros to switch the CR3
register between kernel and user page-tables. Add C functions which
implement the same features. For now, these C functions are not
used but they will eventually replace using the assembly macros.
Signed-off-by: Alexandre Chartre
leak to the userland through the stack.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 17 +
arch/x86/mm/fault.c | 2 +-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm
userland through the stack.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/common.c | 11 ++-
arch/x86/entry/entry_64.S| 1 +
arch/x86/include/asm/irq_stack.h | 3 +++
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/arch/x86/entry/common.c b/arch/x86
kernel data leak to the userland
through the stack.
Changes IDT handlers which have an error code.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 18 --
arch/x86/kernel/traps.c | 2 +-
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a
kernel data leak to the userland
through the stack.
Changes system vector handlers to execute on the kernel stack.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/idtentry.h b
Wrap the code used by PTI to map a per-cpu page-table entry into
a new function so that this code can be re-used to map other
per-cpu entries.
Signed-off-by: Alexandre Chartre
---
arch/x86/mm/pti.c | 25 -
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a
Update the asm_call_on_stack() function so that it can be invoked
with a function having up to three arguments instead of only one.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S| 15 +++
arch/x86/include/asm/irq_stack.h | 8
2 files changed, 19
page-table.
To prevent leaking the stack canary used with the kernel page-table,
use a different canary with the user and kernel page-table. The stack
canary is changed when switching the page-table.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/entry-common.h | 56
).
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S | 2 --
arch/x86/mm/pti.c | 19 +++
kernel/fork.c | 22 ++
3 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index
userland through the stack.
Signed-off-by: Alexandre Chartre
---
arch/x86/kernel/nmi.c | 14 --
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 4bc77aaf1303..be0f654c3095 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch
ret_from_fork is a mix of assembly code and calls to C functions.
Re-implement ret_from_fork so that it calls a single C function.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/common.c | 18 ++
arch/x86/entry/entry_64.S | 28 +---
2 files changed
is also refactored to just return the stack pointer, and the stack
configuration is done in the setup stack function (so that the
stack can be also be used to propagate CR3 switch information to
the idtentry handler for switching CR3 back).
Signed-off-by: Alexandre Chartre
---
arch/x86/entry
trampoline stack. This will allow running more
code on the trampoline stack, in particular code that schedules the
task out.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/page_64_types.h | 36 +++-
arch/x86/include/asm/processor.h | 3 +++
2 files changed, 38
Add a wrapper function for invoking a syscall function.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/common.c | 16 +---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index 870efeec8bda..d12908ad 100644
64-bit at the moment, I haven't looked at 32-bit yet but I will
definitively check it.
Patches are based on v5.10-rc4.
Thanks,
alex.
-----
Alexandre Chartre (21):
x86/syscall: Add wrapper for invoking syscall function
x86/entry: Update asm_call_on_stack to support more function argume
The ESPFIX stack is filled using assembly code. Move this code to a C
function so that it is easier to read and modify.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S | 62 ++---
arch/x86/kernel/espfix_64.c | 41
2 files
per-cpu stack will allow executing more code
before switching to the kernel stack and to the kernel page-table.
Additional changes will be made to later to switch to the kernel stack
(which is only mapped in the kernel page-table).
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S
this code into a single assembly macro.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S | 137 +-
1 file changed, 75 insertions(+), 62 deletions(-)
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index c42948aca0a8
On 11/10/20 11:42 PM, Joel Fernandes wrote:
On Tue, Nov 10, 2020 at 10:35:17AM +0100, Alexandre Chartre wrote:
[..]
---8<---
From b2835a587a28405ffdf8fc801e798129a014a8c8 Mon Sep 17 00:00:00 2001
From: "Joel Fernandes (Google)"
Date: Mon, 27 Jul 2020 1
On 11/11/20 12:39 AM, Andy Lutomirski wrote:
On 11/9/20 6:28 PM, Andy Lutomirski wrote:
On Mon, Nov 9, 2020 at 3:22 AM Alexandre Chartre
wrote:
Extend PTI user mappings so that more kernel entry code can be executed
with the user page-table. To do so, we need to map syscall and interrupt
On 11/3/20 2:20 AM, Joel Fernandes wrote:
Hi Alexandre,
Sorry for late reply as I was working on the snapshotting patch...
On Fri, Oct 30, 2020 at 11:29:26AM +0100, Alexandre Chartre wrote:
On 10/20/20 3:43 AM, Joel Fernandes (Google) wrote:
Core-scheduling prevents hyperthreads in
[Copying the reply to Andy in the thread with the right email addresses]
On 11/9/20 6:38 PM, Andy Lutomirski wrote:
On Mon, Nov 9, 2020 at 3:22 AM Alexandre Chartre
wrote:
SWAPGS and SWAPGS_UNSAFE_STACK are assembly macros. Add C versions
of these macros (swapgs() and swapgs_unsafe_stack
[Copying the reply to Andy in the thread with the right email addresses]
On 11/9/20 6:28 PM, Andy Lutomirski wrote:
On Mon, Nov 9, 2020 at 3:22 AM Alexandre Chartre
wrote:
Extend PTI user mappings so that more kernel entry code can be executed
with the user page-table. To do so, we need to
On 11/9/20 8:35 PM, Dave Hansen wrote:
On 11/9/20 6:44 AM, Alexandre Chartre wrote:
- map more syscall, interrupt and exception entry code into the user
page-table (map all noinstr code);
This seems like the thing we'd want to tag explicitly rather than make
it implicit with
On 11/9/20 6:38 PM, Andy Lutomirski wrote:
On Mon, Nov 9, 2020 at 3:22 AM Alexandre Chartre
wrote:
SWAPGS and SWAPGS_UNSAFE_STACK are assembly macros. Add C versions
of these macros (swapgs() and swapgs_unsafe_stack()).
This needs a very good justification. It also needs some kind of
On 11/9/20 6:28 PM, Andy Lutomirski wrote:
On Mon, Nov 9, 2020 at 3:22 AM Alexandre Chartre
wrote:
Extend PTI user mappings so that more kernel entry code can be executed
with the user page-table. To do so, we need to map syscall and interrupt
entry code,
Probably fine.
per cpu offsets
not me. Can you fix this?
I known, I messed up :-(
I have already resent the entire RFC with correct addresses.
Sorry about that.
alex.
On Mon, Nov 9, 2020 at 3:21 AM Alexandre Chartre
wrote:
Add a wrapper function for invoking a syscall function.
This needs some explanation of why.
userland through the stack.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/common.c | 11 ++-
arch/x86/entry/entry_64.S| 1 +
arch/x86/include/asm/irq_stack.h | 3 +++
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/arch/x86/entry/common.c b/arch/x86
kernel data leak to the userland
through the stack.
Changes system vector handlers to execute on the kernel stack.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/idtentry.h b
Wrap the code used by PTI to map a per-cpu page-table entry into
a new function so that this code can be re-used to map other
per-cpu entries.
Signed-off-by: Alexandre Chartre
---
arch/x86/mm/pti.c | 25 -
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a
PTI has a function to clone page-table entries but only from the
init_mm page-table. Provide a new function to clone page-table
entries from a specified mm page-table.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/pti.h | 10 ++
arch/x86/mm/pti.c | 32
kernel data leak to the userland
through the stack.
Changes IDT handlers which have an error code.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 18 --
arch/x86/kernel/traps.c | 2 +-
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a
With PTI, syscall/interrupt/exception entries switch the CR3 register
to change the page-table in assembly code. Move the CR3 register switch
inside the C code of syscall/interrupt/exception entry handlers.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/common.c | 15
The paranoid_entry and paranoid_exit assembly functions have been
replaced by the kernel_paranoid_entry() and kernel_paranoid_exit()
C functions. Now paranoid_entry/exit are not used anymore and can
be removed.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S | 131
IST entries from the kernel use paranoid entry and exit
assembly functions to ensure the CR3 and GS registers are
updated with correct values for the kernel. Move the update
of the CR3 and GS registers inside the C code of IST handlers.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry
per-cpu stack will allow executing more code
before switching to the kernel stack and to the kernel page-table.
Additional changes will be made to later to switch to the kernel stack
(which is only mapped in the kernel page-table).
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S
entry C handlers where the GS register setup will eventually
happen.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 25 -
arch/x86/kernel/nmi.c | 2 +-
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/arch/x86/include/asm
SWAPGS and SWAPGS_UNSAFE_STACK are assembly macros. Add C versions
of these macros (swapgs() and swapgs_unsafe_stack()).
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/paravirt.h | 15 +++
arch/x86/include/asm/paravirt_types.h | 17 -
2 files changed
ret_from_fork is a mix of assembly code and calls to C functions.
Re-implement ret_from_fork so that it calls a single C function.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/common.c | 18 ++
arch/x86/entry/entry_64.S | 28 +---
2 files changed
).
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S | 2 --
arch/x86/mm/pti.c | 14 ++
kernel/fork.c | 22 ++
3 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index
trampoline stack. This will allow running more
code on the trampoline stack, in particular code that schedules the
task out.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/page_64_types.h | 36 +++-
arch/x86/include/asm/processor.h | 3 +++
2 files changed, 38
leak to the userland through the stack.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 17 +
arch/x86/mm/fault.c | 2 +-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm
userland through the stack.
Signed-off-by: Alexandre Chartre
---
arch/x86/kernel/nmi.c | 14 --
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 4bc77aaf1303..be0f654c3095 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch
kernel data leak to the userland
through the stack.
For now, only changes IDT handlers which have no argument other
than the pt_regs registers.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 43 +++--
arch/x86/kernel/cpu/mce/core.c | 2 +-
arch
Page Table Isolation (PTI) use assembly macros to switch the CR3
register between kernel and user page-tables. Add C functions which
implement the same features. For now, these C functions are not
used but they will eventually replace using the assembly macros.
Signed-off-by: Alexandre Chartre
is also refactored to just return the stack pointer, and the stack
configuration is done in the setup stack function (so that the
stack can be also be used to propagate CR3 switch information to
the idtentry handler for switching CR3 back).
Signed-off-by: Alexandre Chartre
---
arch/x86/entry
Update the asm_call_on_stack() function so that it can be invoked
with a function having up to three arguments instead of only one.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S| 15 +++
arch/x86/include/asm/irq_stack.h | 8
2 files changed, 19
The ESPFIX stack is filled using assembly code. Move this code to a C
function so that it is easier to read and modify.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S | 62 ++---
arch/x86/kernel/espfix_64.c | 41
2 files
does.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/common.c | 157
arch/x86/include/asm/entry-common.h | 10 ++
2 files changed, 167 insertions(+)
diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index d09b1ded5287..54d0931801e1 100644
this code into a single assembly macro.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S | 137 +-
1 file changed, 75 insertions(+), 62 deletions(-)
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index c42948aca0a8
The code survives running a kernel build and LTP. Note that changes are
only for 64-bit at the moment, I haven't looked at 32-bit yet but I will
definitively check it.
Code is based on v5.10-rc3.
Thanks,
alex.
-----
Alexandre Chartre (24):
x86/syscall: Add wrapper for invoking syscall funct
Add a wrapper function for invoking a syscall function.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/common.c | 16 +---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index 870efeec8bda..d12908ad 100644
n 11/9/20 12:22 PM, Alexandre Chartre wrote:
With Page Table Isolation (PTI), syscalls as well as interrupts and
exceptions occurring in userspace enter the kernel with a user
page-table. The kernel entry code will then switch the page-table
from the user page-table to the kernel page-table by u
userland through the stack.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/common.c | 11 ++-
arch/x86/entry/entry_64.S| 1 +
arch/x86/include/asm/irq_stack.h | 3 +++
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/arch/x86/entry/common.c b/arch/x86
Wrap the code used by PTI to map a per-cpu page-table entry into
a new function so that this code can be re-used to map other
per-cpu entries.
Signed-off-by: Alexandre Chartre
---
arch/x86/mm/pti.c | 25 -
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a
trampoline stack. This will allow running more
code on the trampoline stack, in particular code that schedules the
task out.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/page_64_types.h | 36 +++-
arch/x86/include/asm/processor.h | 3 +++
2 files changed, 38
PTI has a function to clone page-table entries but only from the
init_mm page-table. Provide a new function to clone page-table
entries from a specified mm page-table.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/pti.h | 10 ++
arch/x86/mm/pti.c | 32
this code into a single assembly macro.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S | 137 +-
1 file changed, 75 insertions(+), 62 deletions(-)
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index c42948aca0a8
ret_from_fork is a mix of assembly code and calls to C functions.
Re-implement ret_from_fork so that it calls a single C function.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/common.c | 18 ++
arch/x86/entry/entry_64.S | 28 +---
2 files changed
does.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/common.c | 157
arch/x86/include/asm/entry-common.h | 10 ++
2 files changed, 167 insertions(+)
diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index d09b1ded5287..54d0931801e1 100644
is also refactored to just return the stack pointer, and the stack
configuration is done in the setup stack function (so that the
stack can be also be used to propagate CR3 switch information to
the idtentry handler for switching CR3 back).
Signed-off-by: Alexandre Chartre
---
arch/x86/entry
IST entries from the kernel use paranoid entry and exit
assembly functions to ensure the CR3 and GS registers are
updated with correct values for the kernel. Move the update
of the CR3 and GS registers inside the C code of IST handlers.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry
With PTI, syscall/interrupt/exception entries switch the CR3 register
to change the page-table in assembly code. Move the CR3 register switch
inside the C code of syscall/interrupt/exception entry handlers.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/common.c | 15
kernel data leak to the userland
through the stack.
Changes system vector handlers to execute on the kernel stack.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/idtentry.h b
The paranoid_entry and paranoid_exit assembly functions have been
replaced by the kernel_paranoid_entry() and kernel_paranoid_exit()
C functions. Now paranoid_entry/exit are not used anymore and can
be removed.
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S | 131
userland through the stack.
Signed-off-by: Alexandre Chartre
---
arch/x86/kernel/nmi.c | 14 --
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 4bc77aaf1303..be0f654c3095 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch
per-cpu stack will allow executing more code
before switching to the kernel stack and to the kernel page-table.
Additional changes will be made to later to switch to the kernel stack
(which is only mapped in the kernel page-table).
Signed-off-by: Alexandre Chartre
---
arch/x86/entry/entry_64.S
kernel data leak to the userland
through the stack.
For now, only changes IDT handlers which have no argument other
than the pt_regs registers.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 43 +++--
arch/x86/kernel/cpu/mce/core.c | 2 +-
arch
leak to the userland through the stack.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 17 +
arch/x86/mm/fault.c | 2 +-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm
entry C handlers where the GS register setup will eventually
happen.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 25 -
arch/x86/kernel/nmi.c | 2 +-
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/arch/x86/include/asm
kernel data leak to the userland
through the stack.
Changes IDT handlers which have an error code.
Signed-off-by: Alexandre Chartre
---
arch/x86/include/asm/idtentry.h | 18 --
arch/x86/kernel/traps.c | 2 +-
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a
1 - 100 of 278 matches
Mail list logo