From: "Jan Beulich" Subject: Re: [PATCH V4] xen/vm_event: Clean up control-register-write vm_events Date: Fri, 22 May 2015 09:03:43 +0100 Message-ID: <555EFEFF020000780007D105@mail.emea.novell.com> References: <1432213223-5211-1-git-send-email-rcojocaru@bitdefender.com> <555EF8AA020000780007D0A9@mail.emea.novell.com> <555EDFD3.4080409@bitdefender.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <555EDFD3.4080409@bitdefender.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Razvan Cojocaru Cc: tim@xen.org, kevin.tian@intel.com, wei.liu2@citrix.com, eddie.dong@intel.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, jun.nakajima@intel.com, keir@xen.org, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 22.05.15 at 09:50, wrote: > On 05/22/2015 10:36 AM, Jan Beulich wrote: >>>>> On 21.05.15 at 15:00, wrote: > Should I drop the introduction of the XR0 event from this patch and come > back to it in the following iteration of the series? Or simply adjust the title of the patch. >> Also, for readability I wonder whether an identically named macro >> wrapper around hvm_event_cr() wouldn't be a good idea, eliminating >> the need to spell out VM_EVENT_X86_ at each use site. > > #define hvm_event_cr0(new, old) hvm_event_cr(VM_EVENT_X86_XCR0, new, > old)? Sure. Maybe this way. But specifically said "identically named", i.e. envisioned #define hvm_event_cr(what, new, old) hvm_event_cr(VM_EVENT_X86_##what, new, old) >>> --- a/xen/include/asm-x86/domain.h >>> +++ b/xen/include/asm-x86/domain.h >>> @@ -249,6 +249,8 @@ struct pv_domain >>> struct mapcache_domain mapcache; >>> }; >>> >>> +#define monitor_ctrlreg_bitmask(ctrlreg_index) (1 << ctrlreg_index) >> >> (1U << (ctrlreg_index)) would seem better to me. Also - does this >> need to be in this header (which gets included basically everywhere)? > > Ack. As for the header, that's where the fields are > (write_ctrlreg_enabled, sync and onchangeonly), and since several .c > files use the fields it seemed the natural place to put the macros. A monitor/event specific header would seem more natural to me. If everything relating to field in struct domain and struct vcpu got put in this one header, we'd end up with a mess. Jan