From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [RFC v1 01/15] iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature Date: Fri, 27 Mar 2015 09:52:54 +0000 Message-ID: <55153686020000780006E687@mail.emea.novell.com> References: <1427286717-4093-1-git-send-email-feng.wu@intel.com> <1427286717-4093-2-git-send-email-feng.wu@intel.com> <5514445E.6070105@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5514445E.6070105@citrix.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: Andrew Cooper , Feng Wu , xen-devel@lists.xen.org Cc: yang.z.zhang@intel.com, kevin.tian@intel.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 26.03.15 at 18:39, wrote: > On 25/03/15 12:31, Feng Wu 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; >> bool_t __read_mostly iommu_hap_pt_share = 1; >> bool_t __read_mostly iommu_debug; >> bool_t __read_mostly amd_iommu_perdev_intremap = 1; >> @@ -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; >> + } >> else if ( !strcmp(s, "debug") ) >> { >> iommu_debug = val; > > At no point here do you add an strcmp(s, "intpost"), which means that > you do not alter the allowable command line syntax. > > intpost must be able to be controlled independently of intremap, so I > suggest > > else if ( !strcmp(s, "intpost") ) > iommu_intpost = val; > > and after the while loop, > > if ( !iommu_intremap ) > iommu_intpost = 0; > > To ensure that intpost is never 1 if intremap is 0. That shouldn't be after the while loop, but elsewhere such that intremap getting turned off for other reasons or even being switched to a default of zero would still result in consistent settings. Jan