lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C77BB6B.9090706@windriver.com>
Date:	Fri, 27 Aug 2010 21:19:39 +0800
From:	DDD <dongdong.deng@...driver.com>
To:	Peter Zijlstra <peterz@...radead.org>, fweisbec@...il.com
CC:	mingo@...e.hu, acme@...hat.com, paulus@...ba.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf: fix possible divide-by-zero in perf_swevent_overflow()

Peter Zijlstra wrote:
> On Fri, 2010-08-27 at 20:21 +0800, DDD wrote:
> 
>>>> Maybe the root cause was from kgdb/hw_breakpoint_layer,
>>> Yeah, I think there's a bug in the hw_breakpoint stuff, does something
>>> like the below fix it?
> 
>> Thanks for your patch, but I still could reproduce the problem with your 
>> patch.
> 
> Frederic, any clue as to what makes hw breakpoints go funny and have
> last_period == 0?

Hi Peter,

Thanks for you take care of it, I have got the root cause of it now.

It is the kgdb using hw_breakpoint_layer's API problem, and I have a RFC 
patch for it.(maybe it is not correctly), I will contact with Jason to 
fix this problem.

Thank you very much,
Dongdong

> 
>>> ---
>>>  kernel/hw_breakpoint.c |   13 ++++++++++++-
>>>  1 files changed, 12 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c
>>> index d71a987..f57ebee 100644
>>> --- a/kernel/hw_breakpoint.c
>>> +++ b/kernel/hw_breakpoint.c
>>> @@ -600,9 +600,20 @@ static int __init init_hw_breakpoint(void)
>>>  }
>>>  core_initcall(init_hw_breakpoint);
>>>  
>>> +static int hw_breakpoint_enable(struct perf_event *event)
>>> +{
>>> +     struct hw_perf_event *hwc = &event->hw;
>>> +
>>> +     if (hwc->sample_period) {
>>> +             hwc->last_period = hwc->sample_period;
>>> +             perf_swevent_set_period(event);
>>> +     }
>>> +
>>> +     return arch_install_hw_breakpoint(event);
>>> +}
>>>  
>>>  struct pmu perf_ops_bp = {
>>> -     .enable         = arch_install_hw_breakpoint,
>>> +     .enable         = hw_breakpoint_enable,
>>>       .disable        = arch_uninstall_hw_breakpoint,
>>>       .read           = hw_breakpoint_pmu_read,
>>>  };
>>>
>>>
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ