From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH] perf/x86/intel/pt: Don't die on VMXON Date: Wed, 6 Apr 2016 13:52:15 +0200 Message-ID: <20160406115215.GK2906@worktop> References: <1459527854-5899-1-git-send-email-alexander.shishkin@linux.intel.com> <20160406085227.GO3448@twins.programming.kicks-ass.net> <87vb3v56x2.fsf@ashishki-desk.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Gleb Natapov , Paolo Bonzini , x86@kernel.org, kvm@vger.kernel.org, Ingo Molnar , linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, Arnaldo Carvalho de Melo , Borislav Petkov To: Alexander Shishkin Return-path: Received: from bombadil.infradead.org ([198.137.202.9]:45365 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751660AbcDFLw3 (ORCPT ); Wed, 6 Apr 2016 07:52:29 -0400 Content-Disposition: inline In-Reply-To: <87vb3v56x2.fsf@ashishki-desk.ger.corp.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Apr 06, 2016 at 02:10:49PM +0300, Alexander Shishkin wrote: > >> + /* may be already stopped by a PMI*/ > >> + if (!(ctl & RTIT_CTL_TRACEEN)) > >> + return; > >> + > >> + ctl ^= RTIT_CTL_TRACEEN; > > > > Would that not be much less confusing when written like |= ? > > This one's actually clearing TraceEn, see the if-not-set-leave in front > of it, but that just goes to prove your point I guess. :) Hehe, indeed. So much for pretending to be awake :-) > How about this then: Looks good, however: > + if (test_cpu_cap(&boot_cpu_data, X86_FEATURE_VMX)) { Borislav tells me this ought to be boot_cpu_has(X86_FEATURE_VMX) > + /* Intel SDM, 36.5 "Tracing post-VMXON" */ > + rdmsrl(MSR_IA32_VMX_MISC, reg); > + if (reg & BIT(14)) > + pt_pmu.vmx = true; > + }