linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Ingo Molnar <mingo@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	jacob.w.shin@gmail.com, Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Melo <acme@ghostprotocols.net>,
	"H. Peter Anvin" <hpa@zytor.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Sherry Hurwitz <sherry.hurwitz@amd.com>
Subject: Re: [PATCH 1/3] perf/x86/amd: AMD support for bp_len > HW_BREAKPOINT_LEN_8
Date: Wed, 4 Dec 2013 14:57:43 +0100	[thread overview]
Message-ID: <20131204135743.GB7251@redhat.com> (raw)
In-Reply-To: <CAFTL4hwS9FHNvK8A-wqSNzzjSW2OsicxrRh=XT7nRo0=Kw1s=g@mail.gmail.com>

On 12/03, Frederic Weisbecker wrote:
>
> 2013/11/11 Oleg Nesterov <oleg@redhat.com>:
> > On 11/11, Frederic Weisbecker wrote:
> >>
> >> On Sat, Nov 09, 2013 at 04:54:28PM +0100, Oleg Nesterov wrote:
> >> >
> >> > Up to you and Suravee, but can't we cleanup this later?
> >> >
> >> > This series was updated many times to address a lot of (sometimes
> >> > contradictory) complaints.
> >>
> >> Sure. But I'm confident that we can solve the conflicting mask / len issue easily beside.
> >> I mean, I don't feel confident with merging things as is, otoh it should be easy to fix up.
> >
> > I do not really understand where do you see the conflict...
> >
> > I can be easily wrong, but afaics currently mask / len issue is simply
> > the implementation detail.
>
> I think it's like we have an object that has a length, and to create
> this object we pass both kilometers and miles. Ok it's a bit different
> here because a mask can apply on top of a len. But here it's used to
> define essentially the same thing (ie: a range of address)

Yes. perf/etc uses length, the current imlementation uses ->mask to
actually set the range.

> > Actually, mask is more powerfull. And initial versions of this patches
> > (iirc) tried to use mask as an argument which comes from the userspace
> > (tools/perf, perf_event_attr, etc). But one of reviewers nacked this
> > interfacer, so we still use len.
>
> Well, we can still reconsider it if needed but to me it seems that
> mask is only interesting if we may deal with non contiguous range of
> addresses.

And this is what this mask can actually do. Just there is no way (currently)
to pass the mask from userpace.

> >> Right but what if we want breakpoints having a size below 8? Like break on instructions
> >> from 0x1000 to 0x1008 ?
> >>
> >> Or should we ignore range instruction breakpoints when len < 8?
> >
> > In this case the new code has no effect (iirc), we simply use
> > X86_BREAKPOINT_LEN_* and "tell the hardware about extended range/mask"
> > code is never called. IIRC, currently we simply check bp_mask != 0
> > to distinguish.
>
> I'm not sure I understand correctly. Do you mean that range below 8
> don't rely on extended breakpoint range?

IIRC - yes.

> Ideally it would be nice if we drop bp_mask and use extended ranges
> only when len > 8. How does that sound?

Again, iirc, this is what the code does. except (in essence) it checks
mask != 0 instead of len > 8.

And yes, we can probably drop bp_mask (unless we are going to support
the contiguous ranges), just I think we can do this later.

Oleg.


  reply	other threads:[~2013-12-04 13:56 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-02 16:11 [PATCH V5 0/3] perf/x86/amd: AMD Family 16h Data Breakpoint Extensions suravee.suthikulpanit
2013-10-02 16:11 ` [PATCH 1/3] perf/x86/amd: AMD support for bp_len > HW_BREAKPOINT_LEN_8 suravee.suthikulpanit
2013-10-31  9:58   ` Frederic Weisbecker
2013-10-31 10:48     ` Borislav Petkov
2013-10-31 11:23       ` Frederic Weisbecker
2013-11-02  4:34         ` Borislav Petkov
2013-11-08 21:22           ` Suravee Suthikulpanit
2013-11-08 14:40             ` Borislav Petkov
2013-10-31 16:49     ` Oleg Nesterov
2013-11-08 19:41   ` Frederic Weisbecker
2013-11-09 15:11     ` Oleg Nesterov
2013-11-09 15:32       ` Frederic Weisbecker
2013-11-09 15:54         ` Oleg Nesterov
2013-11-11 15:44           ` Frederic Weisbecker
2013-11-11 17:51             ` Oleg Nesterov
2013-12-02 23:12               ` Frederic Weisbecker
2013-12-04 13:57                 ` Oleg Nesterov [this message]
2013-12-10 14:43                   ` Frederic Weisbecker
2013-12-10 14:52                   ` Frederic Weisbecker
2013-12-10 15:23   ` Frederic Weisbecker
2013-12-10 16:19     ` Oleg Nesterov
2013-12-10 16:30       ` Frederic Weisbecker
2013-12-11 12:05     ` Suravee Suthikulanit
2013-10-02 16:11 ` [PATCH 2/3] perf tools: allow user to specify hardware breakpoint bp_len suravee.suthikulpanit
2013-12-10 15:25   ` Frederic Weisbecker
2013-12-10 16:22     ` Oleg Nesterov
2013-12-10 16:26       ` Frederic Weisbecker
2013-10-02 16:11 ` [PATCH 3/3] perf tools: add hardware breakpoint bp_len test cases suravee.suthikulpanit
2013-10-02 16:15 ` [PATCH V5 0/3] perf/x86/amd: AMD Family 16h Data Breakpoint Extensions Oleg Nesterov
2013-10-02 16:54   ` Suravee Suthikulpanit
2013-10-31  9:43 ` Frederic Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2013-04-28  6:05 [PATCH V4 " Jacob Shin
2013-04-28  6:05 ` [PATCH 1/3] perf/x86/amd: AMD support for bp_len > HW_BREAKPOINT_LEN_8 Jacob Shin
2013-04-26 18:57 [PATCH 0/3] perf/x86/amd: AMD Family 16h Data Breakpoint Extensions Jacob Shin
2013-04-26 18:57 ` [PATCH 1/3] perf/x86/amd: AMD support for bp_len > HW_BREAKPOINT_LEN_8 Jacob Shin
2013-04-27 15:05   ` Oleg Nesterov
2013-04-27 15:14     ` Oleg Nesterov
2013-04-27 15:40     ` Jacob Shin
2013-04-27 16:10       ` Oleg Nesterov
2013-04-28  6:05         ` Jacob Shin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131204135743.GB7251@redhat.com \
    --to=oleg@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jacob.w.shin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=sherry.hurwitz@amd.com \
    --cc=suravee.suthikulpanit@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).