From: Marcelo Tosatti <mtosatti@redhat.com>
To: will.auld@intel.com
Cc: gleb@redhat.com,
"xiantao.zhang@intel.com" <xiantao.zhang@intel.com>,
"jinsong.liu@intel.com" <jinsong.liu@intel.com>,
"avi@redhat.com" <avi@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"donald.d.dugger@intel.com" <donald.d.dugger@intel.com>
Subject: Re: [PATCH 1/2] Add code to track call origin for msr assignment.
Date: Fri, 16 Nov 2012 19:58:47 -0200 [thread overview]
Message-ID: <20121116215847.GA12864@amt.cnet> (raw)
In-Reply-To: <1353011145.918.11.camel@WillAuldHomeLinux>
On Thu, Nov 15, 2012 at 12:25:45PM -0800, Will Auld wrote:
> In order to track who initiated the call (host or guest) to modify an msr
> value I have changed function call parameters along the call path. The
> specific change is to add a struct pointer parameter that points to (index,
> data, caller) information rather than having this information passed as
> individual parameters.
>
> The initial use for this capability is for updating the IA32_TSC_ADJUST
> msr while setting the tsc value. It is anticipated that this capability
> is useful other tasks.
>
> Signed-off-by: Will Auld <will.auld@intel.com>
> ---
> arch/x86/include/asm/kvm_host.h | 12 +++++++++---
> arch/x86/kvm/svm.c | 21 +++++++++++++++------
> arch/x86/kvm/vmx.c | 24 +++++++++++++++++-------
> arch/x86/kvm/x86.c | 23 +++++++++++++++++------
> arch/x86/kvm/x86.h | 2 +-
> 5 files changed, 59 insertions(+), 23 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 42bce48..a3aac1c 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -883,9 +883,9 @@ EXPORT_SYMBOL_GPL(kvm_enable_efer_bits);
> * Returns 0 on success, non-0 otherwise.
> * Assumes vcpu_load() was already called.
> */
> -int kvm_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
> +int kvm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
> {
> - return kvm_x86_ops->set_msr(vcpu, msr_index, data);
> + return kvm_x86_ops->set_msr(vcpu, msr);
> }
>
> /*
> @@ -4286,7 +4293,11 @@ static int emulator_get_msr(struct x86_emulate_ctxt *ctxt,
> static int emulator_set_msr(struct x86_emulate_ctxt *ctxt,
> u32 msr_index, u64 data)
> {
> - return kvm_set_msr(emul_to_vcpu(ctxt), msr_index, data);
> + struct msr_data msr;
> + msr.data = data;
> + msr.index = msr_index;
> + msr.host_initiated = true;
false, this is guest instruction emulation.
next prev parent reply other threads:[~2012-11-16 22:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-15 20:25 [PATCH 1/2] Add code to track call origin for msr assignment Will Auld
2012-11-16 21:58 ` Marcelo Tosatti [this message]
2012-11-19 9:02 ` Gleb Natapov
-- strict thread matches above, loose matches on Subject: below --
2012-11-22 2:51 Will Auld
2012-11-25 13:40 ` Gleb Natapov
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=20121116215847.GA12864@amt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@redhat.com \
--cc=donald.d.dugger@intel.com \
--cc=gleb@redhat.com \
--cc=jinsong.liu@intel.com \
--cc=kvm@vger.kernel.org \
--cc=will.auld@intel.com \
--cc=xiantao.zhang@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.