From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tamas K Lengyel Subject: Re: [RFC PATCH V2 8/8] x86/hvm: factor out vm_event related functions into separate file Date: Thu, 22 Jan 2015 17:42:46 +0100 Message-ID: References: <1421594281-27658-1-git-send-email-tamas.lengyel@zentific.com> <1421594281-27658-9-git-send-email-tamas.lengyel@zentific.com> <54C1329602000078000585F2@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54C1329602000078000585F2@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Tim Deegan , "Tian, Kevin" , wei.liu2@citrix.com, Ian Campbell , Stefano Stabellini , "Dong, Eddie" , Ian Jackson , "xen-devel@lists.xen.org" , Andres Lagar-Cavilla , Jun Nakajima , rshriram@cs.ubc.ca, Keir Fraser , Daniel De Graaf , yanghy@cn.fujitsu.com List-Id: xen-devel@lists.xenproject.org On Thu, Jan 22, 2015 at 5:25 PM, Jan Beulich wrote: >>>> On 18.01.15 at 16:18, wrote: >> +static int hvm_event_traps(long parameters, vm_event_request_t *req) >> +{ >> + int rc; >> + struct vcpu *v = current; >> + struct domain *d = v->domain; > > Unless the intention is to have an exact 1:1 copy of the original, > please use curr and currd here respectively. Ack. > >> +void hvm_event_cr0(unsigned long value, unsigned long old) >> +{ >> + vm_event_request_t req = { >> + .reason = VM_EVENT_REASON_CR0, >> + .vcpu_id = current->vcpu_id, >> + .cr_event.new_value = value, >> + .cr_event.old_value = old >> + }; >> + >> + long parameters = current->domain->arch.hvm_domain >> + .params[HVM_PARAM_MEMORY_EVENT_CR0]; > > And latch current into a local variable curr here and below. Ack. > >> +void hvm_event_msr(unsigned long msr, unsigned long value) >> +{ >> + vm_event_request_t req = { >> + .reason = VM_EVENT_REASON_MSR, >> + .vcpu_id = current->vcpu_id, >> + .msr_event.msr = msr, >> + .msr_event.new_value = value, >> + }; > > The .msr_event sub-structure also has an old_value member - how > come this doesn't get filled (I realize the old code was this way, > but I now doubt earlier patches are all correct in the regard). Razvan might have more information on this side as I haven't really touched MSR events. I vaguely recall some issues with having access to the old MSR value? > > Jan > Thanks, Tamas