Re: [PATCH v4 09/17] perf/core: Use static_call to optimize perf_guest_info_callbacks

2022-02-06 Thread Peter Zijlstra
On Sun, Feb 06, 2022 at 10:45:15AM -0800, Kees Cook wrote: > I'm digging through the macros to sort this out, but IIUC, an example of > the problem is: > > so the caller is expecting "unsigned int (*)(void)" but the prototype > of __static_call_return0 is "long (*)(void)": > > long __static_cal

Re: [PATCH v4 09/17] perf/core: Use static_call to optimize perf_guest_info_callbacks

2022-02-06 Thread Peter Zijlstra
On Fri, Feb 04, 2022 at 09:35:49AM -0800, Sami Tolvanen wrote: > On Wed, Feb 2, 2022 at 10:43 AM Sean Christopherson wrote: > > > +DEFINE_STATIC_CALL_RET0(__perf_guest_state, *perf_guest_cbs->state); > > > +DEFINE_STATIC_CALL_RET0(__perf_guest_get_ip, *perf_guest_cbs->get_ip); > > > +DEFINE_STATIC

Re: [PATCH v4 00/17] perf: KVM: Fix, optimize, and clean up callbacks

2021-11-11 Thread Peter Zijlstra
On Thu, Nov 11, 2021 at 02:07:21AM +, Sean Christopherson wrote: > Like Xu (1): > perf/core: Rework guest callbacks to prepare for static_call support > > Sean Christopherson (16): > perf: Protect perf_guest_cbs with RCU > KVM: x86: Register perf callbacks after calling vendor's > h

Re: [PATCH v4 01/17] perf: Protect perf_guest_cbs with RCU

2021-11-11 Thread Peter Zijlstra
On Thu, Nov 11, 2021 at 08:26:58AM +0100, Paolo Bonzini wrote: > On 11/11/21 03:07, Sean Christopherson wrote: > > EXPORT_SYMBOL_GPL(perf_register_guest_info_callbacks); > > int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks > > *cbs) > > { > > - perf_guest_cbs = NU

Re: [PATCH v2 00/13] perf: KVM: Fix, optimize, and clean up callbacks

2021-09-17 Thread Peter Zijlstra
On Thu, Sep 16, 2021 at 09:37:43PM +, Sean Christopherson wrote: > On Sat, Aug 28, 2021, Peter Zijlstra wrote: > Argh, sorry, I somehow managed to miss all of your replies. I'll get back to > this series next week. Thanks for the quick response! > > > Lets keep

Re: [PATCH v2 00/13] perf: KVM: Fix, optimize, and clean up callbacks

2021-08-28 Thread Peter Zijlstra
On Fri, Aug 27, 2021 at 05:35:45PM -0700, Sean Christopherson wrote: > Like Xu (2): > perf/core: Rework guest callbacks to prepare for static_call support > perf/core: Use static_call to optimize perf_guest_info_callbacks > > Sean Christopherson (11): > perf: Ensure perf_guest_cbs aren't rel

Re: [PATCH v2 05/13] perf: Force architectures to opt-in to guest callbacks

2021-08-28 Thread Peter Zijlstra
On Fri, Aug 27, 2021 at 05:35:50PM -0700, Sean Christopherson wrote: > diff --git a/init/Kconfig b/init/Kconfig > index 55f9f7738ebb..9ef51ae53977 100644 > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -1776,6 +1776,9 @@ config HAVE_PERF_EVENTS > help > See tools/perf/design.txt for de

Re: [PATCH v2 01/13] perf: Ensure perf_guest_cbs aren't reloaded between !NULL check and deref

2021-08-28 Thread Peter Zijlstra
On Fri, Aug 27, 2021 at 05:35:46PM -0700, Sean Christopherson wrote: > diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h > index 2d510ad750ed..6b0405e578c1 100644 > --- a/include/linux/perf_event.h > +++ b/include/linux/perf_event.h > @@ -1237,6 +1237,14 @@ extern void perf_even

Re: [PATCH 05/15] perf: Track guest callbacks on a per-CPU basis

2021-08-27 Thread Peter Zijlstra
On Fri, Aug 27, 2021 at 02:49:50PM +, Sean Christopherson wrote: > On Fri, Aug 27, 2021, Peter Zijlstra wrote: > > On Thu, Aug 26, 2021 at 05:57:08PM -0700, Sean Christopherson wrote: > > > Use a per-CPU pointer to track perf's guest callbacks so that KVM can set &

Re: [PATCH 00/15] perf: KVM: Fix, optimize, and clean up callbacks

2021-08-27 Thread Peter Zijlstra
On Fri, Aug 27, 2021 at 04:01:45PM +0800, Like Xu wrote: > On 27/8/2021 3:44 pm, Peter Zijlstra wrote: > > You just have to make sure all static_call() invocations that started > > before unreg are finished before continuing with the unload. > > synchronize_rcu() can help w

Re: [PATCH 00/15] perf: KVM: Fix, optimize, and clean up callbacks

2021-08-27 Thread Peter Zijlstra
On Fri, Aug 27, 2021 at 02:52:25PM +0800, Like Xu wrote: > + STATIC BRANCH/CALL friends. > > On 27/8/2021 8:57 am, Sean Christopherson wrote: > > This started out as a small series[1] to fix a KVM bug related to Intel PT > > interrupt handling and snowballed horribly. > > > > The main problem bei

Re: [PATCH 11/15] KVM: x86: Move Intel Processor Trace interrupt handler to vmx.c

2021-08-27 Thread Peter Zijlstra
On Thu, Aug 26, 2021 at 05:57:14PM -0700, Sean Christopherson wrote: > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 13c4f58a75e5..e0b1c9386926 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -5498,6 +5498,7 @@ void kvm_set_intel_pt_intr_handler(void > (*handle

Re: [PATCH 07/15] KVM: Use dedicated flag to track if KVM is handling an NMI from guest

2021-08-27 Thread Peter Zijlstra
On Thu, Aug 26, 2021 at 05:57:10PM -0700, Sean Christopherson wrote: > diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h > index 5cedc0e8a5d5..4c5ba4128b38 100644 > --- a/arch/x86/kvm/x86.h > +++ b/arch/x86/kvm/x86.h > @@ -395,9 +395,10 @@ static inline void kvm_unregister_perf_callbacks(void) >

Re: [PATCH 06/15] KVM: x86: Register perf callbacks only when actively handling interrupt

2021-08-27 Thread Peter Zijlstra
On Thu, Aug 26, 2021 at 05:57:09PM -0700, Sean Christopherson wrote: > diff --git a/kernel/events/core.c b/kernel/events/core.c > index 9bc1375d6ed9..2f28d9d8dc94 100644 > --- a/kernel/events/core.c > +++ b/kernel/events/core.c > @@ -6485,6 +6485,18 @@ static void perf_pending_event(struct irq_work

Re: [PATCH 05/15] perf: Track guest callbacks on a per-CPU basis

2021-08-27 Thread Peter Zijlstra
On Thu, Aug 26, 2021 at 05:57:08PM -0700, Sean Christopherson wrote: > Use a per-CPU pointer to track perf's guest callbacks so that KVM can set > the callbacks more precisely and avoid a lurking NULL pointer dereference. I'm completely failing to see how per-cpu helps anything here... > On x86,

Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

2021-07-02 Thread Peter Zijlstra
On Fri, Jul 02, 2021 at 09:00:22AM -0700, Joe Perches wrote: > On Fri, 2021-07-02 at 13:22 +0200, Peter Zijlstra wrote: > > On Tue, Jun 22, 2021 at 05:42:49PM +0800, Zhu Lingshan wrote: > > > diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c > []

Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks

2021-07-02 Thread Peter Zijlstra
On Tue, Jun 22, 2021 at 05:42:49PM +0800, Zhu Lingshan wrote: > diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c > index 8f71dd72ef95..c71af4cfba9b 100644 > --- a/arch/x86/events/core.c > +++ b/arch/x86/events/core.c > @@ -90,6 +90,27 @@ DEFINE_STATIC_CALL_NULL(x86_pmu_pebs_aliases, >

Re: [RFC][PATCH] kvm: add suspend pm-notifier

2021-06-03 Thread Peter Zijlstra
On Fri, Jun 04, 2021 at 01:43:15AM +0900, Sergey Senozhatsky wrote: > Add KVM suspend/hibernate PM-notifier which lets architectures > to implement arch-specific VM suspend code. For instance, on x86 > this sets PVCLOCK_GUEST_STOPPED on all the VCPUs. > > Our case is that user puts the host system

Re: [PATCH 4/5] kvm: Replace vcpu->swait with rcuwait

2020-04-23 Thread Peter Zijlstra
: > > 1) Davidlohr, please post only patches 1-3 to "equalize" the swait and > rcuwait APIs. > > 2) Peter, please prepare a topic branch for those, or provide Acked-by I don't think I have anything that conflicts with this, so sure, take the whole thing throug

Re: [PATCH V2] mm: Introduce GFP_PGTABLE

2019-01-16 Thread Peter Zijlstra
On Wed, Jan 16, 2019 at 04:30:18AM -0800, Matthew Wilcox wrote: > On Wed, Jan 16, 2019 at 07:57:03AM +0100, Michal Hocko wrote: > > On Wed 16-01-19 11:51:32, Anshuman Khandual wrote: > > > All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL > > > | > > > __GFP_ZERO) and using

Re: [PATCH 1/4] treewide: remove unused address argument from pte_alloc functions (v2)

2018-10-27 Thread Peter Zijlstra
On Wed, Oct 24, 2018 at 07:21:19PM -0700, Joel Fernandes wrote: > On Wed, Oct 24, 2018 at 10:37:16AM +0200, Peter Zijlstra wrote: > > On Fri, Oct 12, 2018 at 06:31:57PM -0700, Joel Fernandes (Google) wrote: > > > This series speeds up mremap(2) syscall by copying page tables at t

Re: [PATCH 1/4] treewide: remove unused address argument from pte_alloc functions (v2)

2018-10-27 Thread Peter Zijlstra
On Thu, Oct 25, 2018 at 01:47:03PM +0300, Kirill A. Shutemov wrote: > On Wed, Oct 24, 2018 at 10:37:16AM +0200, Peter Zijlstra wrote: > > On Fri, Oct 12, 2018 at 06:31:57PM -0700, Joel Fernandes (Google) wrote: > > > This series speeds up mremap(2) syscall by copying page table

Re: [PATCH 1/4] treewide: remove unused address argument from pte_alloc functions (v2)

2018-10-24 Thread Peter Zijlstra
On Fri, Oct 12, 2018 at 06:31:57PM -0700, Joel Fernandes (Google) wrote: > This series speeds up mremap(2) syscall by copying page tables at the > PMD level even for non-THP systems. There is concern that the extra > 'address' argument that mremap passes to pte_alloc may do something > subtle archi

Re: [PATCH v6 17/18] mm/memory-failure: increase queued recovery work's priority

2018-10-16 Thread Peter Zijlstra
On Mon, Oct 15, 2018 at 06:49:13PM +0200, Borislav Petkov wrote: > On Fri, Sep 21, 2018 at 11:17:04PM +0100, James Morse wrote: > > @@ -1463,11 +1465,14 @@ void memory_failure_queue(unsigned long pfn, int > > flags) > > > > mf_cpu = &get_cpu_var(memory_failure_cpu); > > spin_lock_irqsave

Re: [PATCH v11 02/19] thread_info: Add update_thread_flag() helpers

2018-05-24 Thread Peter Zijlstra
gt; Signed-off-by: Dave Martin > Reviewed-by: Alex Bennée > Acked-by: Steven Rostedt (VMware) > Acked-by: Marc Zyngier > Acked-by: Catalin Marinas > Cc: Ingo Molnar Acked-by: Peter Zijlstra (Intel) ___ kvmarm mailing list kvmarm@li