From: "Jan Beulich" Subject: Re: Last Branch Record (LBR) in Xen Date: Fri, 26 Jun 2009 08:41:46 +0100 Message-ID: <4A4497DA0200007800007C3B@vpn.id2.novell.com> References: <342778.78582.qm@web7904.mail.in.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <342778.78582.qm@web7904.mail.in.yahoo.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Abhinav Srivastava Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org >>> Abhinav Srivastava 25.06.09 18:57 >>> >I am trying to achieve Last Branch Recording (LBR) functionality on Intel = Core 2 Quad processor from Xen hypervisor. However, I >could not get it working. I am using Xen-3.2.2 (which I agree is a bit = old, however, there is not much change in the code related to >this functionality in Xen-3.4). > >I looked into the patch provided by Keir and Jan Beulich, and still I did = not understand how to make it work. I got some success in >creating single step on branch feature by setting bit 1 of GUEST_DEBUGCTL_= MSR register. However, when I am trying to achieve >LBR functionality (which requires reading LASTBRANCH_TO_IP and LASTBRANC_F= ROM_IP registers too), it is not working. Not sure what you actually want to do: There are two possible patches you = might be talking about: One was simply to add (command line triggerable) = support for printing out LBR values during register dumps (i.e. in = particular when Xen crashes - which it will never do ;-) ). The other was = to allow HVM guests to enable LBR recording on their own. >I must admit that by looking into the patch I got little bit confused. It = would be really good if someone could tell me what are the >steps required in the hypervisor to enable this feature. Since I want to = control this feature from the hypervisor without doing >anything inside guest, how should I approach to this problem. If you refer to the second of the described patches, the guest has to do = action on it own. Jan