Re: [patch 21/24] x86/speculation: Prepare arch_smt_update() for PRCTL mode

2018-11-22 Thread Thomas Gleixner
On Thu, 22 Nov 2018, Ingo Molnar wrote: > * Thomas Gleixner wrote: > > +static void update_stibp_msr(void *info) > > { > > - /* Enhanced IBRS makes using STIBP unnecessary. */ > > - if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED) > > - ret

Re: [patch 20/24] x86/speculation: Split out TIF update

2018-11-22 Thread Thomas Gleixner
On Thu, 22 Nov 2018, Ingo Molnar wrote: > * Thomas Gleixner wrote: > > Had to read this twice, because the comment and the code are both correct > but deal with the inverse case. This might have helped: > > /* >* Immediately update the speculation MSR

Re: [patch 20/24] x86/speculation: Split out TIF update

2018-11-22 Thread Thomas Gleixner
On Wed, 21 Nov 2018, Tim Chen wrote: > On Wed, Nov 21, 2018 at 09:14:50PM +0100, Thomas Gleixner wrote: > > +static void task_update_spec_tif(struct task_struct *tsk, int tifbit, bool > > on) > > { > > bool update; > > > >

Re: [patch 17/24] x86/speculation: Move IBPB control out of switch_mm()

2018-11-22 Thread Thomas Gleixner
On Thu, 22 Nov 2018, Ingo Molnar wrote: > * Thomas Gleixner wrote: > > /* > > * Now maybe reload the debug registers and handle I/O bitmaps > > */ > > - if (unlikely(task_thread_info(next_p)->flags & _TIF_WORK_CTXSW_NEXT || > > -

Re: [PATCH v4] debugobjects: scale the static pool size

2018-11-22 Thread Thomas Gleixner
On Tue, 20 Nov 2018, Qian Cai wrote: Looking deeper at that. > diff --git a/lib/debugobjects.c b/lib/debugobjects.c > index 70935ed91125..140571aa483c 100644 > --- a/lib/debugobjects.c > +++ b/lib/debugobjects.c > @@ -23,9 +23,81 @@ > #define ODEBUG_HASH_BITS 14 > #define ODEBUG_HASH_SIZE

Re: [patch 01/24] x86/speculation: Update the TIF_SSBD comment

2018-11-22 Thread Thomas Gleixner
On Thu, 22 Nov 2018, Borislav Petkov wrote: > On Thu, Nov 22, 2018 at 11:30:04AM -0600, Josh Poimboeuf wrote: > > But it does describe its purpose, especially in relation to the > > 'spectre_v2=' option. > > Sure, but the thing I'm proposing > > spectre_v2_task_isol= > > describes it more

Re: [patch 15/24] x86/speculation: Add command line control for indirect branch speculation

2018-11-22 Thread Thomas Gleixner
On Thu, 22 Nov 2018, Borislav Petkov wrote: > On Thu, Nov 22, 2018 at 10:18:58AM +0100, Peter Zijlstra wrote: > > Right; that retpoline + IBPB case is one that came up earlier when we > > talked about this stuff. The IBPB also helps against app2app BTB ASLR > > attacks. So even if you have

Re: [patch 00/24] x86/speculation: Remedy the STIBP/IBPB overhead

2018-11-22 Thread Thomas Gleixner
On Wed, 21 Nov 2018, Tim Chen wrote: > On 11/21/2018 12:14 PM, Thomas Gleixner wrote: > > This is based on Tim Chen's V5 patch series. The following changes have > > been made: > > > ... > > > > TODO: Write documentation > > > > Andi took a crac

Re: [patch 17/24] x86/speculation: Move IBPB control out of switch_mm()

2018-11-22 Thread Thomas Gleixner
On Thu, 22 Nov 2018, Jiri Kosina wrote: > On Wed, 21 Nov 2018, Andi Kleen wrote: > > > > + * This could be optimized by keeping track of the last > > > + * user task per cpu and avoiding the barrier when the task > > > + * is immediately scheduled back and the thread

Re: [patch 22/24] x86/speculation: Create PRCTL interface to restrict indirect branch speculation

2018-11-22 Thread Thomas Gleixner
On Thu, 22 Nov 2018, Peter Zijlstra wrote: > On Wed, Nov 21, 2018 at 09:14:52PM +0100, Thomas Gleixner wrote: > > @@ -1453,6 +1453,8 @@ static inline bool is_percpu_thread(void > > #define PFA_SPREAD_SLAB2 /* Spread some slab > > caches over c

Re: [patch 15/24] x86/speculation: Add command line control for indirect branch speculation

2018-11-22 Thread Thomas Gleixner
On Thu, 22 Nov 2018, Thomas Gleixner wrote: > On Thu, 22 Nov 2018, Borislav Petkov wrote: > > > + > > > + /* Initialize Indirect Branch Prediction Barrier */ > > > + if (boot_cpu_has(X86_FEATURE_IBPB)) { > > > + setup_force_cpu_cap(X86_FEATURE_USE_IBP

Re: [patch 15/24] x86/speculation: Add command line control for indirect branch speculation

2018-11-22 Thread Thomas Gleixner
On Thu, 22 Nov 2018, Borislav Petkov wrote: > > + > > + /* Initialize Indirect Branch Prediction Barrier */ > > + if (boot_cpu_has(X86_FEATURE_IBPB)) { > > + setup_force_cpu_cap(X86_FEATURE_USE_IBPB); > > + pr_info("Spectre v2 mitigation: Enabling Indirect Branch > >

Re: [patch 01/24] x86/speculation: Update the TIF_SSBD comment

2018-11-21 Thread Thomas Gleixner
On Wed, 21 Nov 2018, Borislav Petkov wrote: > On Wed, Nov 21, 2018 at 11:48:41PM +0100, Thomas Gleixner wrote: > > Btw, I really do not like the app2app wording. I'd rather go for usr2usr, > > but that's kinda horrible as well. But then, all of this is horrible. > >

Re: [patch 01/24] x86/speculation: Update the TIF_SSBD comment

2018-11-21 Thread Thomas Gleixner
On Wed, 21 Nov 2018, Linus Torvalds wrote: > On Wed, Nov 21, 2018 at 12:28 PM Linus Torvalds > wrote: > > > > Ugh. Now you're using the broken quilt thing that makes a mush of emails > > for me. > > Reading the series in alpine makes it look fine. No testing, but each > patch seems sensible. >

Re: [Patch v7 14/18] x86/speculation: Add 'seccomp' Spectre v2 app to app protection mode

2018-11-21 Thread Thomas Gleixner
On Wed, 21 Nov 2018, Tim Chen wrote: > On 11/20/2018 04:08 PM, Tim Chen wrote: > > Will need this chunk added, which I missed in my update of Jiri's patch. Not only you ;) Thanks, tglx

Re: [patch 05/24] x86/speculation: Disable STIBP when enhanced IBRS is in use

2018-11-21 Thread Thomas Gleixner
On Wed, 21 Nov 2018, Thomas Gleixner wrote: > On Wed, 21 Nov 2018, Borislav Petkov wrote: > > > static char *stibp_state(void) > > > { > > > + if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED) > > > + return ""; > > > &

Re: [PATCH] timers: Make the lower-level timer function first call than higher-level

2018-11-21 Thread Thomas Gleixner
Song, On Tue, 20 Nov 2018, Muchun Song wrote: > John Stultz 于2018年11月20日周二 上午2:16写道: > > > > On Mon, Nov 19, 2018 at 6:10 AM, Muchun Song wrote: > > > The elements of the heads array are a linked list of timer events that > > > expire at the current time. And it can contain up to LVL_DEPTH

Re: [patch 10/24] sched/smt: Expose sched_smt_present static key

2018-11-21 Thread Thomas Gleixner
On Wed, 21 Nov 2018, Thomas Gleixner wrote: > Make the scheduler's 'sched_smt_present' static key globaly available, so > it can be used in the x86 speculation control code. > > Provide a query function and a stub for the CONFIG_SMP=n case. > > Signed-off-by: Thomas Gleixner

Re: [patch 05/24] x86/speculation: Disable STIBP when enhanced IBRS is in use

2018-11-21 Thread Thomas Gleixner
On Wed, 21 Nov 2018, Borislav Petkov wrote: > On Wed, Nov 21, 2018 at 09:14:35PM +0100, Thomas Gleixner wrote: > > From: Tim Chen > > > > If enhanced IBRS is active, STIBP is redundant for mitigating Spectre v2 > > user space exploits from hyperthread sibling.

Re: [patch 01/24] x86/speculation: Update the TIF_SSBD comment

2018-11-21 Thread Thomas Gleixner
On Wed, 21 Nov 2018, Linus Torvalds wrote: > On Wed, Nov 21, 2018 at 12:18 PM Thomas Gleixner wrote: > > > > From: Tim Chen "Reduced Data Speculation" is an obsolete term. > > Ugh. Now you're using the broken quilt thing that makes a mush of emails for > me.

[patch 03/24] x86/speculation: Remove unnecessary ret variable in cpu_show_common()

2018-11-21 Thread Thomas Gleixner
From: Tim Chen Signed-off-by: Tim Chen Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/bugs.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -847,8 +847,6 @@ static ssize_t l1tf_show_state(char *buf

[patch 04/24] x86/speculation: Reorganize cpu_show_common()

2018-11-21 Thread Thomas Gleixner
for STIBP and IBPB string selection into helper functions, so they can be extended later on. Signed-off-by: Tim Chen Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/bugs.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b

[patch 01/24] x86/speculation: Update the TIF_SSBD comment

2018-11-21 Thread Thomas Gleixner
From: Tim Chen "Reduced Data Speculation" is an obsolete term. The correct new name is "Speculative store bypass disable" - which is abbreviated into SSBD. Signed-off-by: Tim Chen Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/thread_info.h |2 +- 1 file

[patch 00/24] x86/speculation: Remedy the STIBP/IBPB overhead

2018-11-21 Thread Thomas Gleixner
This is based on Tim Chen's V5 patch series. The following changes have been made: - Control STIPB evaluation with a single static key - Move IBPB out from switch_mm() into switch_to() and control the always and the conditional mode with static keys. The mainline implementation

[patch 02/24] x86/speculation: Clean up spectre_v2_parse_cmdline()

2018-11-21 Thread Thomas Gleixner
From: Tim Chen Remove the unnecessary 'else' statement in spectre_v2_parse_cmdline() to save an indentation level. Signed-off-by: Tim Chen Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/bugs.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions

[patch 05/24] x86/speculation: Disable STIBP when enhanced IBRS is in use

2018-11-21 Thread Thomas Gleixner
From: Tim Chen If enhanced IBRS is active, STIBP is redundant for mitigating Spectre v2 user space exploits from hyperthread sibling. Disable STIBP when enhanced IBRS is used. Signed-off-by: Tim Chen Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/bugs.c |7 +++ 1 file

[patch 06/24] x86/speculation: Rename SSBD update functions

2018-11-21 Thread Thomas Gleixner
have "speculative_store" or "ssb" in their names. For enhanced mitigation control other bits in SPEC_CTRL MSR need to be updated as well, which makes the SSB names inadequate. Rename the "speculative_store*" functions to a more generic name. Signed-off-by: Tim Chen

[patch 08/24] sched/smt: Make sched_smt_present track topology

2018-11-21 Thread Thomas Gleixner
the key count the number of cores that have SMT enabled. In particular, the SMT topology bits are set before interrrupts are enabled and similarly, are cleared after interrupts are disabled for the last time and the CPU dies. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner

[patch 11/24] x86/speculation: Rework SMT state change

2018-11-21 Thread Thomas Gleixner
state is more interesting than the fact that siblings could be enabled. Rework the code, so arch_smt_update() is invoked from each individual CPU hotplug function, and simplify the update function while at it. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/bugs.c | 11

[patch 12/24] x86/l1tf: Show actual SMT state

2018-11-21 Thread Thomas Gleixner
online anytime after launching the VM. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/bugs.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -832,13 +832,14 @@ static ssize_t l1tf_show_state(char *buf

[patch 10/24] sched/smt: Expose sched_smt_present static key

2018-11-21 Thread Thomas Gleixner
Make the scheduler's 'sched_smt_present' static key globaly available, so it can be used in the x86 speculation control code. Provide a query function and a stub for the CONFIG_SMP=n case. Signed-off-by: Thomas Gleixner --- include/linux/sched/topology.h |9 + kernel/sched/sched.h

[patch 16/24] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-21 Thread Thomas Gleixner
depend on SMP=y and on the static key controlling the conditional update. Rename it to TIF_SPEC_IB because it controls both STIBP and IBPB ] Signed-off-by: Tim Chen Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/msr-index.h |5 +++-- arch/x86/include/asm/spec

[patch 15/24] x86/speculation: Add command line control for indirect branch speculation

2018-11-21 Thread Thomas Gleixner
argument is either 'on' or 'off' this implies that the application to application control follows that state even if when a contradicting spectre_v2_app2app= argument is supplied. Originally-by: Tim Chen Signed-off-by: Thomas Gleixner --- Documentation/admin-guide/kernel-parameters.txt | 22

[patch 17/24] x86/speculation: Move IBPB control out of switch_mm()

2018-11-21 Thread Thomas Gleixner
where the TIF bit is not set. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/nospec-branch.h |2 + arch/x86/include/asm/spec-ctrl.h | 46 +++ arch/x86/include/asm/tlbflush.h |2 - arch/x86/kernel/cpu/bugs.c | 16

[patch 23/24] x86/speculation: Enable PRCTL mode for spectre_v2_app2app

2018-11-21 Thread Thomas Gleixner
the conditional IBPB evaluation on context switch. Signed-off-by: Thomas Gleixner --- Documentation/admin-guide/kernel-parameters.txt |5 ++ arch/x86/kernel/cpu/bugs.c | 46 +--- 2 files changed, 45 insertions(+), 6 deletions(-) --- a/Documentation/admin

[patch 24/24] x86/speculation: Add seccomp Spectre v2 app to app protection mode

2018-11-21 Thread Thomas Gleixner
attacked. IBPB is issued when the task switches out, so malicious sandbox code cannot mistrain the branch predictor for the next user space task on the same logical processor. Signed-off-by: Jiri Kosina Signed-off-by: Thomas Gleixner --- Documentation/admin-guide/kernel-parameters.txt |7

[patch 20/24] x86/speculation: Split out TIF update

2018-11-21 Thread Thomas Gleixner
-by: Thomas Gleixner --- arch/x86/kernel/cpu/bugs.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -703,10 +703,25 @@ static void ssb_select_mitigation(void) #undef pr_fmt #define pr_fmt

[patch 21/24] x86/speculation: Prepare arch_smt_update() for PRCTL mode

2018-11-21 Thread Thomas Gleixner
The upcoming fine grained per task STIBP control needs to be updated on CPU hotplug as well. Split out the code which controls the strict mode so the prctl control code can be added later. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/bugs.c | 46

[patch 22/24] x86/speculation: Create PRCTL interface to restrict indirect branch speculation

2018-11-21 Thread Thomas Gleixner
branch speculation with - prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_INDIR_BRANCH, PR_SPEC_FORCE_DISABLE, 0, 0); See Documentation/userspace-api/spec_ctrl.rst. Signed-off-by: Tim Chen Signed-off-by: Thomas Gleixner --- Documentation/userspace-api/spec_ctrl.rst |9 +++ arch/x86/include/asm

[patch 19/24] ptrace: Remove unused ptrace_may_access_sched() and MODE_IBRS

2018-11-21 Thread Thomas Gleixner
The IBPB control code in x86 removed the usage. Remove the functionality which was introduced for this. Signed-off-by: Thomas Gleixner --- include/linux/ptrace.h | 17 - kernel/ptrace.c| 10 -- 2 files changed, 27 deletions(-) --- a/include/linux/ptrace.h

[patch 07/24] x86/speculation: Reorganize speculation control MSRs update

2018-11-21 Thread Thomas Gleixner
() helper function. This makes it easy to pick the right speculation control MSR and the bits in the MSR that needs updating based on TIF flags changes. Originally-by: Thomas Lendacky Signed-off-by: Tim Chen Signed-off-by: Thomas Gleixner --- arch/x86/kernel/process.c | 42

[patch 13/24] x86/speculation: Reorder the spec_v2 code

2018-11-21 Thread Thomas Gleixner
Reorder the code so it is better grouped. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/bugs.c | 168 ++--- 1 file changed, 84 insertions(+), 84 deletions(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -124,29 +124,6

[patch 09/24] x86/Kconfig: Select SCHED_SMT if SMP enabled

2018-11-21 Thread Thomas Gleixner
to the speculation control code. Alternatively the scheduler's static key could be made always available when CONFIG_SMP is enabled, but that's just adding an unused static key to every other architecture for nothing. Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig |8 +--- 1 file changed, 1

[patch 18/24] x86/speculation: Avoid __switch_to_xtra() calls

2018-11-21 Thread Thomas Gleixner
and at run time when the static key controlling the conditional STIBP mode is disabled. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/spec-ctrl.h |5 + arch/x86/include/asm/thread_info.h | 13 +++-- arch/x86/kernel/process_32.c |9 + arch/x86/kernel

[patch 14/24] x86/speculation: Unify conditional spectre v2 print functions

2018-11-21 Thread Thomas Gleixner
There is no point in having two functions and a conditional at the call site. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/bugs.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -257,15

Re: [Patch v7 14/18] x86/speculation: Add 'seccomp' Spectre v2 app to app protection mode

2018-11-21 Thread Thomas Gleixner
On Tue, 20 Nov 2018, Tim Chen wrote: > According to software guidance: > > "Setting ... STIBP ... on a logical processor prevents the predicted > targets of indirect branches on any logical processor of that core > from being controlled by software that executes (or executed > previously) on

Re: [Patch v7 09/18] x86/smt: Convert cpu_smt_control check to cpu_smt_enabled static key

2018-11-21 Thread Thomas Gleixner
On Tue, 20 Nov 2018, Tim Chen wrote: > #if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_SMT) > -extern enum cpuhp_smt_control cpu_smt_control; > +DECLARE_STATIC_KEY_TRUE(cpu_smt_enabled); > +#define cpu_use_smt_and_hotplug (static_branch_likely(_smt_enabled)) Errm. No. This looks like a

Re: [Patch v7 10/18] x86/speculation: Turn on or off STIBP according to a task's TIF_STIBP

2018-11-21 Thread Thomas Gleixner
On Tue, 20 Nov 2018, Tim Chen wrote: > diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c > index 74bef48..48fcd46 100644 > --- a/arch/x86/kernel/process.c > +++ b/arch/x86/kernel/process.c > @@ -406,6 +406,8 @@ static __always_inline void spec_ctrl_update_msr(unsigned > long

Re: vector space exhaustion on 4.14 LTS kernels

2018-11-21 Thread Thomas Gleixner
Josh, On Mon, 19 Nov 2018, Josh Hunt wrote: > We have a class of machines that appear to be exhausting the vector space on > cpus 0 and 1 which causes some breakage later on when trying to set the > affinity. The boxes are running the 4.14 LTS kernel. > > [ 39.531385] __assign_irq_vector:

Re: [PATCH v2] debugobjects: scale the static pool size

2018-11-20 Thread Thomas Gleixner
On Tue, 20 Nov 2018, Waiman Long wrote: > On 11/20/2018 03:14 PM, Qian Cai wrote: > > static struct debug_obj_descr *descr_test __read_mostly; > > The calculation for ODEBUG_POOL_SIZE is somewhat hard to read. Maybe you > can do something like > > #ifdef CONFIG_DEBUG_OBJECTS_WORK >

Re: [Patch v5 11/16] x86/speculation: Add Spectre v2 app to app protection modes

2018-11-19 Thread Thomas Gleixner
On Mon, 19 Nov 2018, Tim Chen wrote: > On 11/19/2018 05:32 AM, Thomas Gleixner wrote: > > On Fri, 16 Nov 2018, Tim Chen wrote: > >> The protection mode can be specified by the spectre_v2_app2app > >> boot parameter with the following semantics: > >> > >&

Re: [Patch v5 11/16] x86/speculation: Add Spectre v2 app to app protection modes

2018-11-19 Thread Thomas Gleixner
On Mon, 19 Nov 2018, Andrea Arcangeli wrote: > On Mon, Nov 19, 2018 at 01:33:08PM -0800, Dave Hansen wrote: > > Here's the current description: > > > > > Setting ... STIBP ... on a logical processor prevents the predicted > > > targets of indirect branches on any logical processor of that core >

Re: [Patch v5 11/16] x86/speculation: Add Spectre v2 app to app protection modes

2018-11-19 Thread Thomas Gleixner
On Tue, 20 Nov 2018, Jiri Kosina wrote: > On Mon, 19 Nov 2018, Dave Hansen wrote: > > > > What? IBPB makes tons of sense even without STIBP. > > > > I'm lost. :) > > > > I don't think anyone is talking about using STIBP *everywhere* that IBPB > > is in-use. > > > > We're just guessing that, if

Re: [Patch v5 11/16] x86/speculation: Add Spectre v2 app to app protection modes

2018-11-19 Thread Thomas Gleixner
On Tue, 20 Nov 2018, Jiri Kosina wrote: > On Tue, 20 Nov 2018, Thomas Gleixner wrote: > > > What? IBPB makes tons of sense even without STIBP. > > On non-SMT, yes. But this patchset ties those two the other (sensible) way > around AFAICS ("STIBP iff (IBPB &&am

Re: [Patch v5 11/16] x86/speculation: Add Spectre v2 app to app protection modes

2018-11-19 Thread Thomas Gleixner
On Mon, 19 Nov 2018, Tim Chen wrote: > On 11/19/2018 12:55 PM, Jiri Kosina wrote: > > On Mon, 19 Nov 2018, Thomas Gleixner wrote: > > > >> > >> So before that change IBPB was usable without STIBP, now not longer. What's > >> the rationale? > >>

Re: [Patch v5 11/16] x86/speculation: Add Spectre v2 app to app protection modes

2018-11-19 Thread Thomas Gleixner
On Mon, 19 Nov 2018, Jiri Kosina wrote: > On Mon, 19 Nov 2018, Thomas Gleixner wrote: > > > > @@ -452,12 +542,6 @@ static void __init spectre_v2_select_mitigation(void) > > > setup_force_cpu_cap(X86_FEATURE_RSB_CTXSW); > > > pr_info("Spectre v2 / Spectre

Re: [Patch v5 11/16] x86/speculation: Add Spectre v2 app to app protection modes

2018-11-19 Thread Thomas Gleixner
On Fri, 16 Nov 2018, Tim Chen wrote: > +static const struct { > + const char *option; > + enum spectre_v2_app2app_mitigation_cmd cmd; > + bool secure; > +} app2app_options[] = { > + { "off",SPECTRE_V2_APP2APP_CMD_NONE, false }, > + { "lite",

Re: [Patch v5 11/16] x86/speculation: Add Spectre v2 app to app protection modes

2018-11-19 Thread Thomas Gleixner
On Fri, 16 Nov 2018, Tim Chen wrote: > +static enum spectre_v2_app2app_mitigation_cmd __init > + spectre_v2_parse_app2app_cmdline(enum spectre_v2_mitigation_cmd > v2_cmd) > +{ > + enum spectre_v2_app2app_mitigation_cmd cmd; > + char arg[20]; > + int ret, i; > + > + if

Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Thomas Gleixner
Tim, On Mon, 19 Nov 2018, Tim Chen wrote: > On 11/19/2018 06:57 AM, Peter Zijlstra wrote: > > In particular, the SMT topology bits are set before we enable > > interrrupts and similarly, are cleared after we disable interrupts for > > the last time and die. > > > Peter & Thomas, > > Any

Re: [PATCH] debugobjects: add a new Kconfig for POOL_SIZE

2018-11-19 Thread Thomas Gleixner
On Mon, 19 Nov 2018, Waiman Long wrote: > On 11/19/2018 10:17 AM, Qian Cai wrote: > > Right, I can remember that now . However, if I understand correctly, since > > the > > early static pool size needs to be determined during the compilation time, > > it > > depends on the No. CPUs are from the

Re: [Patch v5 11/16] x86/speculation: Add Spectre v2 app to app protection modes

2018-11-19 Thread Thomas Gleixner
On Fri, 16 Nov 2018, Tim Chen wrote: > +DEFINE_STATIC_KEY_FALSE(spectre_v2_app_lite); > +EXPORT_SYMBOL_GPL(spectre_v2_app_lite); Why would this be exported? The only usage site outside of this code is in tlb.c which is hardly modular. > @@ -328,14 +411,19 @@ static bool stibp_needed(void) >

Re: [Patch v5 11/16] x86/speculation: Add Spectre v2 app to app protection modes

2018-11-19 Thread Thomas Gleixner
On Mon, 19 Nov 2018, Jiri Kosina wrote: > On Mon, 19 Nov 2018, Thomas Gleixner wrote: > > > > On Sat, 17 Nov 2018, Jiri Kosina wrote: > > > > > Subject: [PATCH] x86/speculation: enforce STIBP for SECCOMP tasks in lite > > > mode > > > > >

Re: [Patch v5 11/16] x86/speculation: Add Spectre v2 app to app protection modes

2018-11-19 Thread Thomas Gleixner
On Sun, 18 Nov 2018, Jiri Kosina wrote: > On Sat, 17 Nov 2018, Jiri Kosina wrote: > Subject: [PATCH] x86/speculation: enforce STIBP for SECCOMP tasks in lite mode > > If 'lite' mode of app2app protection from spectre_v2 is selected on > kernel command-line, we are currently applying STIBP

Re: [Patch v5 11/16] x86/speculation: Add Spectre v2 app to app protection modes

2018-11-19 Thread Thomas Gleixner
Tim, On Fri, 16 Nov 2018, Tim Chen wrote: > Add new protection modes for Spectre v2 mitigations against > Spectre v2 attacks on user processes. There are three modes: > > strict mode: > In this mode, IBPB and STIBP are deployed full > time to protect all processes. > >

Re: [Patch v5 09/16] x86/smt: Convert cpu_smt_control check to cpu_smt_enabled static key

2018-11-19 Thread Thomas Gleixner
On Mon, 19 Nov 2018, Thomas Gleixner wrote: > Tim, > > On Fri, 16 Nov 2018, Tim Chen wrote: > > > > +static char *l1tf_show_smt_vulnerable(void) > > +{ > > + if (static_branch_likely(_smt_enabled)) > > + return "vulnerable"; > &

Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Thomas Gleixner
On Fri, 16 Nov 2018, Tim Chen wrote: > In later code, STIBP will be turned on/off in the context switch code > path when SMT is enabled. Checks for SMT is best > avoided on such hot paths. > > Create cpu_smt_enabled static key to turn on such SMT specific code > statically. > > This key is set

Re: STIBP by default.. Revert?

2018-11-19 Thread Thomas Gleixner
On Sun, 18 Nov 2018, Tim Chen wrote: > On 11/18/2018 02:17 PM, Jiri Kosina wrote: > > On Sun, 18 Nov 2018, Linus Torvalds wrote: > > > >>> So, I think it's as theoretical as any other spectrev2 (only with the > >>> extra "HT" condition added on top). > >> > >> What? No. > >> > >> It's *way* more

Re: [Patch v5 09/16] x86/smt: Convert cpu_smt_control check to cpu_smt_enabled static key

2018-11-19 Thread Thomas Gleixner
Tim, On Fri, 16 Nov 2018, Tim Chen wrote: > > +static char *l1tf_show_smt_vulnerable(void) > +{ > + if (static_branch_likely(_smt_enabled)) > + return "vulnerable"; > + else > + return "disabled"; so an UP kernel will now report vulnerable. > ---

Re: WARNING in enqueue_task_dl

2018-11-19 Thread Thomas Gleixner
Adding scheduler folks On Sun, 18 Nov 2018, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:1ce80e0fe98e Merge tag 'fsnotify_for_v4.20-rc3' of git://g.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=14ddbb0b40 >

Re: [PATCH] debugobjects: add a new Kconfig for POOL_SIZE

2018-11-19 Thread Thomas Gleixner
Qian, On Sun, 18 Nov 2018, Qian Cai wrote: > > On Nov 18, 2018, at 1:21 PM, Thomas Gleixner wrote: > > On Sun, 18 Nov 2018, Qian Cai wrote: > >> As the results, systems have 60+ CPUs with both timer and workqueue > >> objects enabled could trigger "ODE

Re: [PATCH] debugobjects: add a new Kconfig for POOL_SIZE

2018-11-18 Thread Thomas Gleixner
Qian, On Sun, 18 Nov 2018, Qian Cai wrote: > The current value of ODEBUG_POOL_SIZE is not big enough for large memory > systems with timer or/and workqueue objects because during the early > boot, timer objects needs at least the size equals to > > No. CPUs x 2 (worker pool) > > start_kernel >

Re: [RFC PATCH 13/13] m68k: mvme16x: Convert to clocksource APIy

2018-11-18 Thread Thomas Gleixner
Finn, On Wed, 14 Nov 2018, Finn Thain wrote: > On Tue, 13 Nov 2018, Thomas Gleixner wrote: > > Urgh. Then you have more serious trouble. If the interrupting handler > > calls any of the time accessor functions then you can actually live lock > > when the interrupt

Re: [RFC PATCH 13/13] m68k: mvme16x: Convert to clocksource APIy

2018-11-13 Thread Thomas Gleixner
On Wed, 14 Nov 2018, Finn Thain wrote: > On Tue, 13 Nov 2018, I wrote: > > > On Mon, 12 Nov 2018, Thomas Gleixner wrote: > > > > > > +static u32 clk_total; > > > > + > > > > +#define PCC_TIMER_CLOCK_FREQ 100 > >

Re: [PATCH 1/3] dt-bindings: reset: Add bindings for the Meson-AXG SoC Reset Controller

2018-11-12 Thread Thomas Gleixner
Yixun, On Fri, 10 Nov 2017, Yixun Lan wrote: > +/* > + * > + * Copyright (c) 2016 BayLibre, SAS. > + * Author: Neil Armstrong > + * > + * Copyright (c) 2017 Amlogic, inc. > + * Author: Yixun Lan > + * > + * SPDX-License-Identifier: (GPL-2.0+ OR BSD) There are two things wrong: 1) The

[PATCH] selftests/ftrace: Fix invalid SPDX identifiers

2018-11-12 Thread Thomas Gleixner
While GPL2.0 looks about right, the correct and valid identifiers for GPL v2 only code are 'GPL-2.0' or 'GPL-2.0-only'. Signed-off-by: Thomas Gleixner Cc: Masami Hiramatsu Cc: Shuah Khan (Samsung OSG) --- P.S.: checkpatch.pl emits a warning when crappy license ids are used tools/testing

Re: [RFC PATCH 13/13] m68k: mvme16x: Convert to clocksource API

2018-11-12 Thread Thomas Gleixner
Finn, On Mon, 12 Nov 2018, Finn Thain wrote: First of all, thanks for tackling this! > +static u32 clk_total; > + > +#define PCC_TIMER_CLOCK_FREQ 100 > +#define PCC_TIMER_CYCLES (PCC_TIMER_CLOCK_FREQ / HZ) > + > static irqreturn_t mvme16x_timer_int (int irq, void *dev_id) > { > +

Re: [GIT pull] scheduler fixes for 4.20

2018-11-11 Thread Thomas Gleixner
Linus, On Sun, 11 Nov 2018, Linus Torvalds wrote: > On Sun, Nov 11, 2018 at 2:11 AM Thomas Gleixner wrote: > > > >git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git > > sched-urgent-for-linus > > Hmm. I get > >Already up to date. > > wit

[GIT pull] perf fixes for 4.20

2018-11-11 Thread Thomas Gleixner
Linus, please pull the latest perf-urgent-for-linus git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-for-linus A bunch of perf tooling fixes: - Make the Intel PT SQL viewer more robust - Make the Intel PT debug log more useful - Support weak

[GIT pull] locking fixes for 4.20

2018-11-11 Thread Thomas Gleixner
Linus, please pull the latest locking-urgent-for-linus git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking-urgent-for-linus A single fix for a build fail with CONFIG_PROFILE_ALL_BRANCHES=y in the qspinlock code. Thanks, tglx --> Peter

[GIT pull] core fixes for 4.20

2018-11-11 Thread Thomas Gleixner
Linus, please pull the latest core-urgent-for-linus git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-for-linus A couple of fixlets for the core: - Kernel doc function documentation fixes - Missing prototypes for weak watchdog functions Thanks,

[GIT pull] timer fixes for 4.20

2018-11-11 Thread Thomas Gleixner
Linus, please pull the latest timers-urgent-for-linus git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-for-linus Just the removal of a redundant call into the sched deadline overrun check. Thanks, tglx --> Juri Lelli (1):

[GIT pull] x86 fixes for 4.20

2018-11-11 Thread Thomas Gleixner
Linus, please pull the latest x86-urgent-for-linus git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-for-linus A set of x86 fixes: - Cure the LDT remapping to user space on 5 level paging which ended up in the KASLR space - Remove LDT mapping

[GIT pull] scheduler fixes for 4.20

2018-11-11 Thread Thomas Gleixner
Linus, please pull the latest sched-urgent-for-linus git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched-urgent-for-linus Two small scheduler fixes: - Take hotplug lock in sched_init_smp(). Technically not really required, but lockdep will complain other.

Re: [PATCH] x86/mkpiggy: Drop endianness transforming

2018-11-09 Thread Thomas Gleixner
Cao, On Fri, 9 Nov 2018, Cao jin wrote: > gzip file has 4-byte little-endian file size encoded at the end of file, > while all the other compressed kernel file has size_append operation in > the Makefile which also append the 4-byte little-endian file size. There > is no need to do endianness

Re: [RFC PATCH v2 1/2] x86/fpu: detect AVX task

2018-11-09 Thread Thomas Gleixner
Aubrey, On Thu, 8 Nov 2018, Aubrey Li wrote: > Subject: x86/fpu: detect AVX task What is an AVX task? I know what you mean, but for the casual reader this is not very informative. So something like: x86/fpu: Track AVX usage of tasks would be more informative and precise. The mechanism

Re: [PATCH] irq/irq_sim: add locking

2018-11-09 Thread Thomas Gleixner
On Thu, 8 Nov 2018, Uwe Kleine-König wrote: > On Thu, Nov 08, 2018 at 05:47:48PM +0100, Bartosz Golaszewski wrote: > > @@ -74,6 +74,7 @@ int irq_sim_init(struct irq_sim *sim, unsigned int > > num_irqs) > > } > > > > init_irq_work(>work_ctx.work, irq_sim_handle_irq); > > +

Re: [PATCH] posix-timers: Use array safe helper when fetching notification symbolic name

2018-11-09 Thread Thomas Gleixner
to make sure we won't hit it again in furher modifications. > > Cc: Andrey Vagin > Cc: Thomas Gleixner > Signed-off-by: Cyrill Gorcunov > --- > fs/proc/base.c |6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >

Re: [patch 2/2] Documentation/process: Add tip tree handbook

2018-11-08 Thread Thomas Gleixner
On Thu, 8 Nov 2018, Greg KH wrote: > On Thu, Nov 08, 2018 at 08:58:32PM +0100, Thomas Gleixner wrote: > > Fixes: 1234567890AB ("subsys/comp: Short summary") > > Backport-to: 4.14 > > Ick, no. Just stick to the "Fixes:" tag. My scripts c

Re: [patch 2/2] Documentation/process: Add tip tree handbook

2018-11-08 Thread Thomas Gleixner
On Thu, 8 Nov 2018, Theodore Y. Ts'o wrote: > On Thu, Nov 08, 2018 at 09:19:33AM -0800, Dan Williams wrote: > > > > I know at least StGit mail does not grok that "#"notation. I've > > stopped using it in favor of a "Fixes:" tag. I would think "Fixes:" is > > preferred over "# " if only because

Re: [patch 2/2] Documentation/process: Add tip tree handbook

2018-11-08 Thread Thomas Gleixner
On Thu, 8 Nov 2018, Paul E. McKenney wrote: > On Thu, Nov 08, 2018 at 09:19:33AM -0800, Dan Williams wrote: > > On Thu, Nov 8, 2018 at 1:13 AM Peter Zijlstra wrote: > > > > > > On Thu, Nov 08, 2018 at 08:40:12AM +0100, Ingo Molnar wrote: > > > > > + - Cc: ``cc-ed-person `` > > > > > + > > > > > +

Re: [patch 0/2] Documentation/process: Add subsystem/tree handbook

2018-11-08 Thread Thomas Gleixner
Jon, On Thu, 8 Nov 2018, Jonathan Corbet wrote: > On Wed, 7 Nov 2018 21:51:38 +0100 (CET) > Thomas Gleixner wrote: > > + SOB chains should reflect the *real* route a patch took as it was > > + propagated to us, with the first SOB entry signalling primary > > +

Re: [PATCH v2] x86/cpu: fix prototype warning

2018-11-08 Thread Thomas Gleixner
Borislav, On Thu, 8 Nov 2018, Borislav Petkov wrote: > And frankly, I don't see why we should be fixing all those. So what if a > global function does't have a previous prototype declaration?! Global function declarations must have a prototype definition, really. Otherwise you can change the

Re: [Patch v4 07/18] x86/smt: Convert cpu_smt_control check to cpu_smt_enabled static key

2018-11-08 Thread Thomas Gleixner
Tim, On Wed, 7 Nov 2018, Tim Chen wrote: > On 11/03/2018 11:29 AM, Thomas Gleixner wrote: > > Tim, > > > > On Tue, 30 Oct 2018, Tim Chen wrote: > > > >> Change the SMT code paths check from using cpu_smt_control to > >> cpu_smt_enab

Re: [PATCH stable 4.9] posix-timers: Sanitize overrun handling

2018-11-07 Thread Thomas Gleixner
Florian, On Wed, 7 Nov 2018, Florian Fainelli wrote: > On 11/1/18 1:02 PM, Florian Fainelli wrote: > > From: Thomas Gleixner > > > > [ Upstream commit 78c9c4dfbf8c04883941445a195276bb4bb92c76 ] > > > > The posix timer overrun handling is broken because the fo

Re: [Patch v4 17/18] x86/speculation: Update SPEC_CTRL MSRs of remote CPUs

2018-11-07 Thread Thomas Gleixner
Tim, On Tue, 6 Nov 2018, Tim Chen wrote: > >>> 2) Add _TIF_UPDATE_SPEC_CTRL to the SYSCALL_EXIT_WORK_FLAGS and handle it > >>>in the slow work path. > >> > >> There can be tasks that don't do any syscalls, and it seems like we can > >> have MSRs getting out of sync? > > > > Setting the TIF

Re: [PATCH 2/2] mm/sparse: add common helper to mark all memblocks present

2018-11-07 Thread Thomas Gleixner
On Wed, 7 Nov 2018, Andrew Morton wrote: > On Wed, 7 Nov 2018 13:36:34 -0700 Logan Gunthorpe wrote: > > > > Actually if both names suck, then there also is the option to rename both > > > instead of adding a comment to explain the suckage. > > > > Ok, well, I wasn't expecting to take on a big

Re: [patch 0/2] Documentation/process: Add subsystem/tree handbook

2018-11-07 Thread Thomas Gleixner
Dan, On Wed, 7 Nov 2018, Dan Williams wrote: > On Wed, Nov 7, 2018 at 11:49 AM Jonathan Corbet wrote: > > The stuff that is truly specific to tip seems fairly minimal: > > > > - what goes into tip > > - the reverse fir tree thing > > - tail comments, or the distaste thereabouts > > -

Re: [PATCH 2/2] mm/sparse: add common helper to mark all memblocks present

2018-11-07 Thread Thomas Gleixner
Logan, On Wed, 7 Nov 2018, Logan Gunthorpe wrote: > On 2018-11-07 1:12 p.m., Andrew Morton wrote: > >> +void __init memblocks_present(void) > >> +{ > >> + struct memblock_region *reg; > >> + > >> + for_each_memblock(memory, reg) { > >> + memory_present(memblock_get_region_node(reg), >

RE: [tip:irq/core] genirq/matrix: Improve target CPU selection for managed interrupts.

2018-11-07 Thread Thomas Gleixner
Michael, On Wed, 7 Nov 2018, Michael Kelley wrote: > > 2) Managed interrupts: > > > > Managed interrupts guarantee vector reservation when the MSI/MSI-X > > functionality of a device is enabled, which is achieved by reserving > > vectors in the bitmaps of the possible target CPUs.

Re: [patch 2/2] Documentation/process: Add tip tree handbook

2018-11-07 Thread Thomas Gleixner
On Wed, 7 Nov 2018, Thomas Gleixner wrote: > Add a document to the subsystem/maintainer handbook section, which explains > what the tip tree is, how it operates and what rules and expectations it > has. Peter asked me to add a section about locking comments. I added it and forgot t

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