Re: [patch 16/18] x86/apic: Convert 32bit to IPI shorthand static key

2019-07-03 Thread Nadav Amit
> On Jul 3, 2019, at 1:34 PM, Thomas Gleixner wrote: > > Nadav, > > On Wed, 3 Jul 2019, Nadav Amit wrote: >>> On Jul 3, 2019, at 3:54 AM, Thomas Gleixner wrote: >>> void default_send_IPI_all(int vector) >>> { >>> - if (apic_ipi_

Re: [Xen-devel] [PATCH v2 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently

2019-07-03 Thread Nadav Amit
> On Jul 3, 2019, at 10:43 AM, Andrew Cooper wrote: > > On 03/07/2019 18:02, Nadav Amit wrote: >>> On Jul 3, 2019, at 7:04 AM, Juergen Gross wrote: >>> >>> On 03.07.19 01:51, Nadav Amit wrote: >>>> To improve TLB shootdown performance, f

Re: [patch 16/18] x86/apic: Convert 32bit to IPI shorthand static key

2019-07-03 Thread Nadav Amit
would allow to remove potentially unnecessary checks in native_send_call_func_ipi()I also have this patch I still did not send to slightly improve the test in native_send_call_func_ipi(). -- >8 -- From: Nadav Amit Date: Fri, 7 Jun 2019 15:11:44 -0700 Subject: [PATCH] x86/smp: Better check of allbutself Introduce f

Re: [PATCH v2 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently

2019-07-03 Thread Nadav Amit
> On Jul 3, 2019, at 7:04 AM, Juergen Gross wrote: > > On 03.07.19 01:51, Nadav Amit wrote: >> To improve TLB shootdown performance, flush the remote and local TLBs >> concurrently. Introduce flush_tlb_multi() that does so. Introduce >> paravirtual versions of flush_t

[PATCH v2 3/9] x86/mm/tlb: Open-code on_each_cpu_cond_mask() for tlb_is_not_lazy()

2019-07-03 Thread Nadav Amit
: Nadav Amit --- arch/x86/mm/tlb.c | 40 ++-- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 8a957b58525f..5c9b1607191d 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -658,11 +658,13 @@ static

[PATCH v2 6/9] x86/mm/tlb: Do not make is_lazy dirty for no reason

2019-07-03 Thread Nadav Amit
: Nadav Amit --- arch/x86/mm/tlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 9bd24aecbd58..b47a71820f35 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -322,7 +322,8 @@ void switch_mm_irqs_off(struct mm_struct *prev

[PATCH v2 2/9] x86/mm/tlb: Remove reason as argument for flush_tlb_func_local()

2019-07-03 Thread Nadav Amit
Poimboeuf Signed-off-by: Nadav Amit --- arch/x86/mm/tlb.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 91f6db92554c..8a957b58525f 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -635,9 +635,12 @@ static void

[PATCH v2 7/9] cpumask: Mark functions as pure

2019-07-03 Thread Nadav Amit
cpumask_next_and() and cpumask_any_but() are pure, and marking them as such seems to generate different and presumably better code for native_flush_tlb_multi(). Signed-off-by: Nadav Amit --- include/linux/cpumask.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH v2 5/9] x86/mm/tlb: Privatize cpu_tlbstate

2019-07-03 Thread Nadav Amit
-off-by: Nadav Amit --- arch/x86/include/asm/tlbflush.h | 39 ++--- arch/x86/mm/init.c | 2 +- arch/x86/mm/tlb.c | 15 - 3 files changed, 31 insertions(+), 25 deletions(-) diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86

[PATCH v2 9/9] x86/mm/tlb: Remove unnecessary uses of the inline keyword

2019-07-03 Thread Nadav Amit
The compiler is smart enough without these hints. Cc: Andy Lutomirski Cc: Peter Zijlstra Suggested-by: Dave Hansen Signed-off-by: Nadav Amit --- arch/x86/mm/tlb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index

[PATCH v2 8/9] x86/mm/tlb: Remove UV special case

2019-07-03 Thread Nadav Amit
SGI UV support is outdated and not maintained, and it is not clear how it performs relatively to non-UV. Remove the code to simplify the code. Cc: Peter Zijlstra Cc: Dave Hansen Suggested-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/mm/tlb.c | 25 - 1

[PATCH v2 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently

2019-07-03 Thread Nadav Amit
ists.linux-foundation.org Cc: k...@vger.kernel.org Cc: xen-de...@lists.xenproject.org Signed-off-by: Nadav Amit --- arch/x86/hyperv/mmu.c | 13 +++--- arch/x86/include/asm/paravirt.h | 6 +-- arch/x86/include/asm/paravirt_types.h | 4 +- arch/x86/include/asm/tlbflush.h | 9

[PATCH v2 0/9] x86: Concurrent TLB flushes

2019-07-03 Thread Nadav Amit
el.org Cc: linux-kernel@vger.kernel.org Cc: virtualizat...@lists.linux-foundation.org Cc: x...@kernel.org Cc: xen-de...@lists.xenproject.org Nadav Amit (9): smp: Run functions concurrently in smp_call_function_many() x86/mm/tlb: Remove reason as argument for flush_tlb_func_local() x86/m

[PATCH v2 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-03 Thread Nadav Amit
Cc: Dave Hansen Cc: Rik van Riel Cc: Thomas Gleixner Cc: Andy Lutomirski Cc: Josh Poimboeuf Signed-off-by: Nadav Amit --- include/linux/smp.h | 27 ++--- kernel/smp.c| 133 +--- 2 files changed, 83 insertions(+), 77 deletions(-) diff --git

[PATCH] vmw_balloon: Remove Julien from the maintainers list

2019-07-02 Thread Nadav Amit
Julien will not be a maintainer anymore. Signed-off-by: Nadav Amit --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 01a52fc964da..f85874b1e653 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16886,7 +16886,6 @@ F: drivers/vme/ F

Re: [PATCH] x86/ldt: Initialize the context lock for init_mm

2019-07-01 Thread Nadav Amit
\ > .context = {\ > .ctx_id = 1,\ > + .lock = __MUTEX_INITIALIZER(mm.context.lock), \ Sorry for my mistake. Thanks for fixing it up. I find it useful to know how the problem was found or what the impact was - helps me sometimes to avoid causing similar bugs in the future. Reviewed-by: Nadav Amit

Re: [PATCH 5/9] x86/mm/tlb: Optimize local TLB flushes

2019-06-26 Thread Nadav Amit
> On Jun 26, 2019, at 9:33 AM, Andy Lutomirski wrote: > > On Tue, Jun 25, 2019 at 2:36 PM Dave Hansen wrote: >> On 6/12/19 11:48 PM, Nadav Amit wrote: >>> While the updated smp infrastructure is capable of running a function on >>> a single local core,

Re: [PATCH 6/9] KVM: x86: Provide paravirtualized flush_tlb_multi()

2019-06-25 Thread Nadav Amit
> On Jun 25, 2019, at 8:56 PM, Andy Lutomirski wrote: > > On Tue, Jun 25, 2019 at 8:41 PM Nadav Amit wrote: >>> On Jun 25, 2019, at 8:35 PM, Andy Lutomirski wrote: >>> >>> On Tue, Jun 25, 2019 at 7:39 PM Nadav Amit wrote: >>>>> On Jun 25, 20

Re: [PATCH 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently

2019-06-25 Thread Nadav Amit
> On Jun 25, 2019, at 8:36 PM, Andy Lutomirski wrote: > > On Wed, Jun 12, 2019 at 11:49 PM Nadav Amit wrote: >> To improve TLB shootdown performance, flush the remote and local TLBs >> concurrently. Introduce flush_tlb_multi() that does so. The current >> flush_tlb

Re: [PATCH 6/9] KVM: x86: Provide paravirtualized flush_tlb_multi()

2019-06-25 Thread Nadav Amit
> On Jun 25, 2019, at 8:35 PM, Andy Lutomirski wrote: > > On Tue, Jun 25, 2019 at 7:39 PM Nadav Amit wrote: >>> On Jun 25, 2019, at 2:40 PM, Dave Hansen wrote: >>> >>> On 6/12/19 11:48 PM, Nadav Amit wrote: >>>> Support the new interface of fl

Re: [PATCH 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently

2019-06-25 Thread Nadav Amit
> On Jun 25, 2019, at 8:00 PM, Dave Hansen wrote: > > On 6/25/19 7:35 PM, Nadav Amit wrote: >>>> const struct flush_tlb_info *f = info; >>>> + enum tlb_flush_reason reason; >>>> + >>>> + reason = (f->mm == NULL) ? TLB_LOCAL_SHOOTDO

Re: [PATCH 6/9] KVM: x86: Provide paravirtualized flush_tlb_multi()

2019-06-25 Thread Nadav Amit
> On Jun 25, 2019, at 2:40 PM, Dave Hansen wrote: > > On 6/12/19 11:48 PM, Nadav Amit wrote: >> Support the new interface of flush_tlb_multi, which also flushes the >> local CPU's TLB, instead of flush_tlb_others that does not. This >> interface is more performant

Re: [PATCH 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently

2019-06-25 Thread Nadav Amit
> On Jun 25, 2019, at 2:29 PM, Dave Hansen wrote: > > On 6/12/19 11:48 PM, Nadav Amit wrote: >> To improve TLB shootdown performance, flush the remote and local TLBs >> concurrently. Introduce flush_tlb_multi() that does so. The current >> flush_tlb_others() interface

Re: [PATCH 3/9] x86/mm/tlb: Refactor common code into flush_tlb_on_cpus()

2019-06-25 Thread Nadav Amit
> On Jun 25, 2019, at 2:07 PM, Dave Hansen wrote: > > On 6/12/19 11:48 PM, Nadav Amit wrote: >> diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c >> index 91f6db92554c..c34bcf03f06f 100644 >> --- a/arch/x86/mm/tlb.c >> +++ b/arch/x86/mm/tlb.c >> @@

Re: [PATCH 0/9] x86: Concurrent TLB flushes and other improvements

2019-06-25 Thread Nadav Amit
> On Jun 25, 2019, at 3:02 PM, Dave Hansen wrote: > > On 6/12/19 11:48 PM, Nadav Amit wrote: >> Running sysbench on dax w/emulated-pmem, write-cache disabled, and >> various mitigations (PTI, Spectre, MDS) disabled on Haswell: >> >> sysbench fileio --file-tot

Re: [PATCH 8/9] x86/tlb: Privatize cpu_tlbstate

2019-06-25 Thread Nadav Amit
> On Jun 25, 2019, at 2:52 PM, Dave Hansen wrote: > > On 6/12/19 11:48 PM, Nadav Amit wrote: >> cpu_tlbstate is mostly private and only the variable is_lazy is shared. >> This causes some false-sharing when TLB flushes are performed. > > Presumably, all CPUs doin

[tip:smp/hotplug] smp: Remove smp_call_function() and on_each_cpu() return values

2019-06-23 Thread tip-bot for Nadav Amit
Commit-ID: caa759323c73676b3e48c8d9c86093c88b4aba97 Gitweb: https://git.kernel.org/tip/caa759323c73676b3e48c8d9c86093c88b4aba97 Author: Nadav Amit AuthorDate: Wed, 12 Jun 2019 23:48:05 -0700 Committer: Thomas Gleixner CommitDate: Sun, 23 Jun 2019 14:26:26 +0200 smp: Remove

[tip:smp/hotplug] smp: Do not mark call_function_data as shared

2019-06-23 Thread tip-bot for Nadav Amit
Commit-ID: a22793c79d6ea0a492ce1a308ec46df52ee9406e Gitweb: https://git.kernel.org/tip/a22793c79d6ea0a492ce1a308ec46df52ee9406e Author: Nadav Amit AuthorDate: Wed, 12 Jun 2019 23:48:11 -0700 Committer: Thomas Gleixner CommitDate: Sun, 23 Jun 2019 14:26:25 +0200 smp: Do not mark

[tip:x86/apic] x86/apic: Use non-atomic operations when possible

2019-06-23 Thread tip-bot for Nadav Amit
Commit-ID: dde3626f815e38bbf96fddd5185038c4b4d395a8 Gitweb: https://git.kernel.org/tip/dde3626f815e38bbf96fddd5185038c4b4d395a8 Author: Nadav Amit AuthorDate: Wed, 12 Jun 2019 23:48:13 -0700 Committer: Thomas Gleixner CommitDate: Sun, 23 Jun 2019 14:07:23 +0200 x86/apic: Use non

Re: [PATCH] ARC: ARCv2: jump label: implement jump label patching

2019-06-21 Thread Nadav Amit
> On Jun 21, 2019, at 5:12 AM, Peter Zijlstra wrote: > > On Fri, Jun 21, 2019 at 02:09:23PM +0200, Peter Zijlstra wrote: > >> --- /dev/null >> +++ b/arch/x86/include/asm/jump_label_asm.h >> @@ -0,0 +1,44 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +#ifndef _ASM_X86_JUMP_LABEL_ASM_H >> +#def

Re: [PATCH 3/3] resource: Introduce resource cache

2019-06-19 Thread Nadav Amit
> On Jun 19, 2019, at 6:00 AM, Bjorn Helgaas wrote: > > On Tue, Jun 18, 2019 at 12:40 AM Nadav Amit wrote: >>> On Jun 17, 2019, at 10:33 PM, Nadav Amit wrote: >>> >>>> On Jun 17, 2019, at 9:57 PM, Andrew Morton >>>> wrote: >>>

Re: [PATCH 0/3] resource: find_next_iomem_res() improvements

2019-06-18 Thread Nadav Amit
> On Jun 18, 2019, at 11:30 AM, Dan Williams wrote: > > On Tue, Jun 18, 2019 at 10:42 AM Nadav Amit wrote: >>> On Jun 17, 2019, at 11:44 PM, Dan Williams wrote: >>> >>> On Wed, Jun 12, 2019 at 9:59 PM Nadav Amit wrote: >>>> R

Re: [PATCH 0/3] resource: find_next_iomem_res() improvements

2019-06-18 Thread Nadav Amit
> On Jun 17, 2019, at 11:44 PM, Dan Williams wrote: > > On Wed, Jun 12, 2019 at 9:59 PM Nadav Amit wrote: >> Running some microbenchmarks on dax keeps showing find_next_iomem_res() >> as a place in which significant amount of time is spent. It appears that >>

Re: [PATCH 3/3] resource: Introduce resource cache

2019-06-17 Thread Nadav Amit
> On Jun 17, 2019, at 9:57 PM, Andrew Morton wrote: > > On Wed, 12 Jun 2019 21:59:03 -0700 Nadav Amit wrote: > >> For efficient search of resources, as needed to determine the memory >> type for dax page-faults, introduce a cache of the most recently used >> top-l

Re: [PATCH 3/3] resource: Introduce resource cache

2019-06-17 Thread Nadav Amit
> On Jun 17, 2019, at 10:33 PM, Nadav Amit wrote: > >> On Jun 17, 2019, at 9:57 PM, Andrew Morton wrote: >> >> On Wed, 12 Jun 2019 21:59:03 -0700 Nadav Amit wrote: >> >>> For efficient search of resources, as needed to determine the memory >>>

Re: [PATCH] modules: fix BUG when load module with rodata=n

2019-06-17 Thread Nadav Amit
o *info) > > module_enable_ro(mod, false); > module_enable_nx(mod); > + module_enable_x(mod); > > /* Mark state as coming so strong_try_module_get() ignores us, >* but kallsyms etc. can see us. */ > -- > 2.17.1 It does seem that I screwed up (thanks for fixing it!). Makes me wonder why module_enable_ro() is needed to be called twice (excluding the write-protecting of the core_layout). I wonder since this patch would eliminate some calls to set_memory_x(), which indeed do not seem necessary. Skimming 444d13ff10fb1 ("modules: add ro_after_init support”), I could not understand why. Anyhow, Reviewed-by: Nadav Amit

Re: [PATCH 1/3] resource: Fix locking in find_next_iomem_res()

2019-06-17 Thread Nadav Amit
> On Jun 17, 2019, at 5:55 PM, Sasha Levin wrote: > > On Mon, Jun 17, 2019 at 07:14:53PM +0000, Nadav Amit wrote: >>> On Jun 15, 2019, at 3:15 PM, Sasha Levin wrote: >>> >>> Hi, >>> >>> [This is an automated email] >>> >&g

Re: [PATCH 1/3] resource: Fix locking in find_next_iomem_res()

2019-06-17 Thread Nadav Amit
a98959fdbda1 ("resource: Include resource end in walk_*() interfaces") >da6658859b9c ("powerpc: Change places using CONFIG_KEXEC to use > CONFIG_KEXEC_CORE instead.") >ec2b9bfaac44 ("kexec_file: Change kexec_add_buffer to take kexec_buf as > argument.&qu

Re: [RFC 00/10] Process-local memory allocations for hiding KVM secrets

2019-06-17 Thread Nadav Amit
> On Jun 17, 2019, at 11:07 AM, Dave Hansen wrote: > > On 6/17/19 9:53 AM, Nadav Amit wrote: >>>> For anyone following along at home, I'm going to go off into crazy >>>> per-cpu-pgds speculation mode now... Feel free to stop reading now. :) >>>>

Re: [PATCH 3/3] resource: Introduce resource cache

2019-06-17 Thread Nadav Amit
> On Jun 15, 2019, at 3:16 PM, Sasha Levin wrote: > > Hi, > > [This is an automated email] > > This commit has been processed because it contains a "Fixes:" tag, > fixing commit: ff3cc952d3f0 resource: Add remove_resource interface. This commit (Patch 3/3) does not have the “Fixes:” tag (and i

Re: [PATCH 8/9] x86/tlb: Privatize cpu_tlbstate

2019-06-17 Thread Nadav Amit
> On Jun 14, 2019, at 8:58 AM, Sean Christopherson > wrote: > > On Wed, Jun 12, 2019 at 11:48:12PM -0700, Nadav Amit wrote: >> diff --git a/arch/x86/include/asm/tlbflush.h >> b/arch/x86/include/asm/tlbflush.h >> index 79272938cf79..a1fea36d5292 100644 >> -

Re: [PATCH 08/15] x86/alternatives: Teach text_poke_bp() to emulate instructions

2019-06-17 Thread Nadav Amit
> On Jun 17, 2019, at 7:42 AM, Peter Zijlstra wrote: > > On Wed, Jun 12, 2019 at 07:44:12PM +0000, Nadav Amit wrote: > >> I have run into similar problems before. >> >> I had two problematic scenarios. In the first case, I had a “call” in the >> middle of t

Re: [RFC 00/10] Process-local memory allocations for hiding KVM secrets

2019-06-17 Thread Nadav Amit
> On Jun 17, 2019, at 9:14 AM, Andy Lutomirski wrote: > > On Mon, Jun 17, 2019 at 9:09 AM Dave Hansen wrote: >> On 6/17/19 8:54 AM, Andy Lutomirski wrote: > Would that mean that with Meltdown affected CPUs we open speculation > attacks against the mmlocal memory from KVM user space?

Re: [PATCH v2 0/5] x86/percpu semantics and fixes

2019-06-13 Thread Nadav Amit
> On Jun 13, 2019, at 6:54 AM, Peter Zijlstra wrote: > > Hi all, > > I still have these patches sitting in my queue and figured I'd repost them. > > Last time Linus proposed a "+m" alternative approach, but that generates far > far worse code (I've lost the patch and not re-ran those numbers, b

Re: [RFC 00/10] Process-local memory allocations for hiding KVM secrets

2019-06-13 Thread Nadav Amit
> On Jun 13, 2019, at 9:20 AM, Dave Hansen wrote: > > On 6/13/19 9:13 AM, Andy Lutomirski wrote: >>> It might make sense to use it for kmap_atomic() for debug purposes, as >>> it ensures that other users can no longer access the same mapping >>> through the linear map. However, it does come at qu

Re: [RFC 00/10] Process-local memory allocations for hiding KVM secrets

2019-06-13 Thread Nadav Amit
> On Jun 12, 2019, at 6:30 PM, Andy Lutomirski wrote: > > On Wed, Jun 12, 2019 at 1:27 PM Andy Lutomirski wrote: >>> On Jun 12, 2019, at 12:55 PM, Dave Hansen wrote: >>> On 6/12/19 10:08 AM, Marius Hillenbrand wrote: This patch series proposes to introduce a region for what we call >

[PATCH 1/3] resource: Fix locking in find_next_iomem_res()

2019-06-13 Thread Nadav Amit
informative value. It is disregarded by the callers. Fixes: ff3cc952d3f00 ("resource: Add remove_resource interface") Cc: sta...@vger.kernel.org Cc: Borislav Petkov Cc: Toshi Kani Cc: Peter Zijlstra Cc: Dave Hansen Cc: Dan Williams Cc: Bjorn Helgaas Cc: Ingo Molnar Signed-off-by:

[PATCH 2/3] resource: Avoid unnecessary lookups in find_next_iomem_res()

2019-06-13 Thread Nadav Amit
: 1247669./16075.39 w/patch: 1286320.5000/16402.72 (+3%) Cc: Borislav Petkov Cc: Toshi Kani Cc: Peter Zijlstra Cc: Dave Hansen Cc: Dan Williams Cc: Bjorn Helgaas Cc: Ingo Molnar Signed-off-by: Nadav Amit --- kernel/resource.c | 29 ++--- 1 file changed, 22

[PATCH 0/3] resource: find_next_iomem_res() improvements

2019-06-13 Thread Nadav Amit
%) Cc: Borislav Petkov Cc: Toshi Kani Cc: Peter Zijlstra Cc: Dave Hansen Cc: Dan Williams Cc: Bjorn Helgaas Cc: Ingo Molnar Nadav Amit (3): resource: Fix locking in find_next_iomem_res() resource: Avoid unnecessary lookups in find_next_iomem_res() resource: Introduce resource cache

[PATCH 3/3] resource: Introduce resource cache

2019-06-13 Thread Nadav Amit
sysbench), but can benefit systems with many resources. Cc: Borislav Petkov Cc: Toshi Kani Cc: Peter Zijlstra Cc: Dave Hansen Cc: Dan Williams Cc: Bjorn Helgaas Cc: Ingo Molnar Signed-off-by: Nadav Amit --- kernel/resource.c | 51 +-- 1 file

[PATCH 3/9] x86/mm/tlb: Refactor common code into flush_tlb_on_cpus()

2019-06-13 Thread Nadav Amit
Zijlstra Signed-off-by: Nadav Amit --- arch/x86/mm/tlb.c | 62 ++- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 91f6db92554c..c34bcf03f06f 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm

[PATCH 5/9] x86/mm/tlb: Optimize local TLB flushes

2019-06-13 Thread Nadav Amit
: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86/mm/tlb.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index db73d5f1dd43..ceb03b8cad32 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -815,8 +815,12 @@ static

[PATCH 0/9] x86: Concurrent TLB flushes and other improvements

2019-06-13 Thread Nadav Amit
lidation optimizations [Andy] * Adding KVM support [Paolo] Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Tony Luck Cc: Fenghua Yu Cc: Andrew Morton Cc: Peter Zijlstra Cc: Dave Hansen Cc: Rik van Riel Cc: Thomas Gleixner Cc: Andy Lutomirski Cc: Josh Poimboeuf Cc: Paolo Bonzini

[PATCH 1/9] smp: Remove smp_call_function() and on_each_cpu() return values

2019-06-13 Thread Nadav Amit
The return value is fixed. Remove it and amend the callers. Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Tony Luck Cc: Fenghua Yu Cc: Andrew Morton Signed-off-by: Nadav Amit --- arch/alpha/kernel/smp.c | 19 +-- arch/alpha/oprofile/common.c | 6

[PATCH 8/9] x86/tlb: Privatize cpu_tlbstate

2019-06-13 Thread Nadav Amit
-off-by: Nadav Amit --- arch/x86/include/asm/tlbflush.h | 40 ++--- arch/x86/mm/init.c | 2 +- arch/x86/mm/tlb.c | 15 - 3 files changed, 32 insertions(+), 25 deletions(-) diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86

[PATCH 6/9] KVM: x86: Provide paravirtualized flush_tlb_multi()

2019-06-13 Thread Nadav Amit
at of flush_tlb_others(). Suggested-by: Paolo Bonzini Cc: Paolo Bonzini Cc: k...@vger.kernel.org Signed-off-by: Nadav Amit --- arch/x86/kernel/kvm.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 00d81e8

[PATCH 9/9] x86/apic: Use non-atomic operations when possible

2019-06-13 Thread Nadav Amit
Using __clear_bit() and __cpumask_clear_cpu() is more efficient than using their atomic counterparts. Use them when atomicity is not needed, such as when manipulating bitmasks that are on the stack. Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86

[PATCH 2/9] smp: Run functions concurrently in smp_call_function_many()

2019-06-13 Thread Nadav Amit
Cc: Dave Hansen Cc: Rik van Riel Cc: Thomas Gleixner Cc: Andy Lutomirski Cc: Josh Poimboeuf Signed-off-by: Nadav Amit --- include/linux/smp.h | 27 ++--- kernel/smp.c| 133 +--- 2 files changed, 83 insertions(+), 77 deletions(-) diff --git

[PATCH 7/9] smp: Do not mark call_function_data as shared

2019-06-13 Thread Nadav Amit
cfd_data is marked as shared, but although it hold pointers to shared data structures, it is private per core. Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Rik van Riel Cc: Andy Lutomirski Signed-off-by: Nadav Amit --- kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently

2019-06-13 Thread Nadav Amit
org Signed-off-by: Nadav Amit --- arch/x86/hyperv/mmu.c | 2 + arch/x86/include/asm/paravirt.h | 8 +++ arch/x86/include/asm/paravirt_types.h | 6 +++ arch/x86/include/asm/tlbflush.h | 6 +++ arch/x86/kernel/kvm.c | 1 + arch/x86/kernel/

Re: [PATCH 08/15] x86/alternatives: Teach text_poke_bp() to emulate instructions

2019-06-12 Thread Nadav Amit
> On Jun 11, 2019, at 8:55 AM, Peter Zijlstra wrote: > > On Tue, Jun 11, 2019 at 11:22:54AM -0400, Steven Rostedt wrote: >> On Tue, 11 Jun 2019 10:03:07 +0200 >> Peter Zijlstra wrote: >> >> >>> So what happens is that arch_prepare_optimized_kprobe() <- >>> copy_optimized_instructions() copies

Re: [PATCH v3 0/3] KVM: Yield to IPI target if necessary

2019-06-11 Thread Nadav Amit
> On Jun 11, 2019, at 6:18 PM, Wanpeng Li wrote: > > On Wed, 12 Jun 2019 at 00:57, Nadav Amit wrote: >>> On Jun 11, 2019, at 3:02 AM, Wanpeng Li wrote: >>> >>> On Tue, 11 Jun 2019 at 09:48, Nadav Amit wrote: >>>>> On Jun 10, 2019, at 6:45

Re: [PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure

2019-06-11 Thread Nadav Amit
> On Jun 11, 2019, at 5:52 PM, Nicholas Piggin wrote: > > Christoph Hellwig's on June 12, 2019 12:41 am: >> Instead of passing a set of always repeated arguments down the >> get_user_pages_fast iterators, create a struct gup_args to hold them and >> pass that by reference. This leads to an over

Re: [PATCH] vmw_ballon: no need to check return value of debugfs_create functions

2019-06-11 Thread Nadav Amit
de logic should > never do something different based on this. I remember I saw a discussion about it, and didn’t know the resolution. If that's the decision (assuming debugfs initialization always succeeds), and after fixing the title of the patch: Acked-by: Nadav Amit Thanks! Nadav

Re: [PATCH v4 3/9] mm: Add write-protect and clean utilities for address space ranges

2019-06-11 Thread Nadav Amit
> On Jun 11, 2019, at 5:24 AM, Thomas Hellström (VMware) > wrote: > > From: Thomas Hellstrom > [ snip ] > +/** > + * apply_pt_wrprotect - Leaf pte callback to write-protect a pte > + * @pte: Pointer to the pte > + * @token: Page table token, see apply_to_pfn_range() > + * @addr: The virtual

Re: [PATCH v3 0/3] KVM: Yield to IPI target if necessary

2019-06-11 Thread Nadav Amit
> On Jun 11, 2019, at 3:02 AM, Wanpeng Li wrote: > > On Tue, 11 Jun 2019 at 09:48, Nadav Amit wrote: >>> On Jun 10, 2019, at 6:45 PM, Wanpeng Li wrote: >>> >>> On Tue, 11 Jun 2019 at 09:11, Sean Christopherson >>> wrote: >>>> On

Re: [PATCH v3 0/3] KVM: Yield to IPI target if necessary

2019-06-10 Thread Nadav Amit
> On Jun 10, 2019, at 6:45 PM, Wanpeng Li wrote: > > On Tue, 11 Jun 2019 at 09:11, Sean Christopherson > wrote: >> On Mon, Jun 10, 2019 at 04:34:20PM +0200, Radim Krčmář wrote: >>> 2019-05-30 09:05+0800, Wanpeng Li: The idea is from Xen, when sending a call-function IPI-many to vCPUs,

Re: [PATCH 13/15] x86/static_call: Add inline static call implementation for x86-64

2019-06-10 Thread Nadav Amit
> On Jun 10, 2019, at 11:55 AM, Josh Poimboeuf wrote: > > On Mon, Jun 10, 2019 at 06:45:52PM +0000, Nadav Amit wrote: >>> On Jun 10, 2019, at 11:33 AM, Josh Poimboeuf wrote: >>> >>> On Wed, Jun 05, 2019 at 03:08:06PM +0200, Peter Zijlstra wrote: >>&

Re: [PATCH 13/15] x86/static_call: Add inline static call implementation for x86-64

2019-06-10 Thread Nadav Amit
> On Jun 10, 2019, at 11:33 AM, Josh Poimboeuf wrote: > > On Wed, Jun 05, 2019 at 03:08:06PM +0200, Peter Zijlstra wrote: >> --- a/arch/x86/include/asm/static_call.h >> +++ b/arch/x86/include/asm/static_call.h >> @@ -2,6 +2,20 @@ >> #ifndef _ASM_STATIC_CALL_H >> #define _ASM_STATIC_CALL_H >> >>

Re: [PATCH 11/15] static_call: Add inline static call infrastructure

2019-06-10 Thread Nadav Amit
> On Jun 10, 2019, at 10:19 AM, Josh Poimboeuf wrote: > > On Fri, Jun 07, 2019 at 10:37:56AM +0200, Peter Zijlstra wrote: +} + +static int static_call_module_notify(struct notifier_block *nb, + unsigned long val, void *data) +{ + struct

Re: kprobe: kernel panic in 4.19.47

2019-06-07 Thread Nadav Amit
There are a couple of patches that were mistakenly not included in 4.19.47. https://lore.kernel.org/stable/20190606131558.GJ29739@sasha-vm/ Sorry for that and thanks for reporting. Regards, Nadav > On Jun 7, 2019, at 4:54 PM, Francesco Ruggeri wrote: > > I see the following kernel panic in 4.

Re: [PATCH 10/15] static_call: Add basic static call infrastructure

2019-06-07 Thread Nadav Amit
> On Jun 7, 2019, at 1:49 AM, Ard Biesheuvel wrote: > > On Fri, 7 Jun 2019 at 10:29, Peter Zijlstra wrote: >> On Thu, Jun 06, 2019 at 10:44:23PM +0000, Nadav Amit wrote: >>>> + * Usage example: >>>> + * >>>> + * # Start with the following fu

Re: [bug report][stable] kernel tried to execute NX-protected page - exploit attempt? (uid: 0)

2019-06-07 Thread Nadav Amit
> On Jun 7, 2019, at 3:24 AM, Joseph Qi wrote: > > Hi all, > Any idea on this regression? Sorry for the late response (I assumed, for some reason, that you also follow the second thread about this issue). Anyhow, it should be fixed by backporting some patches which were mistakenly missed. Se

Re: [PATCH 11/15] static_call: Add inline static call infrastructure

2019-06-07 Thread Nadav Amit
> On Jun 7, 2019, at 1:37 AM, Peter Zijlstra wrote: > > On Thu, Jun 06, 2019 at 10:24:17PM +0000, Nadav Amit wrote: > >>> +static void static_call_del_module(struct module *mod) >>> +{ >>> + struct static_call_site *start = mod->static_call_sites; &

Re: [PATCH 12/15] x86/static_call: Add out-of-line static call implementation

2019-06-06 Thread Nadav Amit
> On Jun 5, 2019, at 6:08 AM, Peter Zijlstra wrote: > > From: Josh Poimboeuf > > Add the x86 out-of-line static call implementation. For each key, a > permanent trampoline is created which is the destination for all static > calls for the given key. The trampoline has a direct jump which gets

Re: [PATCH 13/15] x86/static_call: Add inline static call implementation for x86-64

2019-06-06 Thread Nadav Amit
> On Jun 5, 2019, at 6:08 AM, Peter Zijlstra wrote: > > From: Josh Poimboeuf > > Add the inline static call implementation for x86-64. For each key, a > temporary trampoline is created, named __static_call_tramp_. The > trampoline has an indirect jump to the destination function. > > Objtool

Re: [PATCH 08/15] x86/alternatives: Teach text_poke_bp() to emulate instructions

2019-06-06 Thread Nadav Amit
> This fits almost all text_poke_bp() users, except > arch_unoptimize_kprobe() which restores random text, and for that site > we have to build an explicit emulate instruction. > > Cc: Daniel Bristot de Oliveira > Cc: Nadav Amit > Signed-off-by: Peter Zijlstra (Intel) > --- > arch/x86/incl

Re: [RFC PATCH v2 11/12] x86/mm/tlb: Use async and inline messages for flushing

2019-06-06 Thread Nadav Amit
> On May 31, 2019, at 3:07 PM, Nadav Amit wrote: > >> On May 31, 2019, at 2:47 PM, Andy Lutomirski wrote: >> >> >> On May 31, 2019, at 2:33 PM, Nadav Amit wrote: >> >>>> On May 31, 2019, at 2:14 PM, Andy Lutomirski wrote: >>>&g

Re: [PATCH 10/15] static_call: Add basic static call infrastructure

2019-06-06 Thread Nadav Amit
Linus Torvalds > Cc: Jiri Kosina > Cc: Edward Cree > Cc: Thomas Gleixner > Cc: Masami Hiramatsu > Cc: Borislav Petkov > Cc: David Laight > Cc: Jessica Yu > Cc: Nadav Amit > Cc: Andy Lutomirski > Cc: "H. Peter Anvin" &

Re: [PATCH 11/15] static_call: Add inline static call infrastructure

2019-06-06 Thread Nadav Amit
> On Jun 5, 2019, at 6:08 AM, Peter Zijlstra wrote: > > From: Josh Poimboeuf > > Add infrastructure for an arch-specific CONFIG_HAVE_STATIC_CALL_INLINE > option, which is a faster version of CONFIG_HAVE_STATIC_CALL. At > runtime, the static call sites are patched directly, rather than using >

Re: [RFC PATCH v2 11/12] x86/mm/tlb: Use async and inline messages for flushing

2019-05-31 Thread Nadav Amit
> On May 31, 2019, at 2:47 PM, Andy Lutomirski wrote: > > > On May 31, 2019, at 2:33 PM, Nadav Amit wrote: > >>> On May 31, 2019, at 2:14 PM, Andy Lutomirski wrote: >>> >>>> On Thu, May 30, 2019 at 11:37 PM Nadav Amit wrote: >>>&g

Re: [PATCH 4.19 079/276] x86/modules: Avoid breaking W^X while loading modules

2019-05-31 Thread Nadav Amit
> On May 31, 2019, at 3:37 AM, Pavel Machek wrote: > > Hi! > >> [ Upstream commit f2c65fb3221adc6b73b0549fc7ba892022db9797 ] >> >> When modules and BPF filters are loaded, there is a time window in >> which some memory is both writable and executable. An attacker that has >> already found anoth

Re: [RFC PATCH v2 11/12] x86/mm/tlb: Use async and inline messages for flushing

2019-05-31 Thread Nadav Amit
> On May 31, 2019, at 2:14 PM, Andy Lutomirski wrote: > > On Thu, May 30, 2019 at 11:37 PM Nadav Amit wrote: >> When we flush userspace mappings, we can defer the TLB flushes, as long >> the following conditions are met: >> >> 1. No tables are freed, since

Re: [RFC PATCH v2 11/12] x86/mm/tlb: Use async and inline messages for flushing

2019-05-31 Thread Nadav Amit
> On May 31, 2019, at 1:37 PM, Andy Lutomirski wrote: > > On Fri, May 31, 2019 at 1:13 PM Dave Hansen wrote: >> On 5/31/19 12:31 PM, Nadav Amit wrote: >>>> On May 31, 2019, at 11:44 AM, Andy Lutomirski wrote: >>>> >>>> >>>

Re: [RFC PATCH v2 11/12] x86/mm/tlb: Use async and inline messages for flushing

2019-05-31 Thread Nadav Amit
> On May 31, 2019, at 12:20 PM, Jann Horn wrote: > > On Fri, May 31, 2019 at 8:29 PM Nadav Amit wrote: >> [ +Jann Horn ] >> >>> On May 31, 2019, at 3:57 AM, Peter Zijlstra wrote: >>> >>> On Thu, May 30, 2019 at 11:36:44PM -0700, Nadav Amit wrot

Re: [PATCH] x86/kgdb: return 0 from kgdb_arch_set_breakpoint

2019-05-31 Thread Nadav Amit
ernel/kgdb.c > @@ -758,7 +758,7 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt) > BREAK_INSTR_SIZE); > bpt->type = BP_POKE_BREAKPOINT; > > - return err; > + return 0; > } > > int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt) > -- > 2.17.1 My bad. Thanks for fixing it. Reviewed-by: Nadav Amit

Re: [RFC PATCH v2 04/12] x86/mm/tlb: Flush remote and local TLBs concurrently

2019-05-31 Thread Nadav Amit
> On May 31, 2019, at 4:48 AM, Juergen Gross wrote: > > On 31/05/2019 08:36, Nadav Amit wrote: >> >> --- a/arch/x86/include/asm/paravirt_types.h >> +++ b/arch/x86/include/asm/paravirt_types.h >> @@ -211,6 +211,12 @@ struct pv_mmu_ops { >> voi

Re: [RFC PATCH v2 08/12] x86/tlb: Privatize cpu_tlbstate

2019-05-31 Thread Nadav Amit
> On May 31, 2019, at 11:48 AM, Andy Lutomirski wrote: > > >> On May 30, 2019, at 11:36 PM, Nadav Amit wrote: >> >> cpu_tlbstate is mostly private and only the variable is_lazy is shared. >> This causes some false-sharing when TLB flushes are performed

Re: [RFC PATCH v2 11/12] x86/mm/tlb: Use async and inline messages for flushing

2019-05-31 Thread Nadav Amit
> On May 31, 2019, at 11:44 AM, Andy Lutomirski wrote: > > > >> On May 31, 2019, at 3:57 AM, Peter Zijlstra wrote: >> >>> On Thu, May 30, 2019 at 11:36:44PM -0700, Nadav Amit wrote: >>> When we flush userspace mappings, we can defer the TLB flushes

Re: [RFC PATCH v2 11/12] x86/mm/tlb: Use async and inline messages for flushing

2019-05-31 Thread Nadav Amit
[ +Jann Horn ] > On May 31, 2019, at 3:57 AM, Peter Zijlstra wrote: > > On Thu, May 30, 2019 at 11:36:44PM -0700, Nadav Amit wrote: >> When we flush userspace mappings, we can defer the TLB flushes, as long >> the following conditions are met: >> >> 1. No

Re: [RFC PATCH v2 07/12] smp: Do not mark call_function_data as shared

2019-05-31 Thread Nadav Amit
> On May 31, 2019, at 3:17 AM, Peter Zijlstra wrote: > > On Thu, May 30, 2019 at 11:36:40PM -0700, Nadav Amit wrote: >> cfd_data is marked as shared, but although it hold pointers to shared >> data structures, it is private per core. >> >> Cc: Peter Zijlstra &

[RFC PATCH v2 03/12] x86/mm/tlb: Refactor common code into flush_tlb_on_cpus()

2019-05-30 Thread Nadav Amit
Zijlstra Signed-off-by: Nadav Amit --- arch/x86/mm/tlb.c | 62 ++- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 7f61431c75fb..ac98ad76f695 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm

[RFC PATCH v2 04/12] x86/mm/tlb: Flush remote and local TLBs concurrently

2019-05-30 Thread Nadav Amit
org Signed-off-by: Nadav Amit --- arch/x86/hyperv/mmu.c | 2 + arch/x86/include/asm/paravirt.h | 8 +++ arch/x86/include/asm/paravirt_types.h | 6 ++ arch/x86/include/asm/tlbflush.h | 6 ++ arch/x86/kernel/kvm.c | 1 + arch/x86/kernel/paravirt.c

[RFC PATCH v2 08/12] x86/tlb: Privatize cpu_tlbstate

2019-05-30 Thread Nadav Amit
-off-by: Nadav Amit --- arch/x86/include/asm/tlbflush.h | 40 ++--- arch/x86/mm/init.c | 2 +- arch/x86/mm/tlb.c | 15 - 3 files changed, 32 insertions(+), 25 deletions(-) diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86

[RFC PATCH v2 07/12] smp: Do not mark call_function_data as shared

2019-05-30 Thread Nadav Amit
cfd_data is marked as shared, but although it hold pointers to shared data structures, it is private per core. Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Rik van Riel Cc: Andy Lutomirski Signed-off-by: Nadav Amit --- kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[RFC PATCH v2 09/12] x86/apic: Use non-atomic operations when possible

2019-05-30 Thread Nadav Amit
Using __clear_bit() and __cpumask_clear_cpu() is more efficient than using their atomic counterparts. Use them when atomicity is not needed, such as when manipulating bitmasks that are on the stack. Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86

[RFC PATCH v2 05/12] x86/mm/tlb: Optimize local TLB flushes

2019-05-30 Thread Nadav Amit
: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86/mm/tlb.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 73d0d51b0f61..b0c3065aad5d 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -823,8 +823,12 @@ static

[RFC PATCH v2 10/12] smp: Enable data inlining for inter-processor function call

2019-05-30 Thread Nadav Amit
function is executed, save in externally visible variable the function that is currently executed. This information will be needed soon for asynchronous remote TLB flushing. Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Signed-off-by: Nadav Amit --- include/linux/smp.h | 21

[RFC PATCH v2 02/12] smp: Run functions concurrently in smp_call_function_many()

2019-05-30 Thread Nadav Amit
Cc: Dave Hansen Cc: Rik van Riel Cc: Thomas Gleixner Cc: Andy Lutomirski Cc: Josh Poimboeuf Signed-off-by: Nadav Amit --- include/linux/smp.h | 27 ++--- kernel/smp.c| 133 +--- 2 files changed, 83 insertions(+), 77 deletions(-) diff --git

[RFC PATCH v2 11/12] x86/mm/tlb: Use async and inline messages for flushing

2019-05-30 Thread Nadav Amit
, although the performance gains in this case are likely to be much smaller. Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86/include/asm/tlbflush.h | 12 arch/x86/mm/tlb.c | 15 +++ 2 files changed, 23

<    1   2   3   4   5   6   7   8   9   10   >