From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: Re: [PATCH V7] xen/vm_event: Clean up control-register-write vm_events and add XCR0 event Date: Thu, 28 May 2015 17:33:22 +0300 Message-ID: <55672732.1060408@bitdefender.com> References: <1432791185-24668-1-git-send-email-rcojocaru@bitdefender.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Lengyel, Tamas" Cc: kevin.tian@intel.com, wei.liu2@citrix.com, ian.campbell@citrix.com, Stefano Stabellini , tim@xen.org, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, jbeulich@suse.com, eddie.dong@intel.com, jun.nakajima@intel.com, andrew.cooper3@citrix.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org On 05/28/2015 05:12 PM, Lengyel, Tamas wrote: > diff --git a/xen/arch/x86/hvm/event.c b/xen/arch/x86/hvm/event.c > index 9d5f9f3..a13195d 100644 > --- a/xen/arch/x86/hvm/event.c > +++ b/xen/arch/x86/hvm/event.c > @@ -21,6 +21,7 @@ > > #include > #include > +#include > #include > > static void hvm_event_fill_regs(vm_event_request_t *req) > @@ -88,55 +89,28 @@ static int hvm_event_traps(uint8_t sync, > vm_event_request_t *req) > return 1; > } > > -static inline > -void hvm_event_cr(uint32_t reason, unsigned long value, > - unsigned long old, bool_t onchangeonly, > bool_t sync) > +void (hvm_event_cr)(unsigned int index, unsigned long value, > unsigned long old) > > > Any reason to have parenthesis around hvm_event_cr? Also, if you could > make the patch available somewhere via git, that would be great, I would > like to test it! Yes, to prevent macro expansion. Jan has suggested that I add a macro to make the calls look neater, please see this change: +void hvm_event_cr(unsigned int index, unsigned long value, unsigned long old); +#define hvm_event_cr(what, new, old) hvm_event_cr(VM_EVENT_X86_##what, new, old) So, unless that call is put in parenthesis, the code you mention is expanded to hvm_event_cr(VM_EVENT_X86_unsigned int index, ...) or something of that nature, and it won't compile. As for a git repo, unfortunately I don't have a public one, but I intend to submit V8 shortly, and if I understood things correctly it's quite likely to enter staging, so it should only be a short while now. Thanks, Razvan