From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH V2 2/3] xen/vm_event: Support for guest-requested events Date: Mon, 06 Jul 2015 11:26:03 +0100 Message-ID: <559A73DB020000780008C9AA@mail.emea.novell.com> References: <1434359007-9302-1-git-send-email-rcojocaru@bitdefender.com> <1434359007-9302-3-git-send-email-rcojocaru@bitdefender.com> <558D152B0200007800089FD4@mail.emea.novell.com> <558CFC75.9000905@bitdefender.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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 , Tamas Lengyel Cc: Tim Deegan , kevin.tian@intel.com, Wei Liu , Ian Campbell , Stefano Stabellini , Jun Nakajima , Andrew Cooper , Ian Jackson , Xen-devel , eddie.dong@intel.com, Aravind.Gopalakrishnan@amd.com, suravee.suthikulpanit@amd.com, keir@xen.org, boris.ostrovsky@oracle.com, Daniel De Graaf List-Id: xen-devel@lists.xenproject.org >>> On 30.06.15 at 16:48, wrote: >> > --- a/xen/include/asm-x86/domain.h > >> >> +++ b/xen/include/asm-x86/domain.h >> >> @@ -342,13 +342,15 @@ struct arch_domain >> >> >> >> /* Monitor options */ >> >> struct { >> >> - uint16_t write_ctrlreg_enabled : 4; >> >> - uint16_t write_ctrlreg_sync : 4; >> >> - uint16_t write_ctrlreg_onchangeonly : 4; >> >> - uint16_t mov_to_msr_enabled : 1; >> >> - uint16_t mov_to_msr_extended : 1; >> >> - uint16_t singlestep_enabled : 1; >> >> - uint16_t software_breakpoint_enabled : 1; >> >> + uint32_t write_ctrlreg_enabled : 4; >> >> + uint32_t write_ctrlreg_sync : 4; >> >> + uint32_t write_ctrlreg_onchangeonly : 4; >> >> + uint32_t mov_to_msr_enabled : 1; >> >> + uint32_t mov_to_msr_extended : 1; >> >> + uint32_t singlestep_enabled : 1; >> >> + uint32_t software_breakpoint_enabled : 1; >> >> + uint32_t request_enabled : 1; >> >> + uint32_t request_sync : 1; >> > >> > Can you please switch to plain unsigned int if you already have to >> > touch this? There's no reason I can see to use a fixed width integer >> > type here. >> >> Ack, will make it plain int. > > > IMHO having it fix-width is easier to read when adding new elements to see > how many bits we have left free. I would not want this changed unless there > is a clear benefit to doing so. I can't see what benefit using fixed widht types here is: Best demonstrated with uint64_t, gcc doesn't honor the type of the field anyway. And hence counting the number of left bits (with some unknown definition of "left") is quite pointless too - it's an internal structure, and when a new bit field needs to be added, it doesn't really matter whether it grows the structure (at least no more than any other field addition). Bottom line - no fixed width types when not really warranted, please. Jan