From: "Jan Beulich" Subject: Re: [v4][PATCH 04/19] xen/passthrough: extend hypercall to support rdm reservation policy Date: Mon, 06 Jul 2015 12:39:34 +0100 Message-ID: <559A8516020000780008CAA1@mail.emea.novell.com> References: <1435053450-25131-1-git-send-email-tiejun.chen@intel.com> <1435053450-25131-5-git-send-email-tiejun.chen@intel.com> <55927C78.10301@intel.com> <5592A598.60001@eu.citrix.com> <55933E4D.4030405@intel.com> <5593BAAB.20801@eu.citrix.com> <5593C544.2030009@intel.com> <559A75DF020000780008C9D9@mail.emea.novell.com> <559A5EED.2010904@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <559A5EED.2010904@intel.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: Tiejun Chen Cc: Kevin Tian , Keir Fraser , Ian Campbell , George Dunlap , Andrew Cooper , Tim Deegan , "xen-devel@lists.xen.org" , Stefano Stabellini , Suravee Suthikulpanit , Yang Zhang , Aravind Gopalakrishnan List-Id: xen-devel@lists.xenproject.org >>> On 06.07.15 at 12:56, wrote: >>>> Yes, this demonstrates my point. Each of these is a single-bit boolean >>>> value that takes up a single bit -- either on or off. But here you have >>>> three values -- NO_DRM, RELAXED, and STRICT, that take up two bits. If >>> >>> Is this fine to you? >>> >>> #define _XEN_DOMCTL_DEV_NO_RDM 0 >>> #define XEN_DOMCTL_DEV_NO_RDM (1U<<_XEN_DOMCTL_DEV_NO_RDM) >>> #define _XEN_DOMCTL_DEV_RDM_RELAXED 1 >>> #define XEN_DOMCTL_DEV_RDM_RELAXED (1U<<_XEN_DOMCTL_DEV_RDM_RELAXED) >>> #define _XEN_DOMCTL_DEV_RDM_STRICT 2 >>> #define XEN_DOMCTL_DEV_RDM_STRICT (1U<<_XEN_DOMCTL_DEV_RDM_STRICT) >> >> AIUI these aren't individual flags, but kind of an enumeration. I.e. >> you should keep the original definitions and add - as suggested by >> George - a mask (two bits wide right now). >> > > Okay but George also thought NO_RDM may be pointless since we can just > ignore this flag field simply for DT device, and he also thought one bit > may be fine enough to cover two cases, strict and relaxed. So maybe > finally, here is, > > #define XEN_DOMCTL_DEV_RDM_RELAXED 1 > #define XEN_DOMCTL_DEV_RDM_FLAGS_MASK (0x1) Except that then you don't need a mask. Jan