All of lore.kernel.org
 help / color / mirror / Atom feed
* [HVM][XENOPROFILE][RFC][0/3] xenoprofile HVM patches
@ 2006-09-15 16:19 Woller, Thomas
  2006-09-15 21:28 ` [XENOPROLIFE] New oprofile patch for XenOProfile Santos, Jose Renato G
  0 siblings, 1 reply; 14+ messages in thread
From: Woller, Thomas @ 2006-09-15 16:19 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 2885 bytes --]

Keir, 
The following 3 patches allow HVM (SVM and VT) guests to be passively
profiled using the very latest patches from Renato.  These patches apply
to 11470.
Renato's patches:
http://xenoprof/sourceforge.net  oprofile-0.9.1-xen-r2.patch
And also a patch not posted FAIK
(oprofile-0.9.1-fix-hvm-addr-overlap.patch) which is in the attached
tar.bz2 file.

hvm_xenoprofile_1.patch -
The first patch is merely the same patch that I posted a few weeks ago.
The STGI code is moved from the exits.S files, and into the vmexit
handler.  The extra do_nmi() is removed allowing the host to handle the
NMI when the stgi instruction is executed.  This patch allows the second
patch to properly set "guest NMI" flag for the oprofile code to
determine proper rip/eip and mode.

hvm_xenoprofile_2.patch -
The second patch adds the actual xenoprofile fixes for SVM:

1) hvm function (svm_oprofile_get_eip())
This new hvm table function is called from the op_module_athlon.c code,
and returns the proper eip and "mode" for use in the
xenoprof_log_event() function.  

2) The vmexit handler code now checks the exitcode and if an NMI was
intercepted, then prior to the stgi(), a flag (VGCF_hvm_guest_nmi) is
set in the v->arch.guest_context.flags field.   The VGCF_hvm_guest_nmi
bit is checked during NMI processing via the hvm function callback. 

hvm_xenoprofile_3.patch -
The third patch adds the actual xenoprofile fixes for VT:
I checked (verified by Renato), that the VT traces look ok also.  There
is some code that I am unsure about in the vmx_oprofile_get_eip(): i.e
using the __vmread() to get eip might not be in the proper context, and
then secondly I am not sure how to determine the guest CPL level.

Overall, these patches seem to work fine for 32bit hypervisor, as well
as 64bit hypervisor with 32bit and 64bit HVM guests.  You do need to use
both of Renato's oprofile patches on top of 0.9.1.  With another
oprofile release soon (this week?), I believe that some of the "r2"
patch will be incorporated into 0.9.2, but not sure which parts.

There certainly might be a better way to obtain the eip/mode, but since
the SVM code is not calling do_nmi() then the host context will handle
the NMI, and there must be some mechanism to properly setup the eip/mode
in the op_model code indirectly.  I am not sure if the VT code requires
the same approach since do_nmi() is called directly, and the eip/mode
could be passed directly to this function.

The attached tar.bz2 file contains some example logs, and some scripts
from Ray Bryant (AMD) for extracting and normalizing each of the
profiling buckets.  There is a brief README for using the scripts. 

We'd like to see this get into 3.0.3 if possible.  Renato has reviewed
the patches, but not actually tested these patches on his platforms.
Feedback appreciated,
Tom Woller



[-- Attachment #2: xenoprofile_hvm.tar.bz2 --]
[-- Type: application/octet-stream, Size: 12840 bytes --]

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: [XENOPROLIFE] New oprofile patch for XenOProfile
@ 2006-11-08 21:00 Bryant, Ray
  2006-11-08 22:06 ` Santos, Jose Renato G
  0 siblings, 1 reply; 14+ messages in thread
From: Bryant, Ray @ 2006-11-08 21:00 UTC (permalink / raw)
  To: Santos, Jose Renato G, Ray Bryant; +Cc: xen-devel, Woller, Thomas

Santos, Jose Renato G wrote:

<snip>

>>> 
>>> Ok. That seems a good plan.
>>> I will be glad to help if I can when you have more details.
>>> On a related note, I received a report that XenOprofile is missing
>>> some user level samples. I am preparing a patch with the fix and
>>> should post it to the list later today. This should affect kernel
>>> samples though. 
>>> 
>> 
>> "should" or "should not" affect kernel samples?
>> 
> 
> Sorry for the typo. It should NOT affect kernel samples REnato

That's what I figured, but was just checking.  :-)

I mispoke before, the last time I have this stuff working was with cs
11408 and what I labeled "old profile" (whatever that was...)

So I went back and resurrected my cs 11408 xen build and ran three
different versions of xenoprof against it:

(1)  oprofile 0.9.2 + your patch for 0.9.2
(2)  oprofile 0.9.1 + your patch r3 for 0.9.1
(3)  oprofile 0.9.1 + Rosimildo's old patch to fix image->start and
image->end for 64 bit hypervisor

(1) and (2) didn't give me any xen or guest kernel samples.   (3) worked
the way I was expecting things to work (as it had before).
So I am guessing that (3) is the old profile I used before.

I rebooted to cs 11785 + AMD patches, and retried (3) and it works
basically  the same as it did for 11408 (whew).  I still haven't
verified that the xen and kernel guest samples are correct, but at least
there are xen, kernel guest, kernel user samples and I'm not getting any
with (1) or (2).

So I am thinking that the problems I am seeing are related to 64-bit
hypervisor and the more recent fixes than Rosimildo's patchset.

-- 
Best Regards,

Ray

Ray Bryant, Ph. D.
x50038 or  512-602-0038
AMD Performance Labs
Austin, Texas

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

end of thread, other threads:[~2006-11-09 17:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-15 16:19 [HVM][XENOPROFILE][RFC][0/3] xenoprofile HVM patches Woller, Thomas
2006-09-15 21:28 ` [XENOPROLIFE] New oprofile patch for XenOProfile Santos, Jose Renato G
2006-09-18 18:28   ` William Cohen
2006-09-27 17:17     ` XenOProfile patch for Oprofile 0.9.2 Santos, Jose Renato G
2006-11-07 17:24   ` [XENOPROLIFE] New oprofile patch for XenOProfile Ray Bryant
2006-11-07 23:51     ` Santos, Jose Renato G
2006-11-08 15:11       ` Woller, Thomas
2006-11-08 16:54         ` Santos, Jose Renato G
2006-11-08 17:36           ` [PATCH] XENOPROLIFE. Bug fix for missing passive domain user leval samples Santos, Jose Renato G
2006-11-08 19:22           ` [XENOPROLIFE] New oprofile patch for XenOProfile Ray Bryant
2006-11-08 20:36             ` Santos, Jose Renato G
  -- strict thread matches above, loose matches on Subject: below --
2006-11-08 21:00 Bryant, Ray
2006-11-08 22:06 ` Santos, Jose Renato G
2006-11-09 17:50   ` Ray Bryant

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.