From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v4 18/21] xen/arm: p2m: Clean cache PT when the IOMMU doesn't support coherent walk Date: Fri, 02 May 2014 16:15:56 +0100 Message-ID: <5363B6AC.5050009@linaro.org> References: <1398172475-27873-1-git-send-email-julien.grall@linaro.org> <1398172475-27873-19-git-send-email-julien.grall@linaro.org> <535F739C020000780000D318@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WgFBw-0003CB-ER for xen-devel@lists.xenproject.org; Fri, 02 May 2014 15:16:00 +0000 Received: by mail-ee0-f42.google.com with SMTP id d17so3268184eek.29 for ; Fri, 02 May 2014 08:15:58 -0700 (PDT) In-Reply-To: <535F739C020000780000D318@nat28.tlf.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: xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com, ian.campbell@citrix.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org Hi Jan, On 04/29/2014 08:40 AM, Jan Beulich wrote: >>>> On 22.04.14 at 15:14, wrote: >> +bool_t iommu_has_feature(struct domain *d, uint32_t feature) >> +{ >> + const struct iommu_ops *ops = domain_hvm_iommu(d)->platform_ops; >> + uint32_t features = 0; >> + >> + if ( iommu_enabled && ops && ops->features ) >> + features = ops->features(d); >> + >> + return !!(features & feature); >> +} > > That's slightly strange a feature check: Passing in a bit mask allows > the caller to set more than one bit, with obvious ambiguity in what > this would mean. I'd suggest making this a bit position (with individual > bits defined via enumeration), at once hiding from the generic caller > whether eventually there might be more than 32 features defined. I will create a separate patch to add iommu_has_feature. It will be more clearer. Regards, -- Julien Grall