Will Deacon writes:
> On Thu, May 30, 2019 at 03:57:36PM +0530, Ravi Bangoria wrote:
>> On 5/30/19 2:08 PM, Ravi Bangoria wrote:
>> >> ---
>> >> Subject: perf: Fix perf_sample_regs_user()
>> >> From: Peter Zijlstra
>> >> Date: Wed May 29 14:37:24 CEST 2019
>> >>
>> >> perf_sample_regs_user()
On Fri, May 31, 2019 at 04:37:03PM +0100, Will Deacon wrote:
> On Thu, May 30, 2019 at 03:57:36PM +0530, Ravi Bangoria wrote:
> > On 5/30/19 2:08 PM, Ravi Bangoria wrote:
> > >> --- a/kernel/events/core.c
> > >> +++ b/kernel/events/core.c
> > >> @@ -5923,7 +5923,7 @@ static void
On Fri, May 31, 2019 at 04:37:15PM +0100, Will Deacon wrote:
> Oh, nice! I think this happens because Power doesn't actually initialise
> the regs after a kthread execs() until late in start_thread(). But the plot
> thickens somewhat, since current_pt_regs() is different to
> task_pt_regs(current)
On Thu, May 30, 2019 at 03:57:36PM +0530, Ravi Bangoria wrote:
>
>
> On 5/30/19 2:08 PM, Ravi Bangoria wrote:
> >> ---
> >> Subject: perf: Fix perf_sample_regs_user()
> >> From: Peter Zijlstra
> >> Date: Wed May 29 14:37:24 CEST 2019
> >>
> >> perf_sample_regs_user() uses 'current->mm' to test
On Wed, May 29, 2019 at 07:03:13PM +0200, Peter Zijlstra wrote:
> On Wed, May 29, 2019 at 05:38:54PM +0100, Mark Rutland wrote:
> > Generally speaking though, if we ever task task_pt_regs() of an idle
> > task we'll get junk, and user_mode() could be true.
>
> Agreed, but we're not doing that.
On 5/30/19 2:08 PM, Ravi Bangoria wrote:
>> ---
>> Subject: perf: Fix perf_sample_regs_user()
>> From: Peter Zijlstra
>> Date: Wed May 29 14:37:24 CEST 2019
>>
>> perf_sample_regs_user() uses 'current->mm' to test for the presence of
>> userspace, but this is insufficient, consider use_mm().
On 5/29/19 6:25 PM, Peter Zijlstra wrote:
> On Wed, May 29, 2019 at 11:20:22AM +0100, Will Deacon wrote:
>> Anyway, you can add my ack to your patch, but I bet we can remove that mm
>> check :D
>
> I've ended up with the below. Ravi, can you test if that does indeed
> obsolete your PPC patch?
On Wed, May 29, 2019 at 06:44:07PM +0200, Peter Zijlstra wrote:
> On Wed, May 29, 2019 at 05:25:28PM +0100, Will Deacon wrote:
>
> > > > > On Wed, May 29, 2019 at 02:05:21PM +0100, Will Deacon wrote:
> > > > > > On Wed, May 29, 2019 at 02:55:57PM +0200, Peter Zijlstra wrote:
> > > > >
> > > > >
On Wed, May 29, 2019 at 05:38:54PM +0100, Mark Rutland wrote:
> Sorry for the noise.
n/p, confusion happens :-)
> Generally speaking though, if we ever task task_pt_regs() of an idle
> task we'll get junk, and user_mode() could be true.
Agreed, but we're not doing that.
On Wed, May 29, 2019 at 05:25:28PM +0100, Will Deacon wrote:
> > > > On Wed, May 29, 2019 at 02:05:21PM +0100, Will Deacon wrote:
> > > > > On Wed, May 29, 2019 at 02:55:57PM +0200, Peter Zijlstra wrote:
> > > >
> > > > > > if (user_mode(regs)) {
> > > > >
> > > > > Hmm, so it just occurred
On Wed, May 29, 2019 at 05:24:36PM +0100, Mark Rutland wrote:
> On Wed, May 29, 2019 at 06:19:55PM +0200, Peter Zijlstra wrote:
> > On Wed, May 29, 2019 at 03:35:10PM +0100, Will Deacon wrote:
> > > On Wed, May 29, 2019 at 03:25:15PM +0200, Peter Zijlstra wrote:
> > > > On Wed, May 29, 2019 at
On Wed, May 29, 2019 at 06:19:55PM +0200, Peter Zijlstra wrote:
> On Wed, May 29, 2019 at 03:35:10PM +0100, Will Deacon wrote:
> > On Wed, May 29, 2019 at 03:25:15PM +0200, Peter Zijlstra wrote:
> > > On Wed, May 29, 2019 at 02:05:21PM +0100, Will Deacon wrote:
> > > > On Wed, May 29, 2019 at
On Wed, May 29, 2019 at 06:19:55PM +0200, Peter Zijlstra wrote:
> On Wed, May 29, 2019 at 03:35:10PM +0100, Will Deacon wrote:
> > On Wed, May 29, 2019 at 03:25:15PM +0200, Peter Zijlstra wrote:
> > > On Wed, May 29, 2019 at 02:05:21PM +0100, Will Deacon wrote:
> > > > On Wed, May 29, 2019 at
On Wed, May 29, 2019 at 03:35:10PM +0100, Will Deacon wrote:
> On Wed, May 29, 2019 at 03:25:15PM +0200, Peter Zijlstra wrote:
> > On Wed, May 29, 2019 at 02:05:21PM +0100, Will Deacon wrote:
> > > On Wed, May 29, 2019 at 02:55:57PM +0200, Peter Zijlstra wrote:
> >
> > > > if
On Wed, May 29, 2019 at 03:25:15PM +0200, Peter Zijlstra wrote:
> On Wed, May 29, 2019 at 02:05:21PM +0100, Will Deacon wrote:
> > On Wed, May 29, 2019 at 02:55:57PM +0200, Peter Zijlstra wrote:
>
> > > if (user_mode(regs)) {
> >
> > Hmm, so it just occurred to me that Mark's observation is
On Wed, May 29, 2019 at 02:05:21PM +0100, Will Deacon wrote:
> On Wed, May 29, 2019 at 02:55:57PM +0200, Peter Zijlstra wrote:
> > if (user_mode(regs)) {
>
> Hmm, so it just occurred to me that Mark's observation is that the regs
> can be junk in some cases. In which case, should we be
On Wed, May 29, 2019 at 02:55:57PM +0200, Peter Zijlstra wrote:
> On Wed, May 29, 2019 at 11:20:22AM +0100, Will Deacon wrote:
> > Anyway, you can add my ack to your patch, but I bet we can remove that mm
> > check :D
>
> I've ended up with the below. Ravi, can you test if that does indeed
>
On Wed, May 29, 2019 at 11:20:22AM +0100, Will Deacon wrote:
> Anyway, you can add my ack to your patch, but I bet we can remove that mm
> check :D
I've ended up with the below. Ravi, can you test if that does indeed
obsolete your PPC patch?
---
Subject: perf: Fix perf_sample_regs_user()
From:
On Wed, May 29, 2019 at 12:10:42PM +0200, Peter Zijlstra wrote:
> On Wed, May 29, 2019 at 10:17:33AM +0100, Will Deacon wrote:
> > On Tue, May 28, 2019 at 07:32:28PM +0200, Peter Zijlstra wrote:
>
> > > 'funny' thing that, perf_sample_regs_user() seems to assume that
> > > anything with
On Tue, May 28, 2019 at 07:32:28PM +0200, Peter Zijlstra wrote:
> On Tue, May 28, 2019 at 04:32:24PM +0100, Will Deacon wrote:
> > On Tue, May 28, 2019 at 04:01:03PM +0200, Peter Zijlstra wrote:
> > > On Tue, May 28, 2019 at 08:31:29PM +0800, Young Xiao wrote:
> > > > When a kthread calls
On Wed, May 29, 2019 at 10:17:33AM +0100, Will Deacon wrote:
> On Tue, May 28, 2019 at 07:32:28PM +0200, Peter Zijlstra wrote:
> > 'funny' thing that, perf_sample_regs_user() seems to assume that
> > anything with current->mm is in fact a user task, and that assumption is
> > just plain wrong,
On Tue, May 28, 2019 at 07:32:28PM +0200, Peter Zijlstra wrote:
> On Tue, May 28, 2019 at 04:32:24PM +0100, Will Deacon wrote:
> > On Tue, May 28, 2019 at 04:01:03PM +0200, Peter Zijlstra wrote:
> > > On Tue, May 28, 2019 at 08:31:29PM +0800, Young Xiao wrote:
> > > > When a kthread calls
Will Deacon writes:
> On Tue, May 28, 2019 at 04:01:03PM +0200, Peter Zijlstra wrote:
>> On Tue, May 28, 2019 at 08:31:29PM +0800, Young Xiao wrote:
>> > When a kthread calls call_usermodehelper() the steps are:
>> > 1. allocate current->mm
>> > 2. load_elf_binary()
>> > 3. populate
Peter Zijlstra writes:
> On Tue, May 28, 2019 at 08:31:29PM +0800, Young Xiao wrote:
>> When a kthread calls call_usermodehelper() the steps are:
>> 1. allocate current->mm
>> 2. load_elf_binary()
>> 3. populate current->thread.regs
>>
>> While doing this, interrupts are not disabled. If
On Tue, May 28, 2019 at 04:32:24PM +0100, Will Deacon wrote:
> On Tue, May 28, 2019 at 04:01:03PM +0200, Peter Zijlstra wrote:
> > On Tue, May 28, 2019 at 08:31:29PM +0800, Young Xiao wrote:
> > > When a kthread calls call_usermodehelper() the steps are:
> > > 1. allocate current->mm
> > > 2.
On Tue, May 28, 2019 at 04:32:24PM +0100, Will Deacon wrote:
> On Tue, May 28, 2019 at 04:01:03PM +0200, Peter Zijlstra wrote:
> > On Tue, May 28, 2019 at 08:31:29PM +0800, Young Xiao wrote:
> > > When a kthread calls call_usermodehelper() the steps are:
> > > 1. allocate current->mm
> > > 2.
On Tue, May 28, 2019 at 04:01:03PM +0200, Peter Zijlstra wrote:
> On Tue, May 28, 2019 at 08:31:29PM +0800, Young Xiao wrote:
> > When a kthread calls call_usermodehelper() the steps are:
> > 1. allocate current->mm
> > 2. load_elf_binary()
> > 3. populate current->thread.regs
> >
> > While
On Tue, May 28, 2019 at 08:31:29PM +0800, Young Xiao wrote:
> When a kthread calls call_usermodehelper() the steps are:
> 1. allocate current->mm
> 2. load_elf_binary()
> 3. populate current->thread.regs
>
> While doing this, interrupts are not disabled. If there is a perf
> interrupt in
On Tue, May 28, 2019 at 08:31:29PM +0800, Young Xiao wrote:
> When a kthread calls call_usermodehelper() the steps are:
> 1. allocate current->mm
> 2. load_elf_binary()
> 3. populate current->thread.regs
>
> While doing this, interrupts are not disabled. If there is a perf
> interrupt in
29 matches
Mail list logo