search for: in_nmi

Displaying 20 results from an estimated 62 matches for "in_nmi".

Did you mean: do_nmi
2014 Jun 22
1
[PATCH 11/11] qspinlock, kvm: Add paravirt support
On 06/15/2014 06:17 PM, Peter Zijlstra wrote: > Signed-off-by: Peter Zijlstra<peterz at infradead.org> > --- [...] > + > +void kvm_wait(int *ptr, int val) > +{ > + unsigned long flags; > + > + if (in_nmi()) > + return; > + > + /* > + * Make sure an interrupt handler can't upset things in a > + * partially setup state. > + */ I am seeing hang with even 2 cpu guest (with patches on top of 3.15-rc6 ). looking further with gdb I see one cpu is stuck with native_halt with slow...
2014 Jun 22
1
[PATCH 11/11] qspinlock, kvm: Add paravirt support
On 06/15/2014 06:17 PM, Peter Zijlstra wrote: > Signed-off-by: Peter Zijlstra<peterz at infradead.org> > --- [...] > + > +void kvm_wait(int *ptr, int val) > +{ > + unsigned long flags; > + > + if (in_nmi()) > + return; > + > + /* > + * Make sure an interrupt handler can't upset things in a > + * partially setup state. > + */ I am seeing hang with even 2 cpu guest (with patches on top of 3.15-rc6 ). looking further with gdb I see one cpu is stuck with native_halt with slow...
2020 Aug 11
3
[PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers
On Tue, Aug 11, 2020 at 11:20:54AM +0200, peterz at infradead.org wrote: > On Tue, Aug 11, 2020 at 10:38:50AM +0200, J?rgen Gro? wrote: > > In case you don't want to do it I can send the patch for the Xen > > variants. > > I might've opened a whole new can of worms here. I'm not sure we > can/want to fix the entire fallout this release :/ > > Let me
2020 Aug 11
3
[PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers
On Tue, Aug 11, 2020 at 11:20:54AM +0200, peterz at infradead.org wrote: > On Tue, Aug 11, 2020 at 10:38:50AM +0200, J?rgen Gro? wrote: > > In case you don't want to do it I can send the patch for the Xen > > variants. > > I might've opened a whole new can of worms here. I'm not sure we > can/want to fix the entire fallout this release :/ > > Let me
2020 Apr 08
0
[RFC PATCH 15/26] x86/alternatives: Non-emulated text poking
...t that is not guaranteed > + * to work on Xen-PV -- it is emulated by Xen and might not > + * execute an iret (or similar synchronizing instruction) > + * internally. > + * > + * cpuid() would trap as well. Unclear if that's a solution > + * either. > + */ > + if (in_nmi()) > + cpuid_eax(1); > + else > + sync_core(); > +} That's not thinking staight; what do you think the INT3 does when it happens inside an NMI ?
2014 Jun 15
0
[PATCH 11/11] qspinlock, kvm: Add paravirt support
...CALLEE_SAVE_REGS_THUNK(__pv_init_node); +PV_CALLEE_SAVE_REGS_THUNK(__pv_link_and_wait_node); +PV_CALLEE_SAVE_REGS_THUNK(__pv_kick_node); + +PV_CALLEE_SAVE_REGS_THUNK(__pv_wait_head); +PV_CALLEE_SAVE_REGS_THUNK(__pv_queue_unlock); + +void kvm_wait(int *ptr, int val) +{ + unsigned long flags; + + if (in_nmi()) + return; + + /* + * Make sure an interrupt handler can't upset things in a + * partially setup state. + */ + local_irq_save(flags); + + /* + * check again make sure it didn't become free while + * we weren't looking. + */ + if (ACCESS_ONCE(*ptr) != val) + goto out; + + /* +...
2020 Aug 11
0
[PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers
...t;8 ------ >> >> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c >> index 233c77d056c9..1d412d1466f0 100644 >> --- a/arch/x86/kernel/kvm.c >> +++ b/arch/x86/kernel/kvm.c >> @@ -797,7 +797,7 @@ static void kvm_wait(u8 *ptr, u8 val) >> if (in_nmi()) >> return; >> >> - local_irq_save(flags); >> + raw_local_irq_save(flags); >> >> if (READ_ONCE(*ptr) != val) >> goto out; >> @@ -810,10 +810,10 @@ static void kvm_wait(u8 *ptr, u8 val) >>...
2014 Mar 12
0
[PATCH RFC v6 10/11] pvqspinlock, x86: Enable qspinlock PV support for KVM
...id) +{ + +} +#endif /* CONFIG_KVM_DEBUG_FS */ + +static void kvm_kick_cpu_type(int cpu, enum pv_kick_type type) +{ + kvm_kick_cpu(cpu); + inc_kick_stats(type); +} + +/* + * Halt the current CPU & release it back to the host + */ +static void kvm_hibernate(void) +{ + unsigned long flags; + + if (in_nmi()) + return; + + inc_hib_stats(); + /* + * Make sure an interrupt handler can't upset things in a + * partially setup state. + */ + local_irq_save(flags); + if (arch_irqs_disabled_flags(flags)) + halt(); + else + safe_halt(); + local_irq_restore(flags); +} +#endif /* !CONFIG_QUEUE_SPINLOC...
2020 Aug 11
0
[PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers
...pu(int cpu) +static notrace kvm_kick_cpu(int cpu) { int apicid; unsigned long flags = 0; @@ -790,14 +790,14 @@ static void kvm_kick_cpu(int cpu) #include <asm/qspinlock.h> -static void kvm_wait(u8 *ptr, u8 val) +static notrace kvm_wait(u8 *ptr, u8 val) { unsigned long flags; if (in_nmi()) return; - local_irq_save(flags); + raw_local_irq_save(flags); if (READ_ONCE(*ptr) != val) goto out; @@ -808,16 +808,16 @@ static void kvm_wait(u8 *ptr, u8 val) * in irq spinlock slowpath and no spurious interrupt occur to save us. */ if (arch_irqs_disabled_flags(flags)) - halt...
2014 Mar 19
0
[PATCH v7 10/11] pvqspinlock, x86: Enable qspinlock PV support for KVM
...inline void inc_hib_stats(void) +{ + +} +#endif /* CONFIG_KVM_DEBUG_FS */ + +static void kvm_kick_cpu_type(int cpu) +{ + kvm_kick_cpu(cpu); + inc_kick_stats(); +} + +/* + * Halt the current CPU & release it back to the host + */ +static void kvm_hibernate(void) +{ + unsigned long flags; + + if (in_nmi()) + return; + + inc_hib_stats(); + /* + * Make sure an interrupt handler can't upset things in a + * partially setup state. + */ + local_irq_save(flags); + if (arch_irqs_disabled_flags(flags)) + halt(); + else + safe_halt(); + local_irq_restore(flags); +} +#endif /* !CONFIG_QUEUE_SPINLOC...
2014 Mar 20
1
[PATCH v7 10/11] pvqspinlock, x86: Enable qspinlock PV support for KVM
...gt; + > +static void kvm_kick_cpu_type(int cpu) > +{ > + kvm_kick_cpu(cpu); > + inc_kick_stats(); > +} > + > +/* > + * Halt the current CPU & release it back to the host > + */ > +static void kvm_hibernate(void) > +{ > + unsigned long flags; > + > + if (in_nmi()) > + return; > + > + inc_hib_stats(); > + /* > + * Make sure an interrupt handler can't upset things in a > + * partially setup state. > + */ > + local_irq_save(flags); > + if (arch_irqs_disabled_flags(flags)) > + halt(); > + else > + safe_halt(); &gt...
2014 Mar 20
1
[PATCH v7 10/11] pvqspinlock, x86: Enable qspinlock PV support for KVM
...gt; + > +static void kvm_kick_cpu_type(int cpu) > +{ > + kvm_kick_cpu(cpu); > + inc_kick_stats(); > +} > + > +/* > + * Halt the current CPU & release it back to the host > + */ > +static void kvm_hibernate(void) > +{ > + unsigned long flags; > + > + if (in_nmi()) > + return; > + > + inc_hib_stats(); > + /* > + * Make sure an interrupt handler can't upset things in a > + * partially setup state. > + */ > + local_irq_save(flags); > + if (arch_irqs_disabled_flags(flags)) > + halt(); > + else > + safe_halt(); &gt...
2014 May 07
1
[PATCH v10 18/19] pvqspinlock, x86: Enable PV qspinlock PV for KVM
...start) > +{ > +} > +#endif /* CONFIG_KVM_DEBUG_FS */ > + > +/* > + * Halt the current CPU & release it back to the host > + */ > +static void kvm_halt_cpu(enum pv_lock_stats type, s8 *state, s8 sval) > +{ > + unsigned long flags; > + u64 start; > + > + if (in_nmi()) > + return; > + > + /* > + * Make sure an interrupt handler can't upset things in a > + * partially setup state. > + */ > + local_irq_save(flags); > + /* > + * Don't halt if the CPU state has been changed. > + */ > + if (ACCESS_ONCE(*state) != sval)...
2014 May 07
1
[PATCH v10 18/19] pvqspinlock, x86: Enable PV qspinlock PV for KVM
...start) > +{ > +} > +#endif /* CONFIG_KVM_DEBUG_FS */ > + > +/* > + * Halt the current CPU & release it back to the host > + */ > +static void kvm_halt_cpu(enum pv_lock_stats type, s8 *state, s8 sval) > +{ > + unsigned long flags; > + u64 start; > + > + if (in_nmi()) > + return; > + > + /* > + * Make sure an interrupt handler can't upset things in a > + * partially setup state. > + */ > + local_irq_save(flags); > + /* > + * Don't halt if the CPU state has been changed. > + */ > + if (ACCESS_ONCE(*state) != sval)...
2014 Oct 29
0
[PATCH v13 10/11] pvqspinlock, x86: Enable PV qspinlock for KVM
...c inline u64 spin_time_start(void) +{ + return 0; +} + +static inline void spin_time_accum_blocked(u64 start) +{ +} +#endif /* CONFIG_KVM_DEBUG_FS */ + +/* + * Halt the current CPU & release it back to the host + */ +void kvm_halt_cpu(u8 *lockbyte) +{ + unsigned long flags; + u64 start; + + if (in_nmi()) + return; + + /* + * Make sure an interrupt handler can't upset things in a + * partially setup state. + */ + local_irq_save(flags); + /* + * Don't halt if the lock byte is defined and is free + */ + if (lockbyte && !ACCESS_ONCE(*lockbyte)) { + kvm_halt_stats(PV_HALT_ABORT...
2014 Oct 29
0
[PATCH v13 10/11] pvqspinlock, x86: Enable PV qspinlock for KVM
...c inline u64 spin_time_start(void) +{ + return 0; +} + +static inline void spin_time_accum_blocked(u64 start) +{ +} +#endif /* CONFIG_KVM_DEBUG_FS */ + +/* + * Halt the current CPU & release it back to the host + */ +void kvm_halt_cpu(u8 *lockbyte) +{ + unsigned long flags; + u64 start; + + if (in_nmi()) + return; + + /* + * Make sure an interrupt handler can't upset things in a + * partially setup state. + */ + local_irq_save(flags); + /* + * Don't halt if the lock byte is defined and is free + */ + if (lockbyte && !ACCESS_ONCE(*lockbyte)) { + kvm_halt_stats(PV_HALT_ABORT...
2015 Mar 16
0
[PATCH 9/9] qspinlock, x86, kvm: Implement KVM support for paravirt qspinlock
...,6 +584,41 @@ static void kvm_kick_cpu(int cpu) kvm_hypercall2(KVM_HC_KICK_CPU, flags, apicid); } + +#ifdef CONFIG_QUEUE_SPINLOCK + +#include <asm/qspinlock.h> + +PV_CALLEE_SAVE_REGS_THUNK(__pv_queue_spin_unlock); + +static void kvm_wait(u8 *ptr, u8 val) +{ + unsigned long flags; + + if (in_nmi()) + return; + + local_irq_save(flags); + + if (READ_ONCE(*ptr) != val) + goto out; + + /* + * halt until it's our turn and kicked. Note that we do safe halt + * for irq enabled case to avoid hang when lock info is overwritten + * in irq spinlock slowpath and no spurious interrupt occur to...
2015 Mar 16
0
[PATCH 9/9] qspinlock, x86, kvm: Implement KVM support for paravirt qspinlock
...,6 +584,41 @@ static void kvm_kick_cpu(int cpu) kvm_hypercall2(KVM_HC_KICK_CPU, flags, apicid); } + +#ifdef CONFIG_QUEUE_SPINLOCK + +#include <asm/qspinlock.h> + +PV_CALLEE_SAVE_REGS_THUNK(__pv_queue_spin_unlock); + +static void kvm_wait(u8 *ptr, u8 val) +{ + unsigned long flags; + + if (in_nmi()) + return; + + local_irq_save(flags); + + if (READ_ONCE(*ptr) != val) + goto out; + + /* + * halt until it's our turn and kicked. Note that we do safe halt + * for irq enabled case to avoid hang when lock info is overwritten + * in irq spinlock slowpath and no spurious interrupt occur to...
2014 May 07
0
[PATCH v10 18/19] pvqspinlock, x86: Enable PV qspinlock PV for KVM
...+ return 0; +} + +static inline void spin_time_accum_blocked(u64 start) +{ +} +#endif /* CONFIG_KVM_DEBUG_FS */ + +/* + * Halt the current CPU & release it back to the host + */ +static void kvm_halt_cpu(enum pv_lock_stats type, s8 *state, s8 sval) +{ + unsigned long flags; + u64 start; + + if (in_nmi()) + return; + + /* + * Make sure an interrupt handler can't upset things in a + * partially setup state. + */ + local_irq_save(flags); + /* + * Don't halt if the CPU state has been changed. + */ + if (ACCESS_ONCE(*state) != sval) { + kvm_halt_stats(PV_HALT_ABORT); + goto out; + } +...
2020 Aug 05
9
[PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers
On Wed, Aug 05, 2020 at 03:59:40PM +0200, Marco Elver wrote: > On Wed, Aug 05, 2020 at 03:42PM +0200, peterz at infradead.org wrote: > > Shouldn't we __always_inline those? They're going to be really small. > > I can send a v2, and you can choose. For reference, though: > > ffffffff86271ee0 <arch_local_save_flags>: > ffffffff86271ee0: 0f 1f 44 00 00