[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <888dc4b1-663e-3c62-c5dd-34167382aec1@linux.intel.com>
Date: Fri, 26 Jun 2020 09:14:17 +0800
From: Lu Baolu <baolu.lu@...ux.intel.com>
To: Fenghua Yu <fenghua.yu@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Joerg Roedel <joro@...tes.org>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Peter Zijlstra <peterz@...radead.org>,
H Peter Anvin <hpa@...or.com>,
David Woodhouse <dwmw2@...radead.org>,
Dave Hansen <dave.hansen@...el.com>,
Tony Luck <tony.luck@...el.com>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
Christoph Hellwig <hch@...radeed.org>,
Ashok Raj <ashok.raj@...el.com>,
Jacob Jun Pan <jacob.jun.pan@...el.com>,
Dave Jiang <dave.jiang@...el.com>,
Sohil Mehta <sohil.mehta@...el.com>,
Ravi V Shankar <ravi.v.shankar@...el.com>
Cc: baolu.lu@...ux.intel.com,
linux-kernel <linux-kernel@...r.kernel.org>,
x86 <x86@...nel.org>, iommu@...ts.linux-foundation.org
Subject: Re: [PATCH v4 02/12] iommu/vt-d: Change flags type to unsigned int in
binding mm
Hi Fenghua,
On 2020/6/26 4:17, Fenghua Yu wrote:
> "flags" passed to intel_svm_bind_mm() is a bit mask and should be
> defined as "unsigned int" instead of "int".
>
> Change its type to "unsigned int".
Reviewed-by: Lu Baolu <baolu.lu@...ux.intel.com>
Best regards,
baolu
>
> Suggested-by: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Fenghua Yu <fenghua.yu@...el.com>
> Reviewed-by: Tony Luck <tony.luck@...el.com>
> ---
> v2:
> - Add this new patch per Thomas' comment.
>
> drivers/iommu/intel/svm.c | 7 ++++---
> include/linux/intel-iommu.h | 2 +-
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c
> index 778089d198eb..8a0cf2f0dd54 100644
> --- a/drivers/iommu/intel/svm.c
> +++ b/drivers/iommu/intel/svm.c
> @@ -427,7 +427,8 @@ int intel_svm_unbind_gpasid(struct device *dev, u32 pasid)
>
> /* Caller must hold pasid_mutex, mm reference */
> static int
> -intel_svm_bind_mm(struct device *dev, int flags, struct svm_dev_ops *ops,
> +intel_svm_bind_mm(struct device *dev, unsigned int flags,
> + struct svm_dev_ops *ops,
> struct mm_struct *mm, struct intel_svm_dev **sd)
> {
> struct intel_iommu *iommu = intel_svm_device_to_iommu(dev);
> @@ -954,7 +955,7 @@ intel_svm_bind(struct device *dev, struct mm_struct *mm, void *drvdata)
> {
> struct iommu_sva *sva = ERR_PTR(-EINVAL);
> struct intel_svm_dev *sdev = NULL;
> - int flags = 0;
> + unsigned int flags = 0;
> int ret;
>
> /*
> @@ -963,7 +964,7 @@ intel_svm_bind(struct device *dev, struct mm_struct *mm, void *drvdata)
> * and intel_svm etc.
> */
> if (drvdata)
> - flags = *(int *)drvdata;
> + flags = *(unsigned int *)drvdata;
> mutex_lock(&pasid_mutex);
> ret = intel_svm_bind_mm(dev, flags, NULL, mm, &sdev);
> if (ret)
> diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
> index 314a95870e47..4d20f93a5e2d 100644
> --- a/include/linux/intel-iommu.h
> +++ b/include/linux/intel-iommu.h
> @@ -759,7 +759,7 @@ struct intel_svm {
> struct mm_struct *mm;
>
> struct intel_iommu *iommu;
> - int flags;
> + unsigned int flags;
> u32 pasid;
> int gpasid; /* In case that guest PASID is different from host PASID */
> struct list_head devs;
>
Powered by blists - more mailing lists