From: "Ray Bryant" <raybry@mpdtxmail.amd.com>
To: Yang@mpdtxmail.amd.com, Xiaowei <xiaowei.yang@intel.com>
Cc: xen-devel@lists.xensource.com
Subject: xenoprof passive profiling and "mode" setting
Date: Wed, 5 Jul 2006 13:27:58 -0500 [thread overview]
Message-ID: <200607051327.58586.raybry@mpdtxmail.amd.com> (raw)
Xiaowei,
I'm puzzled by the following bit of code in p4_check_ctrs():
if (guest_kernel_mode(current, regs))
mode = 1;
else if (ring_0(regs))
mode = 2;
If I look at the definition for guest_kernel_mode() it is:
include/asm-x86/x86_64/regs.h:
#define guest_kernel_mode(v, r) \
(ring_3(r) && ((v)->arch.flags & TF_kernel_mode))
(Note well: I am running a 64 bit guest and a 64 bit host.)
So, how is that possibly true for the kernel in an HVM guest?
(Wouldn't guest_kernel_mode(regs) be false in that case since it is not
running ring_3()?)
Also, wouldn't ring_0(regs) be true if we are running in kernel mode in an HVM
guest? This code appears to assign such a sample to being part of xen,
right?
So I'm unsure as to whether the above snippet of code sets the mode correctly.
--
Ray Bryant
AMD Performance Labs Austin, Tx
512-602-0038 (o) 512-507-7807 (c)
next reply other threads:[~2006-07-05 18:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-05 18:27 Ray Bryant [this message]
2006-07-05 21:56 ` xenoprof passive profiling and "mode" setting Keir Fraser
-- strict thread matches above, loose matches on Subject: below --
2006-07-06 2:53 Yang, Xiaowei
2006-07-06 16:47 ` Ray Bryant
2006-07-06 20:07 ` Santos, Jose Renato G
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200607051327.58586.raybry@mpdtxmail.amd.com \
--to=raybry@mpdtxmail.amd.com \
--cc=Yang@mpdtxmail.amd.com \
--cc=xen-devel@lists.xensource.com \
--cc=xiaowei.yang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.