From mboxrd@z Thu Jan 1 00:00:00 1970 From: Abhinav Srivastava Subject: Re: Last Branch Record (LBR) in Xen Date: Fri, 26 Jun 2009 19:20:50 +0530 (IST) Message-ID: <89093.26435.qm@web7906.mail.in.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org =0AHi Jan,=0A=0AThanks for your reply. I am referring to the second patch (= however, could you please confirm and point to me to the right patch).=0A= =0AAs far as I understand (please correct me if I am wrong), you meant that= HVM guests have to enable the LBR recording, and this action cannot be ini= tiated/controlled by Xen. I was thinking like other kind of actions, such a= s single stepping on instruction, single stepping on branch etc. that can b= e controlled from the hypervisor and guests behave accordingly, the LBR fea= ture can also be set/reset from the hypervisor. And, if that is not the cas= e then I think any malicious programs can turn off this feature inside HVM = guests and can bypass the debugger. Moreover, I assumed anything that a gue= st can do, can also be done from the hypervisor by setting guest MSR regist= ers or bitmap from the hypervisor.=0A=0AHowever, if that is the case that y= ou described and LBR recording cannot be enable Xen then could you please g= ive me some idea what things need to be done from HVM guests side to enable= this feature?=0A=0A=0AThanks,=0AAbhinav=0A=0A=0A--- On Fri, 26/6/09, Jan B= eulich wrote:=0A=0A> From: Jan Beulich =0A> Subject: Re: [Xen-devel] Last Branch Record (LBR) in Xen=0A> To= : "Abhinav Srivastava" =0A> Cc: xen-devel@list= s.xensource.com=0A> Date: Friday, 26 June, 2009, 1:11 PM=0A> >>> Abhinav Sr= ivastava=0A> =0A> 25.06.09 18:57 >>>=0A> >I am= trying to achieve Last Branch Recording (LBR)=0A> functionality on Intel C= ore 2 Quad processor from Xen=0A> hypervisor. However, I=0A> >could not get= it working. I am using Xen-3.2.2 (which I=0A> agree is a bit old, however,= there is not much change in the=0A> code related to=0A> >this functionalit= y in Xen-3.4).=0A> >=0A> >I looked into the patch provided by Keir and Jan= =0A> Beulich, and still I did not understand how to make it work.=0A> I got= some success in=0A> >creating single step on branch feature by setting bit= 1=0A> of GUEST_DEBUGCTL_MSR register. However, when I am trying to=0A> ach= ieve=0A> >LBR functionality (which requires reading=0A> LASTBRANCH_TO_IP an= d LASTBRANC_FROM_IP registers too), it is=0A> not working.=0A> =0A> Not sur= e what you actually want to do: There are two=0A> possible patches you migh= t be talking about: One was simply=0A> to add (command line triggerable) su= pport for printing out=0A> LBR values during register dumps (i.e. in partic= ular when=0A> Xen crashes - which it will never do ;-) ). The other was to= =0A> allow HVM guests to enable LBR recording on their own.=0A> =0A> >I mus= t admit that by looking into the patch I got=0A> little bit confused. It wo= uld be really good if someone=0A> could tell me what are the=0A> >steps req= uired in the hypervisor to enable this=0A> feature. Since I want to control= this feature from the=0A> hypervisor without doing=0A> >anything inside gu= est, how should I approach to this=0A> problem.=0A> =0A> If you refer to th= e second of the described patches, the=0A> guest has to do action on it own= .=0A> =0A> Jan=0A> =0A> =0A> ______________________________________________= _=0A> Xen-devel mailing list=0A> Xen-devel@lists.xensource.com=0A> http://l= ists.xensource.com/xen-devel=0A> =0A=0A=0A Cricket on your mind? Visit= the ultimate cricket website. Enter http://cricket.yahoo.com