similar to: [PATCH v2] x86/paravirt: convert simple paravirt functions to asm

Displaying 20 results from an estimated 300 matches similar to: "[PATCH v2] x86/paravirt: convert simple paravirt functions to asm"

2023 Mar 08
3
[PATCH] x86/paravirt: convert simple paravirt functions to asm
All functions referenced via __PV_IS_CALLEE_SAVE() need to be assembler functions, as those functions calls are hidden from gcc. In case the kernel is compiled with "-fzero-call-used-regs" the compiler will clobber caller-saved registers at the end of C functions, which will result in unexpectedly zeroed registers at the call site of the related paravirt functions. Replace the C
2023 Jun 08
3
[RFC PATCH 0/3] x86/paravirt: Get rid of paravirt patching
This is a small series getting rid of paravirt patching by switching completely to alternative patching for the same functionality. The basic idea is to add the capability to switch from indirect to direct calls via a special alternative patching option. This removes _some_ of the paravirt macro maze, but most of it needs to stay due to the need of hiding the call instructions from the compiler
2023 Jun 08
3
[RFC PATCH 0/3] x86/paravirt: Get rid of paravirt patching
This is a small series getting rid of paravirt patching by switching completely to alternative patching for the same functionality. The basic idea is to add the capability to switch from indirect to direct calls via a special alternative patching option. This removes _some_ of the paravirt macro maze, but most of it needs to stay due to the need of hiding the call instructions from the compiler
2020 Aug 05
0
[PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers
On Wed, Aug 05, 2020 at 03:26:29PM +0200, Marco Elver wrote: > Add missing noinstr to arch_local*() helpers, as they may be called from > noinstr code. > > On a KCSAN config with CONFIG_PARAVIRT=y, syzbot stumbled across corrupt Cute, so I've been working on adding objtool support for this a little: https://lkml.kernel.org/r/20200803143231.GE2674 at
2020 Aug 24
0
[PATCH v6 47/76] x86/dumpstack/64: Add noinstr version of get_stack_info()
From: Joerg Roedel <jroedel at suse.de> The get_stack_info functionality is needed in the entry code for the #VC exception handler. Provide a version of it in the .text.noinstr section which can be called safely from there. Signed-off-by: Joerg Roedel <jroedel at suse.de> Link: https://lore.kernel.org/r/20200724160336.5435-47-joro at 8bytes.org --- arch/x86/include/asm/stacktrace.h
2020 Jul 15
1
[PATCH v4 63/75] x86/sev-es: Handle #DB Events
On Wed, Jul 15, 2020 at 12:08:08PM +0200, Joerg Roedel wrote: > On Wed, Jul 15, 2020 at 11:51:36AM +0200, Peter Zijlstra wrote: > > On Wed, Jul 15, 2020 at 11:13:37AM +0200, Joerg Roedel wrote: > > > Then my understanding of intrumentation_begin/end() is wrong, I thought > > > that the kernel will forbid setting breakpoints before > > > instrumentation_begin(),
2023 Mar 10
1
[PATCH] x86/paravirt: convert simple paravirt functions to asm
On 09.03.23 14:39, Borislav Petkov wrote: > On Wed, Mar 08, 2023 at 04:42:10PM +0100, Juergen Gross wrote: >> All functions referenced via __PV_IS_CALLEE_SAVE() need to be assembler >> functions, as those functions calls are hidden from gcc. In case the >> kernel is compiled with "-fzero-call-used-regs" the compiler will >> clobber caller-saved registers at the
2020 Jul 15
0
[PATCH v4 45/75] x86/sev-es: Adjust #VC IST Stack on entering NMI handler
On Wed, Jul 15, 2020 at 11:47:02AM +0200, Peter Zijlstra wrote: > On Tue, Jul 14, 2020 at 02:08:47PM +0200, Joerg Roedel wrote: > DECLARE_STATIC_KEY_FALSE(sev_es_enabled_key); > > static __always_inline void sev_es_foo() > { > if (static_branch_unlikely(&sev_es_enabled_key)) > __sev_es_foo(); > } > > So that normal people will only see an extra NOP? Yes,
2020 Jun 23
2
Should SEV-ES #VC use IST? (Re: [PATCH] Allow RDTSC and RDTSCP from userspace)
On Tue, Jun 23, 2020 at 03:59:16PM +0200, Peter Zijlstra wrote: > So basically when your exception frame points to your own IST, you die. > That sounds like something we should have in generic IST code. Something like this... #DF already dies and NMI is 'magic' --- arch/x86/entry/common.c | 7 +++++++ arch/x86/include/asm/idtentry.h | 12 +++++++++++- 2 files changed, 18
2020 Jul 15
2
[PATCH v4 63/75] x86/sev-es: Handle #DB Events
On Wed, Jul 15, 2020 at 11:13:37AM +0200, Joerg Roedel wrote: > On Wed, Jul 15, 2020 at 10:47:52AM +0200, Peter Zijlstra wrote: > > On Tue, Jul 14, 2020 at 02:09:05PM +0200, Joerg Roedel wrote: > > > > > @@ -1028,6 +1036,16 @@ DEFINE_IDTENTRY_VC_SAFE_STACK(exc_vmm_communication) > > > struct ghcb *ghcb; > > > > > >
2020 Jul 15
2
[PATCH v4 63/75] x86/sev-es: Handle #DB Events
On Wed, Jul 15, 2020 at 11:13:37AM +0200, Joerg Roedel wrote: > On Wed, Jul 15, 2020 at 10:47:52AM +0200, Peter Zijlstra wrote: > > On Tue, Jul 14, 2020 at 02:09:05PM +0200, Joerg Roedel wrote: > > > > > @@ -1028,6 +1036,16 @@ DEFINE_IDTENTRY_VC_SAFE_STACK(exc_vmm_communication) > > > struct ghcb *ghcb; > > > > > >
2020 Jul 15
0
[PATCH v4 63/75] x86/sev-es: Handle #DB Events
On Wed, Jul 15, 2020 at 11:51:36AM +0200, Peter Zijlstra wrote: > On Wed, Jul 15, 2020 at 11:13:37AM +0200, Joerg Roedel wrote: > > Then my understanding of intrumentation_begin/end() is wrong, I thought > > that the kernel will forbid setting breakpoints before > > instrumentation_begin(), which is necessary here because a break-point > > in the #VC handler might cause
2020 Jul 15
2
[PATCH v4 45/75] x86/sev-es: Adjust #VC IST Stack on entering NMI handler
On Tue, Jul 14, 2020 at 02:08:47PM +0200, Joerg Roedel wrote: > @@ -489,6 +490,9 @@ DEFINE_IDTENTRY_RAW(exc_nmi) > this_cpu_write(nmi_cr2, read_cr2()); > nmi_restart: > > + /* Needs to happen before DR7 is accessed */ > + sev_es_ist_enter(regs); > + > this_cpu_write(nmi_dr7, local_db_save()); > > nmi_enter(); > @@ -502,6 +506,8 @@
2020 Jul 15
2
[PATCH v4 45/75] x86/sev-es: Adjust #VC IST Stack on entering NMI handler
On Tue, Jul 14, 2020 at 02:08:47PM +0200, Joerg Roedel wrote: > @@ -489,6 +490,9 @@ DEFINE_IDTENTRY_RAW(exc_nmi) > this_cpu_write(nmi_cr2, read_cr2()); > nmi_restart: > > + /* Needs to happen before DR7 is accessed */ > + sev_es_ist_enter(regs); > + > this_cpu_write(nmi_dr7, local_db_save()); > > nmi_enter(); > @@ -502,6 +506,8 @@
2020 Aug 24
0
[PATCH v6 48/76] x86/entry/64: Add entry code for #VC handler
From: Joerg Roedel <jroedel at suse.de> The #VC handler needs special entry code because: 1. It runs on an IST stack 2. It needs to be able to handle nested #VC exceptions To make this work the entry code is implemented to pretend it doesn't use an IST stack. When entered from user-mode or early SYSCALL entry path it switches to the task stack, if entered from kernel-mode it tries
2020 Aug 07
0
[PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers
On 07.08.20 11:01, Marco Elver wrote: > On Thu, 6 Aug 2020 at 18:06, Marco Elver <elver at google.com> wrote: >> On Thu, 6 Aug 2020 at 15:17, Marco Elver <elver at google.com> wrote: >>> On Thu, Aug 06, 2020 at 01:32PM +0200, peterz at infradead.org wrote: >>>> On Thu, Aug 06, 2020 at 09:47:23AM +0200, Marco Elver wrote: >>>>> Testing my
2020 Aug 07
0
[PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers
On 07.08.20 11:50, Marco Elver wrote: > On Fri, Aug 07, 2020 at 11:24AM +0200, J?rgen Gro? wrote: >> On 07.08.20 11:01, Marco Elver wrote: >>> On Thu, 6 Aug 2020 at 18:06, Marco Elver <elver at google.com> wrote: >>>> On Thu, 6 Aug 2020 at 15:17, Marco Elver <elver at google.com> wrote: >>>>> On Thu, Aug 06, 2020 at 01:32PM +0200, peterz at
2020 Aug 31
1
[PATCH v6 48/76] x86/entry/64: Add entry code for #VC handler
On Mon, Aug 24, 2020 at 10:54:43AM +0200, Joerg Roedel wrote: > @@ -446,6 +448,82 @@ _ASM_NOKPROBE(\asmsym) > SYM_CODE_END(\asmsym) > .endm > ifdeffery pls... > +/** > + * idtentry_vc - Macro to generate entry stub for #VC > + * @vector: Vector number > + * @asmsym: ASM symbol for the entry point > + * @cfunc: C function to be called > + * > + * The macro
2020 Aug 07
0
[PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers
On 07.08.20 13:38, Marco Elver wrote: > On Fri, Aug 07, 2020 at 12:35PM +0200, J?rgen Gro? wrote: >> On 07.08.20 11:50, Marco Elver wrote: >>> On Fri, Aug 07, 2020 at 11:24AM +0200, J?rgen Gro? wrote: >>>> On 07.08.20 11:01, Marco Elver wrote: >>>>> On Thu, 6 Aug 2020 at 18:06, Marco Elver <elver at google.com> wrote: >>>>>> On
2020 Jul 14
0
[PATCH v4 45/75] x86/sev-es: Adjust #VC IST Stack on entering NMI handler
From: Joerg Roedel <jroedel at suse.de> When an NMI hits in the #VC handler entry code before it switched to another stack, any subsequent #VC exception in the NMI code-path will overwrite the interrupted #VC handlers stack. Make sure this doesn't happen by explicitly adjusting the #VC IST entry in the NMI handler for the time in can cause #VC exceptions. Signed-off-by: Joerg Roedel