From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] Add code to track call origin for msr assignment. Date: Tue, 30 Oct 2012 14:42:17 +0200 Message-ID: <508FCB29.5010601@redhat.com> References: <1351545508.4932.13.camel@WillAuldHomeLinux> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Will Auld , mtosatti@redhat.com, xiantao.zhang@intel.com, kvm@vger.kernel.org, jinsong.liu@intel.com, donald.d.dugger@intel.com To: will.auld@intel.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:41234 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750881Ab2J3MmY (ORCPT ); Tue, 30 Oct 2012 08:42:24 -0400 In-Reply-To: <1351545508.4932.13.camel@WillAuldHomeLinux> Sender: kvm-owner@vger.kernel.org List-ID: On 10/29/2012 11:18 PM, 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 for other tasks. Looks good. > > struct x86_instruction_info; > > +/* > + * Defined values for msr_data.initiated_by > + */ > +#define KVM_GUEST_INITIATED 0x1 > +#define KVM_HOST_INITIATED 0x2 > + > +struct msr_data { > + u32 initiated_by; But this can be simplified to 'bool host_initiated;'. Later checks should look cleaner. > + u32 index; > + u64 data; > +}; > + -- error compiling committee.c: too many arguments to function