Re: [PATCH v3 0/4] mm: convert to vma_is_initial_heap/stack()

2023-08-01 Thread Peter Zijlstra
++ > kernel/events/core.c | 33 ++-- > security/selinux/hooks.c | 7 ++ > 6 files changed, 44 insertions(+), 65 deletions(-) Acked-by: Peter Zijlstra (Intel)

Re: [PATCH v2 4/4] perf/core: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-19 Thread Peter Zijlstra
On Wed, Jul 19, 2023 at 03:51:14PM +0800, Kefeng Wang wrote: > Use the helpers to simplify code, also kill unneeded goto cpy_name. Grrr.. why am I only getting 4/4 ? I'm going to write a bot that auto NAKs all partial series :/

Re: [PATCH v3 1/2] cpu/smt: add a notifier to notify the SMT changes

2023-03-29 Thread Peter Zijlstra
On Wed, Mar 29, 2023 at 07:23:29AM +, Yang, WenYou wrote: > [AMD Official Use Only - General] ^^^ that has no business being in a public email. > Hi Peter, > > Thank you for your review. > > The purpose of the patch set is to improve the performance when playing game > for some AMD APUs wi

Re: [PATCH v3 1/2] cpu/smt: add a notifier to notify the SMT changes

2023-03-29 Thread Peter Zijlstra
On Wed, Mar 29, 2023 at 09:51:48AM +0800, Wenyou Yang wrote: > Add the notifier chain to notify the cpu SMT status changes > Why!?!? What's the purpose of all this? IIRC this doesn't trigger if you manually disable all the siblings. And because you didn't tell us why you need this I can't tell yo

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Peter Zijlstra
On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote: > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 2d6d790d9bed..6c7c70bf50dd 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -491,7 +491,13 @@ struct vm_area_struct { >

Re: [PATCH v2 20/20] jump_label: RFC - tolerate toggled state

2023-01-17 Thread Peter Zijlstra
On Fri, Jan 13, 2023 at 12:30:16PM -0700, Jim Cromie wrote: > __jump_label_patch currently will "crash the box" if it finds a > jump_entry not as expected. ISTM this overly harsh; it doesn't > distinguish between "alternate/opposite" state, and truly > "insane/corrupted". > > The "opposite" (but

Re: [PATCH v2 12/12] x86/traps: Fix up invalid PASID

2020-06-17 Thread Peter Zijlstra
On Tue, Jun 16, 2020 at 04:23:46PM -0700, Fenghua Yu wrote: > Hi, Peter, > > On Mon, Jun 15, 2020 at 09:09:28PM +0200, Peter Zijlstra wrote: > > On Mon, Jun 15, 2020 at 11:55:29AM -0700, Fenghua Yu wrote: > > > > > Or do you suggest to add a random new flag in struc

Re: [PATCH v2 12/12] x86/traps: Fix up invalid PASID

2020-06-16 Thread Peter Zijlstra
On Mon, Jun 15, 2020 at 01:17:35PM -0700, Fenghua Yu wrote: > Hi, Peter, > > On Mon, Jun 15, 2020 at 09:09:28PM +0200, Peter Zijlstra wrote: > > On Mon, Jun 15, 2020 at 11:55:29AM -0700, Fenghua Yu wrote: > > > > > Or do you suggest to add a random new flag in struc

Re: [PATCH v2 12/12] x86/traps: Fix up invalid PASID

2020-06-15 Thread Peter Zijlstra
On Mon, Jun 15, 2020 at 11:55:29AM -0700, Fenghua Yu wrote: > Or do you suggest to add a random new flag in struct thread_info instead > of a TIF flag? Why thread_info? What's wrong with something simple like the below. It takes a bit from the 'strictly current' flags word. diff --git a/include

Re: [PATCH v2 12/12] x86/traps: Fix up invalid PASID

2020-06-15 Thread Peter Zijlstra
On Mon, Jun 15, 2020 at 11:19:21AM -0700, Raj, Ashok wrote: > On Mon, Jun 15, 2020 at 06:03:57PM +0200, Peter Zijlstra wrote: > > > > I don't get why you need a rdmsr here, or why not having one would > > require a TIF flag. Is that because this M

Re: [PATCH v2 12/12] x86/traps: Fix up invalid PASID

2020-06-15 Thread Peter Zijlstra
On Mon, Jun 15, 2020 at 11:12:59AM -0700, Fenghua Yu wrote: > > I don't get why you need a rdmsr here, or why not having one would > > require a TIF flag. Is that because this MSR is XSAVE/XRSTOR managed? > > My concern is TIF flags are precious (only 3 slots available). Defining > a new TIF flag

Re: [PATCH v2 12/12] x86/traps: Fix up invalid PASID

2020-06-15 Thread Peter Zijlstra
On Mon, Jun 15, 2020 at 08:48:54AM -0700, Fenghua Yu wrote: > Hi, Peter, > On Mon, Jun 15, 2020 at 09:56:49AM +0200, Peter Zijlstra wrote: > > On Fri, Jun 12, 2020 at 05:41:33PM -0700, Fenghua Yu wrote: > > > +/* > > > + * Apply some heuristics to see if the #G

Re: [PATCH v2 00/12] x86: tag application address space for devices

2020-06-15 Thread Peter Zijlstra
On Fri, Jun 12, 2020 at 05:41:21PM -0700, Fenghua Yu wrote: > This series only provides simple and basic support for ENQCMD and the MSR: > 1. Clean up type definitions (patch 1-3). These patches can be in a >separate series. >- Define "pasid" as "unsigned int" consistently (patch 1 and 2).

Re: [PATCH v2 12/12] x86/traps: Fix up invalid PASID

2020-06-15 Thread Peter Zijlstra
On Fri, Jun 12, 2020 at 05:41:33PM -0700, Fenghua Yu wrote: > +/* > + * Apply some heuristics to see if the #GP fault was caused by a thread > + * that hasn't had the IA32_PASID MSR initialized. If it looks like that > + * is the problem, try initializing the IA32_PASID MSR. If the heuristic > + *

Re: [PATCH v2 12/12] x86/traps: Fix up invalid PASID

2020-06-15 Thread Peter Zijlstra
On Fri, Jun 12, 2020 at 05:41:33PM -0700, Fenghua Yu wrote: > @@ -447,6 +458,18 @@ dotraplinkage void do_general_protection(struct pt_regs > *regs, long error_code) > int ret; > > RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU"); > + > + /* > + * Perform th

Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2 without any visible FPU state protection

2020-04-18 Thread Peter Zijlstra
On Fri, Apr 17, 2020 at 04:27:28PM -0400, Rodrigo Siqueira wrote: > I'm going to work on the FPU issues in the display code. In this sense, > could you clarify a little bit more about the Makefile issues? I think it might have been PEBKAC, I assumed allmodconfig would end up selecting the driver,

Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2 without any visible FPU state protection

2020-04-15 Thread Peter Zijlstra
On Fri, Apr 10, 2020 at 04:31:39PM +0200, Christian König wrote: > Can we put this new automated check will be behind a configuration flag > initially? Or at least make it a warning and not a hard error. I'll try and get the patches merged in mainline objtool but with a flag that isn't used by def

Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2 without any visible FPU state protection

2020-04-09 Thread Peter Zijlstra
On Thu, Apr 09, 2020 at 08:15:57PM +0200, Christian König wrote: > Am 09.04.20 um 19:09 schrieb Peter Zijlstra: > > On Thu, Apr 09, 2020 at 05:59:56PM +0200, Peter Zijlstra wrote: > > [SNIP] > > > I'll need another approach, let me consider. > > Christian; it s

Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2 without any visible FPU state protection

2020-04-09 Thread Peter Zijlstra
On Thu, Apr 09, 2020 at 05:59:56PM +0200, Peter Zijlstra wrote: > On Thu, Apr 02, 2020 at 04:13:08PM +0200, Peter Zijlstra wrote: > > On Thu, Apr 02, 2020 at 09:33:54AM +0200, Christian König wrote: > > > > yes, using the floating point calculations in the display code has b

Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2 without any visible FPU state protection

2020-04-09 Thread Peter Zijlstra
On Thu, Apr 02, 2020 at 04:13:08PM +0200, Peter Zijlstra wrote: > On Thu, Apr 02, 2020 at 09:33:54AM +0200, Christian König wrote: > > yes, using the floating point calculations in the display code has been a > > source of numerous problems and confusion in the past. > &

Re: [PATCH v2] x86: insn: Add insn_is_fpu()

2020-04-09 Thread Peter Zijlstra
On Thu, Apr 09, 2020 at 04:32:12PM +0200, Peter Zijlstra wrote: > On Thu, Apr 09, 2020 at 01:09:11AM +0900, Masami Hiramatsu wrote: > > Add insn_is_fpu(insn) which tells that the insn is > > whether touch the FPU/SSE/MMX register or the instruction > > of FP coprocessor. &

Re: [PATCH v2] x86: insn: Add insn_is_fpu()

2020-04-09 Thread Peter Zijlstra
On Thu, Apr 09, 2020 at 01:09:11AM +0900, Masami Hiramatsu wrote: > Add insn_is_fpu(insn) which tells that the insn is > whether touch the FPU/SSE/MMX register or the instruction > of FP coprocessor. > > Signed-off-by: Masami Hiramatsu > --- Sadly, it turns out I need "FWAIT" too, which I tried

Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2 without any visible FPU state protection

2020-04-07 Thread Peter Zijlstra
On Wed, Apr 08, 2020 at 12:41:11AM +0900, Masami Hiramatsu wrote: > On Tue, 7 Apr 2020 13:15:35 +0200 > Peter Zijlstra wrote: > > > > Also, all the VMX bits seems to qualify as FPU (I can't remember seeing > > > > that previously): > > > > >

Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2 without any visible FPU state protection

2020-04-07 Thread Peter Zijlstra
On Tue, Apr 07, 2020 at 06:50:08PM +0900, Masami Hiramatsu wrote: > On Mon, 6 Apr 2020 12:21:07 +0200 > Peter Zijlstra wrote: > > arch/x86/mm/extable.o: warning: objtool: ex_handler_fprestore()+0x8b: > > fpu_safe hint not an FPU instruction > > 008b 36b: 48 0f ae

Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2 without any visible FPU state protection

2020-04-06 Thread Peter Zijlstra
On Sun, Apr 05, 2020 at 12:19:30PM +0900, Masami Hiramatsu wrote: > > @@ -269,14 +269,14 @@ d4: AAM Ib (i64) > > d5: AAD Ib (i64) > > d6: > > d7: XLAT/XLATB > > -d8: ESC > > -d9: ESC > > -da: ESC > > -db: ESC > > -dc: ESC > > -dd: ESC > > -de: ESC > > -df: ESC > > +d8: FPU > > +d9: FPU > > +da:

Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2 without any visible FPU state protection

2020-04-05 Thread Peter Zijlstra
On Sat, Apr 04, 2020 at 12:08:08PM +0900, Masami Hiramatsu wrote: > From c609be0b6403245612503fca1087628655bab96c Mon Sep 17 00:00:00 2001 > From: Masami Hiramatsu > Date: Fri, 3 Apr 2020 16:58:22 +0900 > Subject: [PATCH] x86: insn: Add insn_is_fpu() > > Add insn_is_fpu(insn) which tells that the

Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2 without any visible FPU state protection

2020-04-05 Thread Peter Zijlstra
On Sat, Apr 04, 2020 at 12:08:08PM +0900, Masami Hiramatsu wrote: > From c609be0b6403245612503fca1087628655bab96c Mon Sep 17 00:00:00 2001 > From: Masami Hiramatsu > Date: Fri, 3 Apr 2020 16:58:22 +0900 > Subject: [PATCH] x86: insn: Add insn_is_fpu() > > Add insn_is_fpu(insn) which tells that the

Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2 without any visible FPU state protection

2020-04-03 Thread Peter Zijlstra
On Fri, Apr 03, 2020 at 02:28:37PM +0900, Masami Hiramatsu wrote: > On Thu, 2 Apr 2020 16:13:08 +0200 > Peter Zijlstra wrote: > > Masami, Boris, is there any semi-sane way we can have insn_is_fpu() ? > > While digging through various opcode manuals is of course forever fun, I &

Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2 without any visible FPU state protection

2020-04-02 Thread Peter Zijlstra
On Thu, Apr 02, 2020 at 09:33:54AM +0200, Christian König wrote: > Hi Jann, > > Am 02.04.20 um 04:34 schrieb Jann Horn: > > [x86 folks in CC so that they can chime in on the precise rules for this > > stuff] > > > > Hi! > > > > I noticed that several makefiles under drivers/gpu/drm/amd/display/

Re: [PATCH 00/34] put_user_pages(): miscellaneous call sites

2019-08-02 Thread Peter Zijlstra
On Thu, Aug 01, 2019 at 07:16:19PM -0700, john.hubb...@gmail.com wrote: > This is part a tree-wide conversion, as described in commit fc1d8e7cca2d > ("mm: introduce put_user_page*(), placeholder versions"). That commit > has an extensive description of the problem and the planned steps to > solve

Re: [PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 04:05:49PM +0100, Christian König wrote: > Am 20.02.2018 um 15:54 schrieb Peter Zijlstra: > > On Tue, Feb 20, 2018 at 03:34:07PM +0100, Christian König wrote: > > > > OK, but neither case would in fact need the !ctx case right? That's just >

Re: [PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 03:34:07PM +0100, Christian König wrote: > > OK, but neither case would in fact need the !ctx case right? That's just > > there for completeness sake? > > Unfortunately not. TTM uses trylock to lock BOs which are about to be > evicted to make room for all the BOs locked wit

Re: [PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 01:58:26PM +0100, Christian König wrote: > amdgpu needs to verify if userspace sends us valid addresses and the simplest > way of doing this is to check if the buffer object is locked with the ticket > of the current submission. > > Clean up the access to the ww_mutex inter

Re: [PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 02:26:55PM +0100, Christian König wrote: > > > +static inline bool ww_mutex_is_owned_by(struct ww_mutex *lock, > > > + struct ww_acquire_ctx *ctx) > > > +{ > > > + if (ctx) > > > + return likely(READ_ONCE(lock->ctx) == ctx); > > > + el

Re: [PATCH 1/3] locking/ww_mutex: cleanup lock->ctx usage in amdgpu

2018-02-20 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 02:08:26PM +0100, Christian König wrote: > Am 20.02.2018 um 13:35 schrieb Peter Zijlstra: > > > +static inline bool ww_mutex_is_owned_by(struct ww_mutex *lock, > > > + struct task_struct *task, > > > +

Re: [PATCH 1/3] locking/ww_mutex: cleanup lock->ctx usage in amdgpu

2018-02-20 Thread Peter Zijlstra
This really should've been Cc'ed to me. On Thu, Feb 15, 2018 at 03:19:42PM +0100, Christian König wrote: > diff --git a/include/linux/ww_mutex.h b/include/linux/ww_mutex.h > index 39fda195bf78..dd580db289e8 100644 > --- a/include/linux/ww_mutex.h > +++ b/include/linux/ww_mutex.h > @@ -358,4 +358,