public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
	eranian@google.com, Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 3/3] perf, x86: Add INST_RETIRED.PREC_DIST workarounds
Date: Wed, 13 Aug 2014 10:10:17 +0200	[thread overview]
Message-ID: <20140813081017.GA9918@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1407894315-15928-3-git-send-email-andi@firstfloor.org>

[-- Attachment #1: Type: text/plain, Size: 926 bytes --]

On Tue, Aug 12, 2014 at 06:45:15PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> On Broadwell INST_RETIRED.PREC_DIST cannot be used with any period
> that doesn't have the lowest 6 bits cleared. And the period
> should not be smaller than 128.
> 
> Add a new callback to enforce this, and set it for Broadwell.
> 
> This is erratum BDM57 and BDM11.

Urgh, this blows.

> +/*
> + * Broadwell:
> + * The INST_RETIRED.ALL period always needs to have lowest
> + * 6bits cleared (BDM57). It shall not use a period smaller
> + * than 100 (BDM11). We combine the two to enforce
> + * a min-period of 128.
> + */
> +static unsigned bdw_limit_period(struct perf_event *event, unsigned left)
> +{
> +	if ((event->hw.config & 0xffff) == 0x1c0) {

ISTR we have actual proper defines for that.

> +		if (left < 128)
> +			left = 128;
> +		left &= ~0x3fu;
> +	}
> +	return left;
> +}

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-08-13  8:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13  1:45 [PATCH 1/3] perf, x86: Remove incorrect model number from Haswell perf Andi Kleen
2014-08-13  1:45 ` [PATCH 2/3] perf, x86: Add Broadwell core support Andi Kleen
2014-08-13  8:00   ` Peter Zijlstra
2014-08-13  1:45 ` [PATCH 3/3] perf, x86: Add INST_RETIRED.PREC_DIST workarounds Andi Kleen
2014-08-13  8:10   ` Peter Zijlstra [this message]
2014-08-13  7:58 ` [PATCH 1/3] perf, x86: Remove incorrect model number from Haswell perf Peter Zijlstra

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=20140813081017.GA9918@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /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