Re: [PATCH] irq: Request and release resources for chained IRQs

2018-12-07 Thread Thomas Gleixner
Linus, On Fri, 7 Dec 2018, Linus Walleij wrote: > On Fri, Dec 7, 2018 at 12:52 PM Thomas Gleixner wrote: > > Needs more thought. Btw, the uninstall path does not invoke irq_deactive() > > either I so hate that chained handler mess > > I think it is just extreme

Re: [PATCH] irq: Request and release resources for chained IRQs

2018-12-07 Thread Thomas Gleixner
On Fri, 7 Dec 2018, Linus Walleij wrote: Sorry for answering late. > On Thu, Nov 29, 2018 at 2:31 PM Linus Walleij > wrote: > > > > This irqchip is in drivers/pinctrl/qcom/pinctrl-msm.c and known > > as TLMM. TLMM == Totally Lost Manufacturer Mess? > > However, the irqchip core helpers in

Re: [PATCH 2/2] x86/speculation: switch_to_cond_stibp on is the likely case

2018-12-07 Thread Thomas Gleixner
On Fri, 7 Dec 2018, Peter Zijlstra wrote: > On Thu, Dec 06, 2018 at 10:38:00AM -0500, Waiman Long wrote: > > On 12/06/2018 03:41 AM, Peter Zijlstra wrote: > > > On Wed, Dec 05, 2018 at 02:49:28PM -0500, Waiman Long wrote: > > >> Since conditional STIBP is the default, it should be treated as > >

Re: [PATCH v2 2/5] genirq: Export irq_chip_set_wake_parent()

2018-12-06 Thread Thomas Gleixner
e this function to > >> propogate ->irq_set_wake() operations to their parent domains. > >> > >> Signed-off-by: Thierry Reding > > > > Tglx/Marc: is this change OK? (ACK?) > > It looks OK to me, as it is consistent with irq_chip_set_type_parent, > among others. > > Acked-by: Marc Zyngier No objections either: Acked-by: Thomas Gleixner

Re: [PATCH 3/3] irq/affinity: Fix a possible breakage

2018-12-05 Thread Thomas Gleixner
On Tue, 4 Dec 2018, Dou Liyang wrote: > In case of irq_default_affinity != cpu_possible_mask, setting the affinity > for the pre/post vectors to irq_default_affinity is a breakage. Why so? All interrupts which are not managed get te default affinity mask. It can be different than

Re: [PATCH] clocksource: Add heuristics to avoid switching away from TSC due to timer delay

2018-12-04 Thread Thomas Gleixner
Roland, On Fri, 30 Nov 2018, Roland Dreier wrote: > delta = clocksource_delta(csnow, cs->cs_last, cs->mask); > + > + /* If the cycle delta is beyond what we can safely > + * convert to nsecs, and the watchdog clocksource > + * suggests that

Re: [PATCH 4.14 098/146] x86/process: Consolidate and simplify switch_to_xtra() code

2018-12-04 Thread Thomas Gleixner
On Tue, 4 Dec 2018, Greg Kroah-Hartman wrote: > --- a/arch/x86/kernel/process_32.c > +++ b/arch/x86/kernel/process_32.c > @@ -234,7 +234,6 @@ __switch_to(struct task_struct *prev_p, > struct fpu *prev_fpu = >fpu; > struct fpu *next_fpu = >fpu; > int cpu = smp_processor_id(); > -

[GIT pull] x86/pti: Cure the STIBP fallout

2018-12-01 Thread Thomas Gleixner
(1): sched/smt: Make sched_smt_present track topology Thomas Gleixner (21): x86/speculation: Rename SSBD update functions x86/Kconfig: Select SCHED_SMT if SMP enabled sched/smt: Expose sched_smt_present static key x86/speculation: Rework SMT state change x86/l1tf: S

Re: [PATCH] x86/hyper-v: define structures from TLFS as packed

2018-11-30 Thread Thomas Gleixner
On Fri, 30 Nov 2018, Roman Kagan wrote: > On Fri, Nov 30, 2018 at 01:15:11PM +0100, Vitaly Kuznetsov wrote: > > Without 'packed' compiler is free to add optimization paddings and re-order > > structure fields for randomization/optimization. And structures from > > hyperv-tlfs.h are used for

Re: [PATCH] x86/hyper-v: define structures from TLFS as packed

2018-11-30 Thread Thomas Gleixner
ich would break the hypervisor ABI. Mark the structures as packed to prevent this. Hmm? > Suggested-by: Nadav Amit > Signed-off-by: Vitaly Kuznetsov Other than that: Acked-by: Thomas Gleixner

Re: [PATCH] io_apic: initialize irq with -EINVAL

2018-11-30 Thread Thomas Gleixner
Norbert, On Wed, 28 Nov 2018, Norbert Manthey wrote: thanks for the patch. > Subject: [PATCH] io_apic: initialize irq with -EINVAL io_apic is not a proper subsystem prefix. git log should give you a hint: x86/ioapic: Also please start the first word after the colon with an uppercase

Re: [PATCH] selftests/ftrace: Fix invalid SPDX identifiers

2018-11-29 Thread Thomas Gleixner
On Mon, 12 Nov 2018, Thomas Gleixner wrote: Polite reminder > 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

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-29 Thread Thomas Gleixner
On Thu, 29 Nov 2018, Vitaly Kuznetsov wrote: > Nadav Amit writes: > > >> On Nov 28, 2018, at 5:07 AM, Thomas Gleixner wrote: > >> > >> On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote: > >> > >>> Nadav Amit writes: > >>>

Re: [RFC PATCH v3] genirq/affinity: Create and transfer more irq desc info by a new structure

2018-11-28 Thread Thomas Gleixner
Dou, On Thu, 29 Nov 2018, Dou Liyang wrote: > +/** > + * struct irq_affinity_desc - Description for kinds of irq assignements > + * which will be transferred to irqdesc core Please align this proper * struct irq_affinity_desc - Description for kinds of irq assignements *

Re: [RFC PATCH v3] genirq/affinity: Create and transfer more irq desc info by a new structure

2018-11-28 Thread Thomas Gleixner
On Wed, 28 Nov 2018, Bjorn Helgaas wrote: > On Wed, Nov 28, 2018 at 10:45 AM Dou Liyang wrote: > > if (affd) > > - masks = irq_create_affinity_masks(nvec, affd); > > - > > + affi_desc = irq_create_affinity_desc(nvec, affd); > > > > /* MSI Entry

Re: [PATCH] softirq: don't push timer softirq handling to ksoftirqd

2018-11-28 Thread Thomas Gleixner
Michael, On Fri, 16 Nov 2018, Zhivich, Michael wrote: > On 11/15/18, 12:17 PM, "John Stultz" wrote: > Would a more focused fix be to move the clocksource watchdog from a > normal timer to a hrtimer? > > That's an interesting idea - it would get clocksource watchdog out of >

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

2018-11-28 Thread Thomas Gleixner
Song, On Wed, 21 Nov 2018, Thomas Gleixner wrote: > On Tue, 20 Nov 2018, Muchun Song wrote: > > Follow the current code logic, the timer0 function is called until the > > function call of timer1-5 is completed. So the delay of timer0 is the time > > spent by other timer func

[tip:x86/pti] x86/speculation: Provide IBPB always command line options

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 55a974021ec952ee460dc31ca08722158639de72 Gitweb: https://git.kernel.org/tip/55a974021ec952ee460dc31ca08722158639de72 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:56 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:14 +0100 x86/speculation

[tip:x86/pti] x86/speculation: Add seccomp Spectre v2 user space protection mode

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 6b3e64c237c072797a9ec918654a60e3a46488e2 Gitweb: https://git.kernel.org/tip/6b3e64c237c072797a9ec918654a60e3a46488e2 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:55 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:14 +0100 x86/speculation

[tip:x86/pti] x86/speculation: Enable prctl mode for spectre_v2_user

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 7cc765a67d8e04ef7d772425ca5a2a1e2b894c15 Gitweb: https://git.kernel.org/tip/7cc765a67d8e04ef7d772425ca5a2a1e2b894c15 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:54 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:13 +0100 x86/speculation

[tip:x86/pti] x86/speculation: Add prctl() control for indirect branch speculation

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 9137bb27e60e554dab694eafa4cca241fa3a694f Gitweb: https://git.kernel.org/tip/9137bb27e60e554dab694eafa4cca241fa3a694f Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:53 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:13 +0100 x86/speculation

[tip:x86/pti] x86/speculation: Prepare arch_smt_update() for PRCTL mode

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 6893a959d7fdebbab5f5aa112c277d5a44435ba1 Gitweb: https://git.kernel.org/tip/6893a959d7fdebbab5f5aa112c277d5a44435ba1 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:52 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:13 +0100 x86/speculation

[tip:x86/pti] x86/speculation: Prevent stale SPEC_CTRL msr content

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 6d991ba509ebcfcc908e009d1db51972a4f7a064 Gitweb: https://git.kernel.org/tip/6d991ba509ebcfcc908e009d1db51972a4f7a064 Author: Thomas Gleixner AuthorDate: Wed, 28 Nov 2018 10:56:57 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:12 +0100 x86/speculation

[tip:x86/pti] x86/speculation: Split out TIF update

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: e6da8bb6f9abb2628381904b24163c770e630bac Gitweb: https://git.kernel.org/tip/e6da8bb6f9abb2628381904b24163c770e630bac Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:51 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:12 +0100 x86/speculation

[tip:x86/pti] ptrace: Remove unused ptrace_may_access_sched() and MODE_IBRS

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 46f7ecb1e7359f183f5bbd1e08b90e10e52164f9 Gitweb: https://git.kernel.org/tip/46f7ecb1e7359f183f5bbd1e08b90e10e52164f9 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:50 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:11 +0100 ptrace: Remove

Re: WARN_ON_ONCE(!new_owner) within wake_futex_pi() triggered

2018-11-28 Thread Thomas Gleixner
Heiko, On Tue, 27 Nov 2018, Heiko Carstens wrote: > with the glibc self-tests I was able to trigger the "this should not > happen" warning ;) below on s390 (with panic_on_warn=1 set). It looks > like it is hardly reproducible. Any idea which self-test triggered that? > This one happened with

[tip:x86/pti] x86/speculation: Prepare for conditional IBPB in switch_mm()

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 4c71a2b6fd7e42814aa68a6dec88abf3b42ea573 Gitweb: https://git.kernel.org/tip/4c71a2b6fd7e42814aa68a6dec88abf3b42ea573 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:49 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:11 +0100 x86/speculation

[tip:x86/pti] x86/speculation: Reorder the spec_v2 code

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 15d6b7aab0793b2de8a05d8a828777dd24db424e Gitweb: https://git.kernel.org/tip/15d6b7aab0793b2de8a05d8a828777dd24db424e Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:41 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:08 +0100 x86/speculation

[tip:x86/pti] x86/process: Consolidate and simplify switch_to_xtra() code

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: ff16701a29cba3aafa0bd1656d766813b2d0a811 Gitweb: https://git.kernel.org/tip/ff16701a29cba3aafa0bd1656d766813b2d0a811 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:47 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:11 +0100 x86/process

[tip:x86/pti] x86/speculation: Avoid __switch_to_xtra() calls

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 5635d99953f04b550738f6f4c1c532667c3fd872 Gitweb: https://git.kernel.org/tip/5635d99953f04b550738f6f4c1c532667c3fd872 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:48 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:11 +0100 x86/speculation

[tip:x86/pti] x86/speculation: Unify conditional spectre v2 print functions

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 495d470e9828500e0155027f230449ac5e29c025 Gitweb: https://git.kernel.org/tip/495d470e9828500e0155027f230449ac5e29c025 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:44 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:09 +0100 x86/speculation

[tip:x86/pti] x86/speculation: Add command line control for indirect branch speculation

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: fa1202ef224391b6f5b26cdd44cc50495e8fab54 Gitweb: https://git.kernel.org/tip/fa1202ef224391b6f5b26cdd44cc50495e8fab54 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:45 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:10 +0100 x86/speculation

[tip:x86/pti] x86/speculation: Rework SMT state change

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: a74cfffb03b73d41e08f84c2e5c87dec0ce3db9f Gitweb: https://git.kernel.org/tip/a74cfffb03b73d41e08f84c2e5c87dec0ce3db9f Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:39 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:07 +0100 x86/speculation

[tip:x86/pti] x86/speculataion: Mark command line parser data __initdata

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 30ba72a990f5096ae08f284de17986461efcc408 Gitweb: https://git.kernel.org/tip/30ba72a990f5096ae08f284de17986461efcc408 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:43 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:09 +0100 x86/speculataion

[tip:x86/pti] x86/speculation: Mark string arrays const correctly

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 8770709f411763884535662744a3786a1806afd3 Gitweb: https://git.kernel.org/tip/8770709f411763884535662744a3786a1806afd3 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:42 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:09 +0100 x86/speculation

[tip:x86/pti] x86/l1tf: Show actual SMT state

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 130d6f946f6f2a972ee3ec8540b7243ab99abe97 Gitweb: https://git.kernel.org/tip/130d6f946f6f2a972ee3ec8540b7243ab99abe97 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:40 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:08 +0100 x86/l1tf: Show

[tip:x86/pti] x86/Kconfig: Select SCHED_SMT if SMP enabled

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: dbe733642e01dd108f71436aaea7b328cb28fd87 Gitweb: https://git.kernel.org/tip/dbe733642e01dd108f71436aaea7b328cb28fd87 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:37 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:07 +0100 x86/Kconfig

[tip:x86/pti] sched/smt: Expose sched_smt_present static key

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 321a874a7ef85655e93b3206d0f36b4a6097f948 Gitweb: https://git.kernel.org/tip/321a874a7ef85655e93b3206d0f36b4a6097f948 Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:38 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:07 +0100 sched/smt: Expose

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

2018-11-28 Thread Thomas Gleixner
On Sun, 25 Nov 2018, Thomas Gleixner wrote: > Thats hopefully the final version of this. Changes since V1: > > - Renamed the command line option and related code to spectre_v2_user= as > suggested by Josh. > > - Thought more about the back to back optimizatio

[tip:x86/pti] x86/speculation: Rename SSBD update functions

2018-11-28 Thread tip-bot for Thomas Gleixner
Commit-ID: 26c4d75b234040c11728a8acb796b3a85ba7507c Gitweb: https://git.kernel.org/tip/26c4d75b234040c11728a8acb796b3a85ba7507c Author: Thomas Gleixner AuthorDate: Sun, 25 Nov 2018 19:33:34 +0100 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:06 +0100 x86/speculation

Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h

2018-11-28 Thread Thomas Gleixner
On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote: > Nadav Amit writes: > > > > > On a different note: how come all of the hyper-v structs are not marked > > with the “packed" attribute? > > "packed" should not be needed with proper padding; I vaguely remember > someone (from x86@?) arguing

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

2018-11-28 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Tim Chen wrote: > On 11/27/2018 02:36 PM, Thomas Gleixner wrote: > >> We need this special handling only if the next task has TIF_SPEC_UPDATE > >> set, which is one-off event globally (when seccomp marks all its threads > >> so due to seccom

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-28 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Tim Chen wrote: > I think it will be cleaner just to fold the msr update into > __speculation_ctrl_update to fix this issue. Yes, that looks nicer and avoids a couple of extra static_cpu_has() evaluations. I'll fold it into the proper places. Thanks, tglx

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

2018-11-27 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Jiri Kosina wrote: > On Tue, 27 Nov 2018, Thomas Gleixner wrote: > > > > static int ssb_prctl_set(struct task_struct *task, unsigned long ctrl) > > > diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c > > > index

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

2018-11-27 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Jiri Kosina wrote: > struct thread_info { > unsigned long flags; /* low level flags */ > + unsigned long spec_flags; /* spec flags to sync on ctxsw > */ The information is already available in task->atomic_flags, no need for new

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-27 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Thomas Gleixner wrote: > On Tue, 27 Nov 2018, Lendacky, Thomas wrote: > > On 11/25/2018 12:33 PM, Thomas Gleixner wrote: > > > --- a/arch/x86/kernel/process.c > > > +++ b/arch/x86/kernel/process.c > > > @@ -406,6 +406,11 @@ stat

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-27 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Lendacky, Thomas wrote: > On 11/25/2018 12:33 PM, Thomas Gleixner wrote: > > --- a/arch/x86/kernel/process.c > > +++ b/arch/x86/kernel/process.c > > @@ -406,6 +406,11 @@ static __always_inline void spec_ctrl_up > > if (static_cpu_has(X86_FEATURE

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

2018-11-27 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Lendacky, Thomas wrote: > On 11/25/2018 12:33 PM, Thomas Gleixner wrote: > > +/* Update x86_spec_ctrl_base in case SMT state changed. */ > > +static void update_stibp_strict(void) > > { > > - wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_c

Re: [PATCH] x86/resctrl: Fix rdt_last_cmd_printf() usage and typos within

2018-11-26 Thread Thomas Gleixner
On Mon, 26 Nov 2018, Reinette Chatre wrote: > Use rdt_last_cmd_puts() instead of rdt_last_cmd_printf() when printing a > simple string. While doing so fix two typos that were recently > introduced into two of these simple strings. You're explaing what the patch is doing, but not why printf() is

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

2018-11-26 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Jiri Kosina wrote: > On Mon, 26 Nov 2018, Thomas Gleixner wrote: > > How about the minimalistic aproach below? (only compile tested so far, > applies on top of your latest WIP.x86/pti branch). The downside of course > is wasting another TIF bit. We need t

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

2018-11-26 Thread Thomas Gleixner
On Mon, 26 Nov 2018, Tim Chen wrote: > On 11/22/2018 11:37 PM, Ingo Molnar wrote: > >> We also had that discussion with SSBD and decided that we won't chase > >> threads and send IPIs around. Yes, it's not perfect, but not the end of the > >> world either. For PRCTL it's a non issue. > > Looks

Re: [patch V2 27/28] x86/speculation: Add seccomp Spectre v2 user space protection mode

2018-11-26 Thread Thomas Gleixner
On Mon, 26 Nov 2018, Andrea Arcangeli wrote: > Hello, > > On Sun, Nov 25, 2018 at 11:28:59PM +0100, Thomas Gleixner wrote: > > Indeed. Just checked the documentation again, it's also not clear whether > > IBPB is required if STIPB is in use. > > I tried to as

Re: [patch V2 21/28] x86/speculation: Prepare for conditional IBPB in switch_mm()

2018-11-25 Thread Thomas Gleixner
On Sun, 25 Nov 2018, Andy Lutomirski wrote: > > On Nov 25, 2018, at 2:20 PM, Thomas Gleixner wrote: > > On Sun, 25 Nov 2018, Andi Kleen wrote: > > > >>> The current check whether two tasks belong to the same context is using > >>> the > >>>

Re: [patch V2 21/28] x86/speculation: Prepare for conditional IBPB in switch_mm()

2018-11-25 Thread Thomas Gleixner
On Sun, 25 Nov 2018, Andi Kleen wrote: > On Sun, Nov 25, 2018 at 11:20:50PM +0100, Thomas Gleixner wrote: > > On Sun, 25 Nov 2018, Andi Kleen wrote: > > > > > > The current check whether two tasks belong to the same context is using > > > > the > &

Re: [patch V2 27/28] x86/speculation: Add seccomp Spectre v2 user space protection mode

2018-11-25 Thread Thomas Gleixner
On Sun, 25 Nov 2018, Linus Torvalds wrote: > [ You forgot to fix your quilt setup.. ] Duh. Should have pinned that package. > On Sun, 25 Nov 2018, Thomas Gleixner wrote: > > > > The mitigation guide documents how STIPB works: > > > >Setting bit 1 (ST

Re: [patch V2 21/28] x86/speculation: Prepare for conditional IBPB in switch_mm()

2018-11-25 Thread Thomas Gleixner
On Sun, 25 Nov 2018, Andi Kleen wrote: > > The current check whether two tasks belong to the same context is using the > > tasks context id. While correct, it's simpler to use the mm pointer because > > it allows to mangle the TIF_SPEC_IB bit into it. The context id based > > mechanism requires

Re: [patch V2 21/28] x86/speculation: Prepare for conditional IBPB in switch_mm()

2018-11-25 Thread Thomas Gleixner
On Sun, 25 Nov 2018, Thomas Gleixner wrote: > /* > + * Use bit 0 to mangle the TIF_SPEC_IB state into the mm pointer which is > + * stored in cpu_tlb_state.last_user_mm_ibpb. > + */ > +#define LAST_USER_MM_IBPB0x1UL > + > +/* > + unsigned long next_tif = task_

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

2018-11-25 Thread Thomas Gleixner
"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 changed, 1 inse

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

2018-11-25 Thread Thomas Gleixner
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(-) --- a/arch/x86

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

2018-11-25 Thread Thomas Gleixner
. 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 V2 03/28] x86/speculation: Remove unnecessary ret variable in cpu_show_common()

2018-11-25 Thread Thomas Gleixner
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 static ssize_t

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

2018-11-25 Thread Thomas Gleixner
Thats hopefully the final version of this. Changes since V1: - Renamed the command line option and related code to spectre_v2_user= as suggested by Josh. - Thought more about the back to back optimization and finally left the IBPB code in switch_mm(). It still removes the ptrace

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

2018-11-25 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 V2 15/28] x86/speculataion: Mark command line parser data __initdata

2018-11-25 Thread Thomas Gleixner
No point to keep that around. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/bugs.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -248,7 +248,7 @@ static const struct { const char *option

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

2018-11-25 Thread Thomas Gleixner
"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 Signed-off-by: Th

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

2018-11-25 Thread Thomas Gleixner
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 --- kernel/sched/core.c

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

2018-11-25 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 --- v1 -> v2: Move SMT stuff to separate header. Unbreaks ia64 bu

[patch V2 20/28] x86/speculation: Avoid __switch_to_xtra() calls

2018-11-25 Thread Thomas Gleixner
if TIF_SPEC_IB is the only set bit in the work masks. Optimize it out by masking the bit at compile time for CONFIG_SMP=n and at run time when the static key controlling the conditional STIBP mode is disabled. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/thread_info.h | 13

[patch V2 14/28] x86/speculation: Mark string arrays const correctly

2018-11-25 Thread Thomas Gleixner
checkpatch.pl muttered when reshuffling the code: WARNING: static const char * array should probably be static const char * const Fix up all the string arrays. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/bugs.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[patch V2 26/28] x86/speculation: Enable prctl mode for spectre_v2_user

2018-11-25 Thread Thomas Gleixner
the conditional IBPB evaluation on context switch. Signed-off-by: Thomas Gleixner --- V1 -> V2: Fix comments s/app2app/user/ Make the IBPB printout depend on the static keys as it can be independent of the mode, e.g. when SMT is not supported. Rem

[patch V2 23/28] x86/speculation: Split out TIF update

2018-11-25 Thread Thomas Gleixner
the comment about updates for other tasks. Signed-off-by: Thomas Gleixner --- V1 -> V2: Update comment. --- arch/x86/kernel/cpu/bugs.c | 35 +++ 1 file changed, 23 insertions(+), 12 deletions(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -702

[patch V2 25/28] x86/speculation: Add prctl() control for indirect branch speculation

2018-11-25 Thread Thomas Gleixner
indirect branch speculation with - prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_INDIRECT_BRANCH, PR_SPEC_FORCE_DISABLE, 0, 0); See Documentation/userspace-api/spec_ctrl.rst. Signed-off-by: Tim Chen Signed-off-by: Thomas Gleixner --- V1 -> V2: s/INDIR_/INDIRECT_/ in ABI s/INDIR_BRANCH

[patch V2 16/28] x86/speculation: Unify conditional spectre v2 print functions

2018-11-25 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

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

2018-11-25 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. Mark the SMP function call argument __unused while at it. Signed-off-by: Thomas Gleixner --- v1 -> v2

[patch V2 27/28] x86/speculation: Add seccomp Spectre v2 user space protection mode

2018-11-25 Thread Thomas Gleixner
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 |9 - arch/x86

[patch V2 17/28] x86/speculation: Add command line control for indirect branch speculation

2018-11-25 Thread Thomas Gleixner
the spectre_v2= command line argument is either 'on' or 'off' this implies that the application to application control follows that state even if a contradicting spectre_v2_user= argument is supplied. Originally-by: Tim Chen Signed-off-by: Thomas Gleixner --- V1 -> V2: Change the option to spectre_v2_u

[patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-25 Thread Thomas Gleixner
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 --- v1 -> v2: Remove pointless include. Use consistent comments. --- arch/x86/include/asm/

[patch V2 28/28] x86/speculation: Provide IBPB always command line options

2018-11-25 Thread Thomas Gleixner
Provide the possibility to enable IBPB always in combination with 'prctl' and 'seccomp'. Add the extra command line options and rework the IBPB selection to evaluate the command instead of the mode selected by the STIPB switch case. Signed-off-by: Thomas Gleixner --- Documentation/admin-guide

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

2018-11-25 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 V2 19/28] x86/process: Consolidate and simplify switch_to_xtra() code

2018-11-25 Thread Thomas Gleixner
. This is a preparatory change so integration of conditional indirect branch speculation optimization happens only in one place. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/switch_to.h |3 --- arch/x86/kernel/process.c| 12 +++- arch/x86/kernel/process.h

[patch V2 22/28] ptrace: Remove unused ptrace_may_access_sched() and MODE_IBRS

2018-11-25 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 V2 21/28] x86/speculation: Prepare for conditional IBPB in switch_mm()

2018-11-25 Thread Thomas Gleixner
-off-by: Thomas Gleixner --- arch/x86/include/asm/nospec-branch.h |2 arch/x86/include/asm/tlbflush.h |8 +- arch/x86/kernel/cpu/bugs.c | 29 +++-- arch/x86/mm/tlb.c| 109 +-- 4 files changed, 110 insertions(+), 38

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

2018-11-25 Thread Thomas Gleixner
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 changed, 7 insertions

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

2018-11-25 Thread Thomas Gleixner
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/arch/x86/kernel

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

2018-11-25 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 V2 11/28] x86/speculation: Rework SMT state change

2018-11-25 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 --- v1 -> v2: Adapt to new header sched/smt.h --- a

Re: [PATCH] debugobjects: call debug_objects_mem_init eariler

2018-11-23 Thread Thomas Gleixner
On Thu, 22 Nov 2018, Waiman Long wrote: > On 11/22/2018 11:31 PM, Qian Cai wrote: > > The current value of the early boot static pool size, 1024 is not big > > enough for systems with large number of CPUs with timer or/and workqueue > > objects selected. As the results, systems have 60+ CPUs with

Re: [PATCH] x86/TSC: Use RDTSCP

2018-11-23 Thread Thomas Gleixner
On Fri, 23 Nov 2018, h...@zytor.com wrote: > On November 23, 2018 12:03:07 PM PST, Guenter Roeck > wrote: > ># first bad commit: [2e94061096c5c3aa6c3fe3ec2bec176c1f9c1b07] x86/TSC: > >Use RDTSCP > > Right, because that cpu predates RDTSCP, so it needs to use a fallback. Well, that's not the

Re: [RFC PATCH v2] gen/irq: Change the way to differentiate between managed and unmanaged interrupts by bitmap

2018-11-23 Thread Thomas Gleixner
Dou, On Sat, 10 Nov 2018, Dou Liyang wrote: sorry for late reply. Travel, conferences > --- a/drivers/pci/msi.c > +++ b/drivers/pci/msi.c > @@ -673,14 +674,17 @@ static int msix_setup_entries(struct pci_dev *dev, void > __iomem *base, > const struct

[tip:timers/core] posix-timers: Remove license boilerplate

2018-11-23 Thread tip-bot for Thomas Gleixner
Commit-ID: 0141de741e0710d5e2e68087577329606f59ed71 Gitweb: https://git.kernel.org/tip/0141de741e0710d5e2e68087577329606f59ed71 Author: Thomas Gleixner AuthorDate: Wed, 31 Oct 2018 19:21:16 +0100 Committer: Thomas Gleixner CommitDate: Fri, 23 Nov 2018 11:51:22 +0100 posix-timers

[tip:timers/core] posix-clocks: Remove license boiler plate

2018-11-23 Thread tip-bot for Thomas Gleixner
Commit-ID: c804efeb58229e6040b9a200cbab1fc8c150f99d Gitweb: https://git.kernel.org/tip/c804efeb58229e6040b9a200cbab1fc8c150f99d Author: Thomas Gleixner AuthorDate: Wed, 31 Oct 2018 19:21:15 +0100 Committer: Thomas Gleixner CommitDate: Fri, 23 Nov 2018 11:51:22 +0100 posix-clocks

[tip:timers/core] posix-timers/stubs: Remove license boilerplate

2018-11-23 Thread tip-bot for Thomas Gleixner
Commit-ID: 3c8f2515ac0a986c8af6ba17c376f874306e71f4 Gitweb: https://git.kernel.org/tip/3c8f2515ac0a986c8af6ba17c376f874306e71f4 Author: Thomas Gleixner AuthorDate: Wed, 31 Oct 2018 19:21:13 +0100 Committer: Thomas Gleixner CommitDate: Fri, 23 Nov 2018 11:51:21 +0100 posix-timers/stubs

[tip:timers/core] sched/clock: Remove license boilerplate

2018-11-23 Thread tip-bot for Thomas Gleixner
Commit-ID: 2fa6d420c22268b30dc46c8cbfe8bec0e361e03e Gitweb: https://git.kernel.org/tip/2fa6d420c22268b30dc46c8cbfe8bec0e361e03e Author: Thomas Gleixner AuthorDate: Wed, 31 Oct 2018 19:21:14 +0100 Committer: Thomas Gleixner CommitDate: Fri, 23 Nov 2018 11:51:22 +0100 sched/clock

[tip:timers/core] time: Remove license boilerplate

2018-11-23 Thread tip-bot for Thomas Gleixner
Commit-ID: 6c7811c628a96fe00965622f3aa1cf272cb898f7 Gitweb: https://git.kernel.org/tip/6c7811c628a96fe00965622f3aa1cf272cb898f7 Author: Thomas Gleixner AuthorDate: Wed, 31 Oct 2018 19:21:12 +0100 Committer: Thomas Gleixner CommitDate: Fri, 23 Nov 2018 11:51:21 +0100 time: Remove

[tip:timers/core] time/debug: Remove license boilerplate

2018-11-23 Thread tip-bot for Thomas Gleixner
Commit-ID: 9281a7857b91cf4d283be7c86d80e5d091bfb3d9 Gitweb: https://git.kernel.org/tip/9281a7857b91cf4d283be7c86d80e5d091bfb3d9 Author: Thomas Gleixner AuthorDate: Wed, 31 Oct 2018 19:21:11 +0100 Committer: Thomas Gleixner CommitDate: Fri, 23 Nov 2018 11:51:21 +0100 time/debug: Remove

[tip:timers/core] hrtimers/tick/clockevents: Remove sloppy license references

2018-11-23 Thread tip-bot for Thomas Gleixner
Commit-ID: f49c174b5f431db9fa17315269e288d4548b651c Gitweb: https://git.kernel.org/tip/f49c174b5f431db9fa17315269e288d4548b651c Author: Thomas Gleixner AuthorDate: Wed, 31 Oct 2018 19:21:10 +0100 Committer: Thomas Gleixner CommitDate: Fri, 23 Nov 2018 11:51:21 +0100 hrtimers/tick

[tip:timers/core] time: Add SPDX license identifiers

2018-11-23 Thread tip-bot for Thomas Gleixner
Commit-ID: 35728b8209ee7d25b6241a56304ee926469bd154 Gitweb: https://git.kernel.org/tip/35728b8209ee7d25b6241a56304ee926469bd154 Author: Thomas Gleixner AuthorDate: Wed, 31 Oct 2018 19:21:09 +0100 Committer: Thomas Gleixner CommitDate: Fri, 23 Nov 2018 11:51:20 +0100 time: Add SPDX

[tip:timers/core] time: Remove useless filenames in top level comments

2018-11-23 Thread tip-bot for Thomas Gleixner
Commit-ID: 58c5fc2b96e4ae65068d815a1c3ca81da92fa1c9 Gitweb: https://git.kernel.org/tip/58c5fc2b96e4ae65068d815a1c3ca81da92fa1c9 Author: Thomas Gleixner AuthorDate: Wed, 31 Oct 2018 19:21:08 +0100 Committer: Thomas Gleixner CommitDate: Fri, 23 Nov 2018 11:51:20 +0100 time: Remove

RE: [patch 8/9] posix-clocks: Remove license boiler plate

2018-11-23 Thread Thomas Gleixner
On Fri, 23 Nov 2018, Manfred Rudigier wrote: > Acked-by: Manfred Rudigier Thanks Manfred! Very appreciated! Thomas

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

2018-11-22 Thread Thomas Gleixner
On Thu, 22 Nov 2018, Ingo Molnar wrote: > > + [SPECTRE_V2_APP2APP_SECCOMP]= "App-App Mitigation: seccomp and > > prctl opt-in", > > This description is not accurate: it's not a 'seccomp and prctl opt-in', > the seccomp functionality is opt-out, the prctl is opt-in. > > So something like:

  1   2   3   4   5   6   7   8   9   10   >