All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Last Branch Record (LBR) in Xen
@ 2009-06-26 14:18 Abhinav Srivastava
  0 siblings, 0 replies; 5+ messages in thread
From: Abhinav Srivastava @ 2009-06-26 14:18 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel



Hi Jan,

I got it now. Thanks for the clarification. However, could you please
give me some pointers or suggestions to code this thing in the hypervisor?

Thanks,
Abhinav

--- On Fri, 26/6/09, Jan Beulich <JBeulich@novell.com> wrote:

> From: Jan Beulich <JBeulich@novell.com>
> Subject: Re: [Xen-devel] Last Branch Record (LBR) in Xen
> To: "Abhinav Srivastava" <abhinavs_iitkgp@yahoo.co.in>
> Cc: xen-devel@lists.xensource.com
> Date: Friday, 26 June, 2009, 7:31 PM
> >>> Abhinav Srivastava
> <abhinavs_iitkgp@yahoo.co.in>
> 26.06.09 15:50 >>>
> >As 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 initiated/controlled by Xen. I
> was thinking like other kind of actions, such as single
> stepping on instruction,
> >single stepping on branch etc. that can be controlled
> from the hypervisor and guests behave accordingly, the LBR
> feature can
> >also be set/reset from the hypervisor. And, if that is
> not the case 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 guest can do, can also
> be done from
> >the hypervisor by setting guest MSR registers or bitmap
> from the hypervisor.
> 
> Oh, of course this can be done from the hypervisor, but
> that wasn't the purpose of the patch. You'd have to code
> this for yourself.
> 
> Jan
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
> 


      Cricket on your mind? Visit the ultimate cricket website. Enter http://cricket.yahoo.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Last Branch Record (LBR) in Xen
  2009-06-26 13:50 Abhinav Srivastava
@ 2009-06-26 14:01 ` Jan Beulich
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2009-06-26 14:01 UTC (permalink / raw)
  To: Abhinav Srivastava; +Cc: xen-devel

>>> Abhinav Srivastava <abhinavs_iitkgp@yahoo.co.in> 26.06.09 15:50 >>>
>As 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 initiated/controlled by Xen. I was thinking like other kind of actions, such as single stepping on instruction,
>single stepping on branch etc. that can be controlled from the hypervisor and guests behave accordingly, the LBR feature can
>also be set/reset from the hypervisor. And, if that is not the case 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 guest can do, can also be done from
>the hypervisor by setting guest MSR registers or bitmap from the hypervisor.

Oh, of course this can be done from the hypervisor, but that wasn't the purpose of the patch. You'd have to code this for yourself.

Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Last Branch Record (LBR) in Xen
@ 2009-06-26 13:50 Abhinav Srivastava
  2009-06-26 14:01 ` Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Abhinav Srivastava @ 2009-06-26 13:50 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel



Hi Jan,

Thanks for your reply. I am referring to the second patch (however, could you please confirm and point to me to the right patch).

As 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 initiated/controlled by Xen. I was thinking like other kind of actions, such as single stepping on instruction, single stepping on branch etc. that can be controlled from the hypervisor and guests behave accordingly, the LBR feature can also be set/reset from the hypervisor. And, if that is not the case 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 guest can do, can also be done from the hypervisor by setting guest MSR registers or bitmap from the hypervisor.

However, if that is the case that you described and LBR recording cannot be enable Xen then could you please give me some idea what things need to be done from HVM guests side to enable this feature?


Thanks,
Abhinav


--- On Fri, 26/6/09, Jan Beulich <JBeulich@novell.com> wrote:

> From: Jan Beulich <JBeulich@novell.com>
> Subject: Re: [Xen-devel] Last Branch Record (LBR) in Xen
> To: "Abhinav Srivastava" <abhinavs_iitkgp@yahoo.co.in>
> Cc: xen-devel@lists.xensource.com
> Date: Friday, 26 June, 2009, 1:11 PM
> >>> Abhinav Srivastava
> <abhinavs_iitkgp@yahoo.co.in>
> 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_FROM_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
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
> 


      Cricket on your mind? Visit the ultimate cricket website. Enter http://cricket.yahoo.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Last Branch Record (LBR) in Xen
  2009-06-25 16:57 Abhinav Srivastava
@ 2009-06-26  7:41 ` Jan Beulich
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2009-06-26  7:41 UTC (permalink / raw)
  To: Abhinav Srivastava; +Cc: xen-devel

>>> Abhinav Srivastava <abhinavs_iitkgp@yahoo.co.in> 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_FROM_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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Last Branch Record (LBR) in Xen
@ 2009-06-25 16:57 Abhinav Srivastava
  2009-06-26  7:41 ` Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Abhinav Srivastava @ 2009-06-25 16:57 UTC (permalink / raw)
  To: xen-devel



Hi there,

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_FROM_IP registers too), it is not working.

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.

Any help in this regard would be appreciated.

Thanks,
Abhinav



      Love Cricket? Check out live scores, photos, video highlights and more. Click here http://cricket.yahoo.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-26 14:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-26 14:18 Last Branch Record (LBR) in Xen Abhinav Srivastava
  -- strict thread matches above, loose matches on Subject: below --
2009-06-26 13:50 Abhinav Srivastava
2009-06-26 14:01 ` Jan Beulich
2009-06-25 16:57 Abhinav Srivastava
2009-06-26  7:41 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.