From: "Jan Beulich" Subject: Re: [RFC v2 02/15] iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature Date: Tue, 09 Jun 2015 15:10:27 +0100 Message-ID: <55770FF30200007800082AAC@mail.emea.novell.com> References: <1431076038-7497-1-git-send-email-feng.wu@intel.com> <1431076038-7497-3-git-send-email-feng.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1431076038-7497-3-git-send-email-feng.wu@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: Feng Wu Cc: kevin.tian@intel.com, keir@xen.org, george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com, xen-devel@lists.xen.org, yang.z.zhang@intel.com List-Id: xen-devel@lists.xenproject.org >>> On 08.05.15 at 11:07, wrote: > @@ -51,6 +52,7 @@ bool_t __read_mostly iommu_passthrough; > bool_t __read_mostly iommu_snoop = 1; > bool_t __read_mostly iommu_qinval = 1; > bool_t __read_mostly iommu_intremap = 1; > +bool_t __read_mostly iommu_intpost = 0; Pointless initializer. > @@ -94,7 +96,11 @@ static void __init parse_iommu_param(char *s) > else if ( !strcmp(s, "qinval") ) > iommu_qinval = val; > else if ( !strcmp(s, "intremap") ) > + { > iommu_intremap = val; > + if ( iommu_intremap == 0 ) > + iommu_intpost = 0; Please help the compiler and use the local variable in the if() clause rather than the global one. And considering it's a boolean, perhaps !val would also be better than val == 0. > @@ -272,7 +278,10 @@ int __init iommu_setup(void) > iommu_enabled = (rc == 0); > } > if ( !iommu_enabled ) > + { > iommu_intremap = 0; > + iommu_intpost = 0; > + } I think you'd better do this in a second if ( !iommu_intremap ). Jan