From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kang, Luwei" Subject: Re: [PATCH v4 1/2] i386: Add Intel Processor Trace feature support Date: Tue, 13 Mar 2018 11:16:18 +0000 Message-ID: <82D7661F83C1A047AF7DC287873BF1E167EF731C@SHSMSX101.ccr.corp.intel.com> References: <1520182116-16485-1-git-send-email-luwei.kang@intel.com> <20180309191048.GA28578@localhost.localdomain> <82D7661F83C1A047AF7DC287873BF1E167EF4877@SHSMSX101.ccr.corp.intel.com> <20180312164517.GS3417@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "kvm@vger.kernel.org" , "mtosatti@redhat.com" , "qemu-devel@nongnu.org" , "pbonzini@redhat.com" , Chao Peng , "rth@twiddle.net" To: Eduardo Habkost Return-path: In-Reply-To: <20180312164517.GS3417@localhost.localdomain> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel2=m.gmane.org@nongnu.org Sender: "Qemu-devel" List-Id: kvm.vger.kernel.org > > > > + if (!eax_0 || > > > > + ((ebx_0 & INTEL_PT_MINIMAL_EBX) !=3D INTEL_PT_MINIMAL_E= BX) || > > > > + ((ecx_0 & INTEL_PT_MINIMAL_ECX) !=3D INTEL_PT_MINIMAL_E= CX) || > > > > + ((eax_1 & INTEL_PT_MTC_BITMAP) !=3D INTEL_PT_MTC_BITMAP= ) || > > > > + ((eax_1 & INTEL_PT_ADDR_RANGES_NUM_MASK) < > > > > + INTEL_PT_ADDR_RANGES_NU= M) || > > > > + ((ebx_1 & (INTEL_PT_PSB_BITMAP | INTEL_PT_CYCLE_BITMAP)= ) !=3D > > > > + (INTEL_PT_PSB_BITMAP | INTEL_PT_CYCLE_BITMAP))) { > > > > > > I still don't see a check to ensure the host has bit 31 on ecx_0 set = to 0, as I mentioned when reviewing v3. > > > > Hi Eduardo, > > Thanks for the code review. I don't quite understand here why > > bit31 must same with host (meaning we must reject a host where ecx_0 & = (1 << 31) is set). >=20 > If the guest sees the bit set to 0, it will expect IP payloads with RIP v= alues, but the host CPU will generate IP payloads with LIP values. > I assume KVM won't do RIP<->LIP translation on the packets generated by t= he host before the guest sees them, will it? Fully understand. Will make a separate patch on this. Thanks, Luwei Kang >=20 >=20 > > Do you mean PT must be disabled in guest when host bit31 is set? > > Bit 31: If 1, generated packets which contain IP payloads have LIP = values, which include the CS base component. > > I can't find any special on this bit. Could you help clarify? >=20 > As far as I understand, this bit is special because KVM can't emulate a v= alue that's different from the host. >=20 > -- > Eduardo