kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Joerg Roedel <joerg.roedel@amd.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	joro@8bytes.org, Ingo Molnar <mingo@elte.hu>,
	Avi Kivity <avi@redhat.com>,
	Stephane Eranian <eranian@google.com>,
	David Ahern <dsahern@gmail.com>, Gleb Natapov <gleb@redhat.com>,
	Robert Richter <robert.richter@amd.com>
Subject: Re: [PATCH v2] perf/x86: Fix HO/GO counting with SVM disabled
Date: Wed, 29 Feb 2012 18:44:49 +0100	[thread overview]
Message-ID: <1330537489.11248.164.camel@twins> (raw)
In-Reply-To: <1330523852-19566-1-git-send-email-joerg.roedel@amd.com>

On Wed, 2012-02-29 at 14:57 +0100, Joerg Roedel wrote:

> diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h
> index 8944062..2c581b9 100644
> --- a/arch/x86/kernel/cpu/perf_event.h
> +++ b/arch/x86/kernel/cpu/perf_event.h
> @@ -148,6 +148,8 @@ struct cpu_hw_events {
>          * AMD specific bits
>          */
>         struct amd_nb           *amd_nb;
> +       /* Inverted mask of bits to clear in the perf_ctr ctrl registers */
> +       u64                     perf_ctr_virt_mask;
>  
>         void                            *kfree_on_online;
>  };
> @@ -417,9 +419,11 @@ void x86_pmu_disable_all(void);
>  static inline void __x86_pmu_enable_event(struct hw_perf_event *hwc,
>                                           u64 enable_mask)
>  {
> +       u64 disable_mask = __this_cpu_read(cpu_hw_events.perf_ctr_virt_mask);
> +
>         if (hwc->extra_reg.reg)
>                 wrmsrl(hwc->extra_reg.reg, hwc->extra_reg.config);
> -       wrmsrl(hwc->config_base, hwc->config | enable_mask);
> +       wrmsrl(hwc->config_base, (hwc->config | enable_mask) & ~disable_mask);
>  }

Its starting to look like we should kill this helper, the extra_reg muck
is Intel only and the disable_mask is AMD.



Queued it for now though.. 

      parent reply	other threads:[~2012-02-29 17:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120227182325.GA12302@8bytes.org>
2012-02-28 15:55 ` [PATCH] perf/x86: Fix HO/GO counting with SVM disabled Joerg Roedel
2012-02-28 17:24   ` Avi Kivity
2012-02-28 17:36     ` David Ahern
2012-02-28 17:38       ` Avi Kivity
2012-02-29 13:24         ` Joerg Roedel
2012-02-29 13:57   ` [PATCH v2] " Joerg Roedel
2012-02-29 17:00     ` Avi Kivity
2012-02-29 17:03       ` Gleb Natapov
2012-02-29 17:05       ` Joerg Roedel
2012-02-29 17:08         ` Avi Kivity
2012-02-29 17:24         ` Peter Zijlstra
2012-02-29 17:44     ` Peter Zijlstra [this message]

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=1330537489.11248.164.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=avi@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=gleb@redhat.com \
    --cc=joerg.roedel@amd.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=robert.richter@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).