All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ray Bryant" <raybry@mpdtxmail.amd.com>
To: "Yang, Xiaowei" <xiaowei.yang@intel.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: xenoprof passive profiling and "mode" setting
Date: Thu, 6 Jul 2006 11:47:23 -0500	[thread overview]
Message-ID: <200607061147.23955.raybry@mpdtxmail.amd.com> (raw)
In-Reply-To: <E42673822206994F8293A048721B91A506131C@pdsmsx412.ccr.corp.intel.com>

On Wednesday 05 July 2006 21:53, Yang, Xiaowei wrote:
> >guest_kernel_mode() does not work for HVM guests. It may need to be
> >fixed -- it had previously only been used in paravirtual-only contexts.
> >
> >It might make sense to invert[*] the predicate and rename to
> >user_mode(). Then definition is simply ring_3(regs) for x86/32 and
> >(ring_3(regs) && !((v)->arch.flags & TF_kernel_mode)) for x86/64.
> >
> >So maybe:
> >   int mode = 2;
> >   if (guest_mode(regs))
> >       mode = user_mode(current, regs) ? 0 : 1;
>
> Yes, this is a better solution for sure, to take both para-domain and
> hvm into account.
> But it's not a problem for now:) _mode_ logic only applies to active
> domiain. Oprofile doesn't use it for samples between PASSIVE_START_CODE
> and PASSIVE_STOP_CODE. Rather it relies on PC range to distinguish
> xen/kernel/app samples.
>
> Thanks,
> Xiaowei

Xiaowei,

Hmmm.... It seems to me that the pc range thing is at the very least obscure 
(I certainly didn't spot it, but then I've avoided looking at the oprofile 
code).   I'd rather have the mode set correctly for hvm guests (passive 
profiling) as well, and fix the logic downstream in oprofile to deal with it 
correctly without the pc range info.

Besides, isn't this problem in the guest_kernel_mode(regs) macro just going to 
bite someone else later on?   It would make most sense to fix this so it 
works for all guests, not just paravirtualized ones.

-- 
Ray Bryant
AMD Performance Labs                   Austin, Tx
512-602-0038 (o)                 512-507-7807 (c)

  reply	other threads:[~2006-07-06 16:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-06  2:53 xenoprof passive profiling and "mode" setting Yang, Xiaowei
2006-07-06 16:47 ` Ray Bryant [this message]
2006-07-06 20:07   ` Santos, Jose Renato G
  -- strict thread matches above, loose matches on Subject: below --
2006-07-05 18:27 Ray Bryant
2006-07-05 21:56 ` Keir Fraser

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=200607061147.23955.raybry@mpdtxmail.amd.com \
    --to=raybry@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.