[PATCH v6 04/10] fork: provide a function for copying init_mm

2018-11-20 Thread Nadav Amit
Provide a function for copying init_mm. This function will be later used for setting a temporary mm. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Reviewed-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Nadav Amit --- include/linux/sched/task.h | 1

[PATCH v6 02/10] x86/jump_label: Use text_poke_early() during early init

2018-11-20 Thread Nadav Amit
that would set a temporary mm for patching, which is initialized after some static-keys are enabled/disabled. Cc: Andy Lutomirski Cc: Kees Cook Cc: Dave Hansen Cc: Masami Hiramatsu Co-Developed-by: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86/kernel/jump_label.c | 7 ++- 1 file changed

[PATCH v6 07/10] x86/kgdb: avoid redundant comparison of patched code

2018-11-20 Thread Nadav Amit
text_poke() already ensures that the written value is the correct one and fails if that is not the case. There is no need for an additional comparison. Remove it. Signed-off-by: Nadav Amit --- arch/x86/kernel/kgdb.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff

[PATCH v6 02/10] x86/jump_label: Use text_poke_early() during early init

2018-11-20 Thread Nadav Amit
that would set a temporary mm for patching, which is initialized after some static-keys are enabled/disabled. Cc: Andy Lutomirski Cc: Kees Cook Cc: Dave Hansen Cc: Masami Hiramatsu Co-Developed-by: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86/kernel/jump_label.c | 7 ++- 1 file changed

[PATCH v6 07/10] x86/kgdb: avoid redundant comparison of patched code

2018-11-20 Thread Nadav Amit
text_poke() already ensures that the written value is the correct one and fails if that is not the case. There is no need for an additional comparison. Remove it. Signed-off-by: Nadav Amit --- arch/x86/kernel/kgdb.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff

[PATCH v6 06/10] x86/alternative: use temporary mm for text poking

2018-11-20 Thread Nadav Amit
not conservative enough when mapping pages, as it always tries to map 2 pages, even when a single one is sufficient. So try to be more conservative, and do not map more than needed. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Signed-off-by: Nadav Amit

[PATCH v6 08/10] x86: avoid W^X being broken during modules loading

2018-11-20 Thread Nadav Amit
Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Suggested-by: Thomas Gleixner Suggested-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/kernel/alternative.c | 28 +--- arch/x86/kernel/module.c | 2 +- include/linux/filter.h| 6 ++ kernel

[PATCH v6 06/10] x86/alternative: use temporary mm for text poking

2018-11-20 Thread Nadav Amit
not conservative enough when mapping pages, as it always tries to map 2 pages, even when a single one is sufficient. So try to be more conservative, and do not map more than needed. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Signed-off-by: Nadav Amit

[PATCH v6 08/10] x86: avoid W^X being broken during modules loading

2018-11-20 Thread Nadav Amit
Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Suggested-by: Thomas Gleixner Suggested-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/kernel/alternative.c | 28 +--- arch/x86/kernel/module.c | 2 +- include/linux/filter.h| 6 ++ kernel

[PATCH v6 05/10] x86/alternative: initializing temporary mm for patching

2018-11-20 Thread Nadav Amit
Hiramatsu Tested-by: Masami Hiramatsu Suggested-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/include/asm/pgtable.h | 3 +++ arch/x86/include/asm/text-patching.h | 2 ++ arch/x86/kernel/alternative.c| 3 +++ arch/x86/mm/init_64.c| 35

[PATCH v6 09/10] x86/jump-label: remove support for custom poker

2018-11-20 Thread Nadav Amit
Signed-off-by: Nadav Amit --- arch/x86/kernel/jump_label.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/arch/x86/kernel/jump_label.c b/arch/x86/kernel/jump_label.c index ed5fe274a7d8..994c13e2867d 100644 --- a/arch/x86/kernel/jump_label.c +++ b/arch/x86

[PATCH v6 09/10] x86/jump-label: remove support for custom poker

2018-11-20 Thread Nadav Amit
Signed-off-by: Nadav Amit --- arch/x86/kernel/jump_label.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/arch/x86/kernel/jump_label.c b/arch/x86/kernel/jump_label.c index ed5fe274a7d8..994c13e2867d 100644 --- a/arch/x86/kernel/jump_label.c +++ b/arch/x86

[PATCH v6 05/10] x86/alternative: initializing temporary mm for patching

2018-11-20 Thread Nadav Amit
Hiramatsu Tested-by: Masami Hiramatsu Suggested-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/include/asm/pgtable.h | 3 +++ arch/x86/include/asm/text-patching.h | 2 ++ arch/x86/kernel/alternative.c| 3 +++ arch/x86/mm/init_64.c| 35

Re: [PATCH v5 00/10] x86/alternative: text_poke() fixes

2018-11-20 Thread Nadav Amit
> On Nov 20, 2018, at 4:42 AM, Peter Zijlstra wrote: > > On Tue, Nov 13, 2018 at 05:07:20AM -0800, Nadav Amit wrote: >> v4->v5: >> - Fix Xen breakage [Damian Tometzki] >> - BUG_ON() when poking_mm initialization fails [PeterZ] >> - Better comments on "

Re: [PATCH v5 00/10] x86/alternative: text_poke() fixes

2018-11-20 Thread Nadav Amit
> On Nov 20, 2018, at 4:42 AM, Peter Zijlstra wrote: > > On Tue, Nov 13, 2018 at 05:07:20AM -0800, Nadav Amit wrote: >> v4->v5: >> - Fix Xen breakage [Damian Tometzki] >> - BUG_ON() when poking_mm initialization fails [PeterZ] >> - Better comments on "

Re: [PATCH v5 02/10] x86/jump_label: Use text_poke_early() during early init

2018-11-20 Thread Nadav Amit
> On Nov 20, 2018, at 10:23 AM, H. Peter Anvin wrote: > > On 11/20/18 10:18 AM, Peter Zijlstra wrote: >>> Can't we make this test in text_poke() directly, please? >> >> He does that in 9/10 iirc. > > No, in 9/10 he does that change locally for the jump_label, but there is > absolutely no

Re: [PATCH v5 02/10] x86/jump_label: Use text_poke_early() during early init

2018-11-20 Thread Nadav Amit
> On Nov 20, 2018, at 10:23 AM, H. Peter Anvin wrote: > > On 11/20/18 10:18 AM, Peter Zijlstra wrote: >>> Can't we make this test in text_poke() directly, please? >> >> He does that in 9/10 iirc. > > No, in 9/10 he does that change locally for the jump_label, but there is > absolutely no

Re: [PATCH v2 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-19 Thread Nadav Amit
at 8:20 PM, Masahiro Yamada wrote: > On Sat, Nov 17, 2018 at 6:02 AM Nadav Amit wrote: >> From: Masahiro Yamada >> Sent: November 16, 2018 at 7:45:45 AM GMT >>> To: Nadav Amit >>> Cc: Ingo Molnar , Michal Marek , >>> Thomas Gleixner , Borislav Pet

Re: [PATCH v2 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-19 Thread Nadav Amit
at 8:20 PM, Masahiro Yamada wrote: > On Sat, Nov 17, 2018 at 6:02 AM Nadav Amit wrote: >> From: Masahiro Yamada >> Sent: November 16, 2018 at 7:45:45 AM GMT >>> To: Nadav Amit >>> Cc: Ingo Molnar , Michal Marek , >>> Thomas Gleixner , Borislav Pet

Re: [PATCH v2 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-16 Thread Nadav Amit
From: Masahiro Yamada Sent: November 16, 2018 at 7:45:45 AM GMT > To: Nadav Amit > Cc: Ingo Molnar , Michal Marek , > Thomas Gleixner , Borislav Petkov , H. > Peter Anvin , X86 ML , Linux Kbuild mailing > list , Linux Kernel Mailing List > > Subject: Re: [PATCH v2 1/2]

Re: [PATCH v2 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-16 Thread Nadav Amit
From: Masahiro Yamada Sent: November 16, 2018 at 7:45:45 AM GMT > To: Nadav Amit > Cc: Ingo Molnar , Michal Marek , > Thomas Gleixner , Borislav Petkov , H. > Peter Anvin , X86 ML , Linux Kbuild mailing > list , Linux Kernel Mailing List > > Subject: Re: [PATCH v2 1/2]

Re: [PATCH v2 2/2] x86: set a dependency on macros.S

2018-11-16 Thread Nadav Amit
From: Masahiro Yamada Sent: November 16, 2018 at 7:37:46 AM GMT > To: Nadav Amit > Cc: Ingo Molnar , Michal Marek , > Thomas Gleixner , Borislav Petkov , H. > Peter Anvin , X86 ML , Linux Kbuild mailing > list , Linux Kernel Mailing List > > Subject: Re: [PATCH v2 2/2]

Re: [PATCH v2 2/2] x86: set a dependency on macros.S

2018-11-16 Thread Nadav Amit
From: Masahiro Yamada Sent: November 16, 2018 at 7:37:46 AM GMT > To: Nadav Amit > Cc: Ingo Molnar , Michal Marek , > Thomas Gleixner , Borislav Petkov , H. > Peter Anvin , X86 ML , Linux Kbuild mailing > list , Linux Kernel Mailing List > > Subject: Re: [PATCH v2 2/2]

[PATCH v2 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-14 Thread Nadav Amit
file. Since this is less efficient, this compilation mode is only used when distcc or icecc are used. Note that the assembly stage should also be distributed, if distcc is configured using "CFLAGS=-DENABLE_REMOTE_ASSEMBLE". Reported-by: Logan Gunthorpe Signed-off-by: Nadav Amit ---

[PATCH v2 2/2] x86: set a dependency on macros.S

2018-11-14 Thread Nadav Amit
Changes in macros.S should trigger the recompilation of all C files, as the macros might need to affect their compilation. Acked-by: Ingo Molnar Signed-off-by: Nadav Amit --- scripts/Makefile.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.build b

[PATCH v2 0/2] x86: Asm macros fixes

2018-11-14 Thread Nadav Amit
the patches through tip. Please advise if you disagree. v1->v2: * Remove whitespaces [Ingo] * Automatically enable split compilation when distcc or icecc are used Nadav Amit (2): Makefile: Fix distcc compilation with x86 macros x86: set a dependency on macros.S Makefile | 4 +++- a

[PATCH v2 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-14 Thread Nadav Amit
file. Since this is less efficient, this compilation mode is only used when distcc or icecc are used. Note that the assembly stage should also be distributed, if distcc is configured using "CFLAGS=-DENABLE_REMOTE_ASSEMBLE". Reported-by: Logan Gunthorpe Signed-off-by: Nadav Amit ---

[PATCH v2 2/2] x86: set a dependency on macros.S

2018-11-14 Thread Nadav Amit
Changes in macros.S should trigger the recompilation of all C files, as the macros might need to affect their compilation. Acked-by: Ingo Molnar Signed-off-by: Nadav Amit --- scripts/Makefile.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.build b

[PATCH v2 0/2] x86: Asm macros fixes

2018-11-14 Thread Nadav Amit
the patches through tip. Please advise if you disagree. v1->v2: * Remove whitespaces [Ingo] * Automatically enable split compilation when distcc or icecc are used Nadav Amit (2): Makefile: Fix distcc compilation with x86 macros x86: set a dependency on macros.S Makefile | 4 +++- a

[PATCH] vmw_balloon: update maintainers list

2018-11-14 Thread Nadav Amit
From: Xavier Deguillard Julien will be replacing me as the vmw_balloon maintainer. Cc: Julien Freche Signed-off-by: Xavier Deguillard Signed-off-by: Nadav Amit --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index a78d45755881

[PATCH] vmw_balloon: update maintainers list

2018-11-14 Thread Nadav Amit
From: Xavier Deguillard Julien will be replacing me as the vmw_balloon maintainer. Cc: Julien Freche Signed-off-by: Xavier Deguillard Signed-off-by: Nadav Amit --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index a78d45755881

Re: [PATCH 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-14 Thread Nadav Amit
From: Logan Gunthorpe Sent: November 15, 2018 at 1:19:45 AM GMT > To: Nadav Amit , Ingo Molnar > Cc: Ingo Molnar , Masahiro Yamada > , Michal Marek , > Thomas Gleixner , Borislav Petkov , H. > Peter Anvin , X86 ML , Linux Kbuild mailing > list , LKML > Subject: Re: [PAT

Re: [PATCH 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-14 Thread Nadav Amit
From: Logan Gunthorpe Sent: November 15, 2018 at 1:19:45 AM GMT > To: Nadav Amit , Ingo Molnar > Cc: Ingo Molnar , Masahiro Yamada > , Michal Marek , > Thomas Gleixner , Borislav Petkov , H. > Peter Anvin , X86 ML , Linux Kbuild mailing > list , LKML > Subject: Re: [PAT

Re: [PATCH 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-14 Thread Nadav Amit
From: Logan Gunthorpe Sent: November 14, 2018 at 7:29:38 AM GMT > To: Nadav Amit , Ingo Molnar > Cc: Ingo Molnar , Masahiro Yamada > , Michal Marek , > Thomas Gleixner , Borislav Petkov , H. > Peter Anvin , X86 ML , Linux Kbuild mailing > list , LKML > Subject: Re: [PAT

Re: [PATCH 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-14 Thread Nadav Amit
From: Logan Gunthorpe Sent: November 14, 2018 at 7:29:38 AM GMT > To: Nadav Amit , Ingo Molnar > Cc: Ingo Molnar , Masahiro Yamada > , Michal Marek , > Thomas Gleixner , Borislav Petkov , H. > Peter Anvin , X86 ML , Linux Kbuild mailing > list , LKML > Subject: Re: [PAT

[PATCH v5 01/10] Fix "x86/alternatives: Lockdep-enforce text_mutex in text_poke*()"

2018-11-13 Thread Nadav Amit
orce text_mutex in text_poke*()") Suggested-by: Peter Zijlstra Acked-by: Jiri Kosina Signed-off-by: Nadav Amit --- arch/x86/include/asm/text-patching.h | 3 +- arch/x86/kernel/alternative.c| 72 +--- arch/x86/kernel/kgdb.c | 15 -- 3 files changed,

[PATCH v5 07/10] x86/kgdb: avoid redundant comparison of patched code

2018-11-13 Thread Nadav Amit
text_poke() already ensures that the written value is the correct one and fails if that is not the case. There is no need for an additional comparison. Remove it. Signed-off-by: Nadav Amit --- arch/x86/kernel/kgdb.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/arch/x86/kernel

[PATCH v5 00/10] x86/alternative: text_poke() fixes

2018-11-13 Thread Nadav Amit
ext_mutex use instead [masami] - Comment fix [peterz] - Removed remainders of text_poke return value [masami] - Use __weak for poking_init instead of macros [masami] - Simplify error handling in poking_init [masami] Andy Lutomirski (1): x86/mm: temporary mm struct Nadav Amit (9): Fix "

[PATCH v5 05/10] x86/alternative: initializing temporary mm for patching

2018-11-13 Thread Nadav Amit
Hiramatsu Tested-by: Masami Hiramatsu Suggested-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/include/asm/pgtable.h | 3 +++ arch/x86/include/asm/text-patching.h | 2 ++ arch/x86/kernel/alternative.c| 3 +++ arch/x86/mm/init_64.c| 35

[PATCH v5 07/10] x86/kgdb: avoid redundant comparison of patched code

2018-11-13 Thread Nadav Amit
text_poke() already ensures that the written value is the correct one and fails if that is not the case. There is no need for an additional comparison. Remove it. Signed-off-by: Nadav Amit --- arch/x86/kernel/kgdb.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/arch/x86/kernel

[PATCH v5 00/10] x86/alternative: text_poke() fixes

2018-11-13 Thread Nadav Amit
ext_mutex use instead [masami] - Comment fix [peterz] - Removed remainders of text_poke return value [masami] - Use __weak for poking_init instead of macros [masami] - Simplify error handling in poking_init [masami] Andy Lutomirski (1): x86/mm: temporary mm struct Nadav Amit (9): Fix "

[PATCH v5 05/10] x86/alternative: initializing temporary mm for patching

2018-11-13 Thread Nadav Amit
Hiramatsu Tested-by: Masami Hiramatsu Suggested-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/include/asm/pgtable.h | 3 +++ arch/x86/include/asm/text-patching.h | 2 ++ arch/x86/kernel/alternative.c| 3 +++ arch/x86/mm/init_64.c| 35

[PATCH v5 01/10] Fix "x86/alternatives: Lockdep-enforce text_mutex in text_poke*()"

2018-11-13 Thread Nadav Amit
orce text_mutex in text_poke*()") Suggested-by: Peter Zijlstra Acked-by: Jiri Kosina Signed-off-by: Nadav Amit --- arch/x86/include/asm/text-patching.h | 3 +- arch/x86/kernel/alternative.c| 72 +--- arch/x86/kernel/kgdb.c | 15 -- 3 files changed,

[PATCH v5 03/10] x86/mm: temporary mm struct

2018-11-13 Thread Nadav Amit
: Peter Zijlstra Cc: Dave Hansen Reviewed-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/include/asm/mmu_context.h | 32 ++ 1 file changed, 32 insertions(+) diff --git a/arch/x86/include/asm

[PATCH v5 08/10] x86: avoid W^X being broken during modules loading

2018-11-13 Thread Nadav Amit
Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Suggested-by: Thomas Gleixner Suggested-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/kernel/alternative.c | 28 +--- arch/x86/kernel/module.c | 2 +- include/linux/filter.h| 6 ++ kernel

[PATCH v5 06/10] x86/alternative: use temporary mm for text poking

2018-11-13 Thread Nadav Amit
not conservative enough when mapping pages, as it always tries to map 2 pages, even when a single one is sufficient. So try to be more conservative, and do not map more than needed. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Signed-off-by: Nadav Amit

[PATCH v5 04/10] fork: provide a function for copying init_mm

2018-11-13 Thread Nadav Amit
Provide a function for copying init_mm. This function will be later used for setting a temporary mm. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Reviewed-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Nadav Amit --- include/linux/sched/task.h | 1

[PATCH v5 06/10] x86/alternative: use temporary mm for text poking

2018-11-13 Thread Nadav Amit
not conservative enough when mapping pages, as it always tries to map 2 pages, even when a single one is sufficient. So try to be more conservative, and do not map more than needed. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Signed-off-by: Nadav Amit

[PATCH v5 04/10] fork: provide a function for copying init_mm

2018-11-13 Thread Nadav Amit
Provide a function for copying init_mm. This function will be later used for setting a temporary mm. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Reviewed-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Nadav Amit --- include/linux/sched/task.h | 1

[PATCH v5 03/10] x86/mm: temporary mm struct

2018-11-13 Thread Nadav Amit
: Peter Zijlstra Cc: Dave Hansen Reviewed-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/include/asm/mmu_context.h | 32 ++ 1 file changed, 32 insertions(+) diff --git a/arch/x86/include/asm

[PATCH v5 08/10] x86: avoid W^X being broken during modules loading

2018-11-13 Thread Nadav Amit
Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Suggested-by: Thomas Gleixner Suggested-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/kernel/alternative.c | 28 +--- arch/x86/kernel/module.c | 2 +- include/linux/filter.h| 6 ++ kernel

[PATCH v5 09/10] x86/jump-label: remove support for custom poker

2018-11-13 Thread Nadav Amit
Signed-off-by: Nadav Amit --- arch/x86/kernel/jump_label.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/arch/x86/kernel/jump_label.c b/arch/x86/kernel/jump_label.c index ed5fe274a7d8..994c13e2867d 100644 --- a/arch/x86/kernel/jump_label.c +++ b/arch/x86

[PATCH v5 02/10] x86/jump_label: Use text_poke_early() during early init

2018-11-13 Thread Nadav Amit
that would set a temporary mm for patching, which is initialized after some static-keys are enabled/disabled. Cc: Andy Lutomirski Cc: Kees Cook Cc: Dave Hansen Cc: Masami Hiramatsu Co-Developed-by: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86/kernel/jump_label.c | 7 ++- 1 file changed

[PATCH v5 10/10] x86/alternative: remove the return value of text_poke_*()

2018-11-13 Thread Nadav Amit
The return value of text_poke_early() and text_poke_bp() is useless. Remove it. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Signed-off-by: Nadav Amit --- arch/x86/include/asm/text-patching.h | 4 ++-- arch/x86/kernel/alternative.c| 11

[PATCH v5 09/10] x86/jump-label: remove support for custom poker

2018-11-13 Thread Nadav Amit
Signed-off-by: Nadav Amit --- arch/x86/kernel/jump_label.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/arch/x86/kernel/jump_label.c b/arch/x86/kernel/jump_label.c index ed5fe274a7d8..994c13e2867d 100644 --- a/arch/x86/kernel/jump_label.c +++ b/arch/x86

[PATCH v5 02/10] x86/jump_label: Use text_poke_early() during early init

2018-11-13 Thread Nadav Amit
that would set a temporary mm for patching, which is initialized after some static-keys are enabled/disabled. Cc: Andy Lutomirski Cc: Kees Cook Cc: Dave Hansen Cc: Masami Hiramatsu Co-Developed-by: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86/kernel/jump_label.c | 7 ++- 1 file changed

[PATCH v5 10/10] x86/alternative: remove the return value of text_poke_*()

2018-11-13 Thread Nadav Amit
The return value of text_poke_early() and text_poke_bp() is useless. Remove it. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Signed-off-by: Nadav Amit --- arch/x86/include/asm/text-patching.h | 4 ++-- arch/x86/kernel/alternative.c| 11

Re: [PATCH 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-13 Thread Nadav Amit
From: Nadav Amit Sent: November 13, 2018 at 5:55:34 PM GMT > To: Ingo Molnar > Cc: Ingo Molnar , Masahiro Yamada > , Michal Marek , > Thomas Gleixner , Borislav Petkov , H. > Peter Anvin , X86 ML , Linux Kbuild mailing > list , LKML , > Logan Gunthorpe > Subject:

Re: [PATCH 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-13 Thread Nadav Amit
From: Nadav Amit Sent: November 13, 2018 at 5:55:34 PM GMT > To: Ingo Molnar > Cc: Ingo Molnar , Masahiro Yamada > , Michal Marek , > Thomas Gleixner , Borislav Petkov , H. > Peter Anvin , X86 ML , Linux Kbuild mailing > list , LKML , > Logan Gunthorpe > Subject:

Re: [PATCH 10/17] prmem: documentation

2018-11-13 Thread Nadav Amit
From: Andy Lutomirski Sent: November 13, 2018 at 5:47:16 PM GMT > To: Nadav Amit > Cc: Igor Stoppa , Kees Cook , > Peter Zijlstra , Mimi Zohar , > Matthew Wilcox , Dave Chinner , > James Morris , Michal Hocko , Kernel > Hardening , linux-integrity > , LSM List >

Re: [PATCH 10/17] prmem: documentation

2018-11-13 Thread Nadav Amit
From: Andy Lutomirski Sent: November 13, 2018 at 5:47:16 PM GMT > To: Nadav Amit > Cc: Igor Stoppa , Kees Cook , > Peter Zijlstra , Mimi Zohar , > Matthew Wilcox , Dave Chinner , > James Morris , Michal Hocko , Kernel > Hardening , linux-integrity > , LSM List >

Re: [PATCH 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-13 Thread Nadav Amit
From: Ingo Molnar Sent: November 13, 2018 at 11:30:00 AM GMT > To: Nadav Amit > Cc: Ingo Molnar , Masahiro Yamada > , Michal Marek , > Thomas Gleixner , Borislav Petkov , H. > Peter Anvin , x...@kernel.org, linux-kbu...@vger.kernel.org, > linux-kernel@vger.kernel.org > Su

Re: [PATCH 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-13 Thread Nadav Amit
From: Ingo Molnar Sent: November 13, 2018 at 11:30:00 AM GMT > To: Nadav Amit > Cc: Ingo Molnar , Masahiro Yamada > , Michal Marek , > Thomas Gleixner , Borislav Petkov , H. > Peter Anvin , x...@kernel.org, linux-kbu...@vger.kernel.org, > linux-kernel@vger.kernel.org > Su

[PATCH 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-12 Thread Nadav Amit
file. Since this is less efficient, this compilation mode is only used when make is called with the "DISTCC=y" parameter. Note that the assembly stage should also be distributed, if distcc is configured using "CFLAGS=-DENABLE_REMOTE_ASSEMBLE". Reported-by: Logan Gunthorpe

[PATCH 1/2] Makefile: Fix distcc compilation with x86 macros

2018-11-12 Thread Nadav Amit
file. Since this is less efficient, this compilation mode is only used when make is called with the "DISTCC=y" parameter. Note that the assembly stage should also be distributed, if distcc is configured using "CFLAGS=-DENABLE_REMOTE_ASSEMBLE". Reported-by: Logan Gunthorpe

[PATCH 2/2] x86: set a dependency on macros.S

2018-11-12 Thread Nadav Amit
Changes in macros.S should trigger the recompilation of all C files, as the macros might need to affect their compilation. Signed-off-by: Nadav Amit --- scripts/Makefile.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build

[PATCH 2/2] x86: set a dependency on macros.S

2018-11-12 Thread Nadav Amit
Changes in macros.S should trigger the recompilation of all C files, as the macros might need to affect their compilation. Signed-off-by: Nadav Amit --- scripts/Makefile.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build

[PATCH 0/2] x86: Asm macros fixes

2018-11-12 Thread Nadav Amit
There has been a complaint that the recent use of assembly macros in C files broke distcc. The first patch fixes this issue. The second patch adds a dependency for all C files on macros.S, to trigger their recompilation when the relevant macros change. Nadav Amit (2): Makefile: Fix distcc

[PATCH 0/2] x86: Asm macros fixes

2018-11-12 Thread Nadav Amit
There has been a complaint that the recent use of assembly macros in C files broke distcc. The first patch fixes this issue. The second patch adds a dependency for all C files on macros.S, to trigger their recompilation when the relevant macros change. Nadav Amit (2): Makefile: Fix distcc

Re: [PATCH v4 02/10] x86/jump_label: Use text_poke_early() during early init

2018-11-12 Thread Nadav Amit
Peter, I have put you as a “Co-Developed-by”, since the patch ended up as being the single line that you wrote in the correspondence of the previous version. I would therefore need to ask for your signed-off-by. Regards, Nadav From: Nadav Amit Sent: November 10, 2018 at 11:17:24 PM GMT

Re: [PATCH v4 02/10] x86/jump_label: Use text_poke_early() during early init

2018-11-12 Thread Nadav Amit
Peter, I have put you as a “Co-Developed-by”, since the patch ended up as being the single line that you wrote in the correspondence of the previous version. I would therefore need to ask for your signed-off-by. Regards, Nadav From: Nadav Amit Sent: November 10, 2018 at 11:17:24 PM GMT

Re: [PATCH v4 06/10] x86/alternative: use temporary mm for text poking

2018-11-11 Thread Nadav Amit
From: Peter Zijlstra Sent: November 11, 2018 at 11:52:20 PM GMT > To: Nadav Amit > Cc: Ingo Molnar , LKML , X86 > ML , H. Peter Anvin , Thomas Gleixner > , Borislav Petkov , Dave Hansen > , Andy Lutomirski , Kees Cook > , Dave Hansen , Masami > Hiramatsu > Subject:

Re: [PATCH v4 06/10] x86/alternative: use temporary mm for text poking

2018-11-11 Thread Nadav Amit
From: Peter Zijlstra Sent: November 11, 2018 at 11:52:20 PM GMT > To: Nadav Amit > Cc: Ingo Molnar , LKML , X86 > ML , H. Peter Anvin , Thomas Gleixner > , Borislav Petkov , Dave Hansen > , Andy Lutomirski , Kees Cook > , Dave Hansen , Masami > Hiramatsu > Subject:

Re: [PATCH v4 06/10] x86/alternative: use temporary mm for text poking

2018-11-11 Thread Nadav Amit
From: Peter Zijlstra Sent: November 11, 2018 at 2:59:36 PM GMT > To: Nadav Amit > Cc: Ingo Molnar , linux-kernel@vger.kernel.org, > x...@kernel.org, H. Peter Anvin , Thomas Gleixner > , Borislav Petkov , Dave Hansen > , Andy Lutomirski , Kees Cook > , Dave Hansen , M

Re: [PATCH v4 06/10] x86/alternative: use temporary mm for text poking

2018-11-11 Thread Nadav Amit
From: Peter Zijlstra Sent: November 11, 2018 at 2:59:36 PM GMT > To: Nadav Amit > Cc: Ingo Molnar , linux-kernel@vger.kernel.org, > x...@kernel.org, H. Peter Anvin , Thomas Gleixner > , Borislav Petkov , Dave Hansen > , Andy Lutomirski , Kees Cook > , Dave Hansen , M

Re: [PATCH v4 06/10] x86/alternative: use temporary mm for text poking

2018-11-11 Thread Nadav Amit
From: Damian Tometzki Sent: November 11, 2018 at 7:11:42 PM GMT > To: Nadav Amit > Cc: Ingo Molnar , linux-kernel@vger.kernel.org>, > x...@kernel.org>, H. Peter Anvin , Thomas Gleixner > , Borislav Petkov , Dave Hansen > , Andy Lutomirski , Kees Cook > , Pete

Re: [PATCH v4 06/10] x86/alternative: use temporary mm for text poking

2018-11-11 Thread Nadav Amit
From: Damian Tometzki Sent: November 11, 2018 at 7:11:42 PM GMT > To: Nadav Amit > Cc: Ingo Molnar , linux-kernel@vger.kernel.org>, > x...@kernel.org>, H. Peter Anvin , Thomas Gleixner > , Borislav Petkov , Dave Hansen > , Andy Lutomirski , Kees Cook > , Pete

Re: [PATCH v4 05/10] x86/alternative: initializing temporary mm for patching

2018-11-11 Thread Nadav Amit
From: Peter Zijlstra Sent: November 11, 2018 at 2:43:27 PM GMT > To: Nadav Amit > Cc: Ingo Molnar , linux-kernel@vger.kernel.org, > x...@kernel.org, H. Peter Anvin , Thomas Gleixner > , Borislav Petkov , Dave Hansen > , Kees Cook , Dave Hansen > > Subject: Re:

Re: [PATCH v4 05/10] x86/alternative: initializing temporary mm for patching

2018-11-11 Thread Nadav Amit
From: Peter Zijlstra Sent: November 11, 2018 at 2:43:27 PM GMT > To: Nadav Amit > Cc: Ingo Molnar , linux-kernel@vger.kernel.org, > x...@kernel.org, H. Peter Anvin , Thomas Gleixner > , Borislav Petkov , Dave Hansen > , Kees Cook , Dave Hansen > > Subject: Re:

Re: [PATCH v4 09/10] x86/jump-label: remove support for custom poker

2018-11-11 Thread Nadav Amit
From: Peter Zijlstra Sent: November 11, 2018 at 3:05:53 PM GMT > To: Nadav Amit > Cc: Ingo Molnar , linux-kernel@vger.kernel.org, > x...@kernel.org, H. Peter Anvin , Thomas Gleixner > , Borislav Petkov , Dave Hansen > , Andy Lutomirski , Kees Cook > , Dave Hansen , M

Re: [PATCH v4 09/10] x86/jump-label: remove support for custom poker

2018-11-11 Thread Nadav Amit
From: Peter Zijlstra Sent: November 11, 2018 at 3:05:53 PM GMT > To: Nadav Amit > Cc: Ingo Molnar , linux-kernel@vger.kernel.org, > x...@kernel.org, H. Peter Anvin , Thomas Gleixner > , Borislav Petkov , Dave Hansen > , Andy Lutomirski , Kees Cook > , Dave Hansen , M

[PATCH v4 00/10] x86/alternative: text_poke() fixes

2018-11-10 Thread Nadav Amit
text_poke return value [masami] - Use __weak for poking_init instead of macros [masami] - Simplify error handling in poking_init [masami] Andy Lutomirski (1): x86/mm: temporary mm struct Nadav Amit (9): Fix "x86/alternatives: Lockdep-enforce text_mutex in text_poke*()" x86/jump_

[PATCH v4 01/10] Fix "x86/alternatives: Lockdep-enforce text_mutex in text_poke*()"

2018-11-10 Thread Nadav Amit
Lockdep-enforce text_mutex in text_poke*()") Suggested-by: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86/include/asm/text-patching.h | 3 +- arch/x86/kernel/alternative.c| 72 +--- arch/x86/kernel/kgdb.c | 15 -- 3 files changed,

[PATCH v4 00/10] x86/alternative: text_poke() fixes

2018-11-10 Thread Nadav Amit
text_poke return value [masami] - Use __weak for poking_init instead of macros [masami] - Simplify error handling in poking_init [masami] Andy Lutomirski (1): x86/mm: temporary mm struct Nadav Amit (9): Fix "x86/alternatives: Lockdep-enforce text_mutex in text_poke*()" x86/jump_

[PATCH v4 01/10] Fix "x86/alternatives: Lockdep-enforce text_mutex in text_poke*()"

2018-11-10 Thread Nadav Amit
Lockdep-enforce text_mutex in text_poke*()") Suggested-by: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86/include/asm/text-patching.h | 3 +- arch/x86/kernel/alternative.c| 72 +--- arch/x86/kernel/kgdb.c | 15 -- 3 files changed,

[PATCH v4 02/10] x86/jump_label: Use text_poke_early() during early init

2018-11-10 Thread Nadav Amit
that would set a temporary mm for patching, which is initialized after some static-keys are enabled/disabled. Cc: Andy Lutomirski Cc: Kees Cook Cc: Dave Hansen Cc: Masami Hiramatsu Co-Developed-by: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86/kernel/jump_label.c | 7 ++- 1 file changed

[PATCH v4 04/10] fork: provide a function for copying init_mm

2018-11-10 Thread Nadav Amit
Provide a function for copying init_mm. This function will be later used for setting a temporary mm. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Reviewed-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Nadav Amit --- include/linux/sched/task.h | 1

[PATCH v4 02/10] x86/jump_label: Use text_poke_early() during early init

2018-11-10 Thread Nadav Amit
that would set a temporary mm for patching, which is initialized after some static-keys are enabled/disabled. Cc: Andy Lutomirski Cc: Kees Cook Cc: Dave Hansen Cc: Masami Hiramatsu Co-Developed-by: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86/kernel/jump_label.c | 7 ++- 1 file changed

[PATCH v4 04/10] fork: provide a function for copying init_mm

2018-11-10 Thread Nadav Amit
Provide a function for copying init_mm. This function will be later used for setting a temporary mm. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Reviewed-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Nadav Amit --- include/linux/sched/task.h | 1

[PATCH v4 05/10] x86/alternative: initializing temporary mm for patching

2018-11-10 Thread Nadav Amit
Hiramatsu Tested-by: Masami Hiramatsu Suggested-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/include/asm/pgtable.h | 3 +++ arch/x86/include/asm/text-patching.h | 2 ++ arch/x86/kernel/alternative.c| 3 +++ arch/x86/mm/init_64.c| 39

[PATCH v4 07/10] x86/kgdb: avoid redundant comparison of code

2018-11-10 Thread Nadav Amit
text_poke() already ensures that the written value is the correct one and fails if that is not the case. There is no need for an additional comparison. Remove it. Signed-off-by: Nadav Amit --- arch/x86/kernel/kgdb.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/arch/x86/kernel

[PATCH v4 03/10] x86/mm: temporary mm struct

2018-11-10 Thread Nadav Amit
: Peter Zijlstra Cc: Dave Hansen Reviewed-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/include/asm/mmu_context.h | 20 1 file changed, 20 insertions(+) diff --git a/arch/x86/include/asm

[PATCH v4 07/10] x86/kgdb: avoid redundant comparison of code

2018-11-10 Thread Nadav Amit
text_poke() already ensures that the written value is the correct one and fails if that is not the case. There is no need for an additional comparison. Remove it. Signed-off-by: Nadav Amit --- arch/x86/kernel/kgdb.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/arch/x86/kernel

[PATCH v4 03/10] x86/mm: temporary mm struct

2018-11-10 Thread Nadav Amit
: Peter Zijlstra Cc: Dave Hansen Reviewed-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/include/asm/mmu_context.h | 20 1 file changed, 20 insertions(+) diff --git a/arch/x86/include/asm

[PATCH v4 05/10] x86/alternative: initializing temporary mm for patching

2018-11-10 Thread Nadav Amit
Hiramatsu Tested-by: Masami Hiramatsu Suggested-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/include/asm/pgtable.h | 3 +++ arch/x86/include/asm/text-patching.h | 2 ++ arch/x86/kernel/alternative.c| 3 +++ arch/x86/mm/init_64.c| 39

[PATCH v4 08/10] x86: avoid W^X being broken during modules loading

2018-11-10 Thread Nadav Amit
Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Suggested-by: Thomas Gleixner Suggested-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/kernel/alternative.c | 28 +--- arch/x86/kernel/module.c | 2 +- include/linux/filter.h| 6 ++ kernel

[PATCH v4 06/10] x86/alternative: use temporary mm for text poking

2018-11-10 Thread Nadav Amit
not conservative enough when mapping pages, as it always tries to map 2 pages, even when a single one is sufficient. So try to be more conservative, and do not map more than needed. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Signed-off-by: Nadav Amit

[PATCH v4 10/10] x86/alternative: remove the return value of text_poke_*()

2018-11-10 Thread Nadav Amit
The return value of text_poke_early() and text_poke_bp() is useless. Remove it. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Signed-off-by: Nadav Amit --- arch/x86/include/asm/text-patching.h | 4 ++-- arch/x86/kernel/alternative.c| 11

[PATCH v4 09/10] x86/jump-label: remove support for custom poker

2018-11-10 Thread Nadav Amit
Signed-off-by: Nadav Amit --- arch/x86/kernel/jump_label.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/jump_label.c b/arch/x86/kernel/jump_label.c index ed5fe274a7d8..7947df599e58 100644 --- a/arch/x86/kernel/jump_label.c +++ b/arch/x86/kernel

[PATCH v4 08/10] x86: avoid W^X being broken during modules loading

2018-11-10 Thread Nadav Amit
Zijlstra Cc: Dave Hansen Cc: Masami Hiramatsu Suggested-by: Thomas Gleixner Suggested-by: Andy Lutomirski Signed-off-by: Nadav Amit --- arch/x86/kernel/alternative.c | 28 +--- arch/x86/kernel/module.c | 2 +- include/linux/filter.h| 6 ++ kernel

<    3   4   5   6   7   8   9   10   11   12   >