From: Paolo Bonzini Subject: Re: [PATCH v9 09/12] KVM: x86: Introduce a function to initialize the PT configuration Date: Mon, 11 Jun 2018 13:41:53 +0200 Message-ID: References: <1526964735-16566-1-git-send-email-luwei.kang@intel.com> <1526964735-16566-10-git-send-email-luwei.kang@intel.com> <20180607135648.mkciyfrd2wgvdxze@um.fi.intel.com> <82D7661F83C1A047AF7DC287873BF1E167FF0140@SHSMSX101.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "x86@kernel.org" , "chao.p.peng@linux.intel.com" , "thomas.lendacky@amd.com" , "bp@suse.de" , "Liang, Kan" , "Janakarajan.Natarajan@amd.com" , "dwmw@amazon.co.uk" , "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "mathieu.poirier@linaro.org" , "kstewart@linuxfoundation.org" , "gregkh@linuxfoundation.org" , "rkrcmar@redhat To: "Kang, Luwei" , Alexander Shishkin Return-path: In-Reply-To: <82D7661F83C1A047AF7DC287873BF1E167FF0140@SHSMSX101.ccr.corp.intel.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 08/06/2018 16:56, Kang, Luwei wrote: >>> + /* Initialize and clear the no dependency bits */ >>> + vmx->pt_desc.ctl_bitmask = ~0ULL; >> This looks redundant, doesn't it? > This is a bit mask for RTIT_CTL MSR and it will make & with the value of RTIT_CLT from guest. > The reserved bits will be 1 in this bit mask and the setable bits are 0. > >>> + vmx->pt_desc.ctl_bitmask = ~(RTIT_CTL_TRACEEN | RTIT_CTL_OS | >>> + RTIT_CTL_USR | RTIT_CTL_TSC_EN | >> RTIT_CTL_DISRETC); But it's set twice, so the first assignment is superfluous. Paolo