public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: kan.liang@intel.com
Cc: peterz@infradead.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, andi@firstfloor.org
Subject: Re: [PATCH V2 1/3] perf ignore LBR and offcore_rsp.
Date: Wed, 2 Jul 2014 19:16:06 -0700	[thread overview]
Message-ID: <20140703021606.GT19781@tassilo.jf.intel.com> (raw)
In-Reply-To: <1404324855-15166-1-git-send-email-kan.liang@intel.com>

> Signed-off-by: Andi Kleen <ak@linux.intel.com>

I did not contribute to this patch, so please remove that SOB.

> Signed-off-by: Kan Liang <kan.liang@intel.com>

>  	struct extra_reg *extra_regs;
>  	unsigned int er_flags;
> +	bool		extra_msr_access;	   /* EXTRA REG MSR can be accessed */
>  

This doesn't look right, needs a flag for each extra register.

They are completely unrelated to each other.

BTW this will also cause KVM messages at each boot now.

>  		wrmsrl(hwc->extra_reg.reg, hwc->extra_reg.config);
>  	wrmsrl(hwc->config_base, (hwc->config | enable_mask) & ~disable_mask);
>  }
> diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
> index adb02aa..8011d42 100644
> --- a/arch/x86/kernel/cpu/perf_event_intel.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel.c
> @@ -2565,6 +2565,13 @@ __init int intel_pmu_init(void)
>  		}
>  	}
>  
> +	/* Access LBR MSR may cause #GP under certain circumstances. E.g. KVM doesn't support LBR MSR */
> +	if (x86_pmu.lbr_nr)
> +		x86_pmu.lbr_msr_access = test_msr_access(x86_pmu.lbr_tos) & test_msr_access(x86_pmu.lbr_from);

s/&/&&/

And also this doesn't cover the case when someone takes over the LBRs and they start #GPing later.
So for LBR the test has to be still at each access.

-Andi

  parent reply	other threads:[~2014-07-03  2:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-02 18:14 [PATCH V2 1/3] perf ignore LBR and offcore_rsp kan.liang
2014-07-02 18:14 ` [PATCH V2 2/3] perf protect LBR when Intel PT is enabled kan.liang
2014-07-03  2:44   ` Andi Kleen
2014-07-03  7:33   ` Peter Zijlstra
2014-07-03 15:52     ` Andi Kleen
2014-07-03 17:07       ` Peter Zijlstra
2014-07-07 13:57         ` Liang, Kan
2014-07-07 15:46           ` Peter Zijlstra
2014-07-07 15:47             ` Peter Zijlstra
2014-07-02 18:14 ` [PATCH V2 3/3] kvm: ignore LBR and offcore rsp kan.liang
2014-07-03  2:16 ` Andi Kleen [this message]
2014-07-03  4:26   ` [PATCH V2 1/3] perf ignore LBR and offcore_rsp Liang, Kan
2014-07-03  2:29 ` Jidong Xiao
2014-07-03  4:26   ` Liang, Kan

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=20140703021606.GT19781@tassilo.jf.intel.com \
    --to=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=kan.liang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.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