iommu/vt-d: Change flags type to unsigned int in binding mm
"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". Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Tony Luck <tony.luck@intel.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Acked-by: Joerg Roedel <jroedel@suse.de> Link: https://lkml.kernel.org/r/1600187413-163670-3-git-send-email-fenghua.yu@intel.com
This commit is contained in:
Родитель
c7b6bac9c7
Коммит
2a5054c6e7
|
@ -446,7 +446,8 @@ out:
|
||||||
|
|
||||||
/* Caller must hold pasid_mutex, mm reference */
|
/* Caller must hold pasid_mutex, mm reference */
|
||||||
static int
|
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 mm_struct *mm, struct intel_svm_dev **sd)
|
||||||
{
|
{
|
||||||
struct intel_iommu *iommu = device_to_iommu(dev, NULL, NULL);
|
struct intel_iommu *iommu = device_to_iommu(dev, NULL, NULL);
|
||||||
|
@ -1033,7 +1034,7 @@ intel_svm_bind(struct device *dev, struct mm_struct *mm, void *drvdata)
|
||||||
{
|
{
|
||||||
struct iommu_sva *sva = ERR_PTR(-EINVAL);
|
struct iommu_sva *sva = ERR_PTR(-EINVAL);
|
||||||
struct intel_svm_dev *sdev = NULL;
|
struct intel_svm_dev *sdev = NULL;
|
||||||
int flags = 0;
|
unsigned int flags = 0;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1042,7 +1043,7 @@ intel_svm_bind(struct device *dev, struct mm_struct *mm, void *drvdata)
|
||||||
* and intel_svm etc.
|
* and intel_svm etc.
|
||||||
*/
|
*/
|
||||||
if (drvdata)
|
if (drvdata)
|
||||||
flags = *(int *)drvdata;
|
flags = *(unsigned int *)drvdata;
|
||||||
mutex_lock(&pasid_mutex);
|
mutex_lock(&pasid_mutex);
|
||||||
ret = intel_svm_bind_mm(dev, flags, NULL, mm, &sdev);
|
ret = intel_svm_bind_mm(dev, flags, NULL, mm, &sdev);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -765,7 +765,7 @@ struct intel_svm {
|
||||||
struct mm_struct *mm;
|
struct mm_struct *mm;
|
||||||
|
|
||||||
struct intel_iommu *iommu;
|
struct intel_iommu *iommu;
|
||||||
int flags;
|
unsigned int flags;
|
||||||
u32 pasid;
|
u32 pasid;
|
||||||
int gpasid; /* In case that guest PASID is different from host PASID */
|
int gpasid; /* In case that guest PASID is different from host PASID */
|
||||||
struct list_head devs;
|
struct list_head devs;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче