lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2f2ab378-9967-ff84-18f1-c48ddeb0ceb6@linux.intel.com>
Date:   Wed, 29 Sep 2021 15:34:51 +0800
From:   Lu Baolu <baolu.lu@...ux.intel.com>
To:     Fenghua Yu <fenghua.yu@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Andy Lutomirski <luto@...nel.org>,
        Dave Hansen <dave.hansen@...el.com>,
        Tony Luck <tony.luck@...el.com>,
        Joerg Roedel <joro@...tes.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Dave Jiang <dave.jiang@...el.com>,
        Jacob Jun Pan <jacob.jun.pan@...el.com>,
        Ashok Raj <ashok.raj@...el.com>,
        Ravi V Shankar <ravi.v.shankar@...el.com>
Cc:     baolu.lu@...ux.intel.com, iommu@...ts.linux-foundation.org,
        x86 <x86@...nel.org>, linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/8] iommu/vt-d: Clean up unused PASID updating functions

Hi Fenghua,

On 2021/9/21 3:23, Fenghua Yu wrote:
> update_pasid() and its call chain are currently unused in the tree because
> Thomas disabled the ENQCMD feature. The feature will be re-enabled shortly
> using a different approach and update_pasid() and its call chain will not
> be used in the new approach.
> 
> Remove the useless functions.
> 
> Signed-off-by: Fenghua Yu <fenghua.yu@...el.com>
> Reviewed-by: Tony Luck <tony.luck@...el.com>

Thanks for this cleanup. I have queued it for v5.16.

Best regards,
baolu

> ---
>   arch/x86/include/asm/fpu/api.h |  2 --
>   drivers/iommu/intel/svm.c      | 24 +-----------------------
>   2 files changed, 1 insertion(+), 25 deletions(-)
> 
> diff --git a/arch/x86/include/asm/fpu/api.h b/arch/x86/include/asm/fpu/api.h
> index 23bef08a8388..ca4d0dee1ecd 100644
> --- a/arch/x86/include/asm/fpu/api.h
> +++ b/arch/x86/include/asm/fpu/api.h
> @@ -106,6 +106,4 @@ extern int cpu_has_xfeatures(u64 xfeatures_mask, const char **feature_name);
>    */
>   #define PASID_DISABLED	0
>   
> -static inline void update_pasid(void) { }
> -
>   #endif /* _ASM_X86_FPU_API_H */
> diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c
> index 0c228787704f..5b5d69b04fcc 100644
> --- a/drivers/iommu/intel/svm.c
> +++ b/drivers/iommu/intel/svm.c
> @@ -505,21 +505,6 @@ int intel_svm_unbind_gpasid(struct device *dev, u32 pasid)
>   	return ret;
>   }
>   
> -static void _load_pasid(void *unused)
> -{
> -	update_pasid();
> -}
> -
> -static void load_pasid(struct mm_struct *mm, u32 pasid)
> -{
> -	mutex_lock(&mm->context.lock);
> -
> -	/* Update PASID MSR on all CPUs running the mm's tasks. */
> -	on_each_cpu_mask(mm_cpumask(mm), _load_pasid, NULL, true);
> -
> -	mutex_unlock(&mm->context.lock);
> -}
> -
>   static int intel_svm_alloc_pasid(struct device *dev, struct mm_struct *mm,
>   				 unsigned int flags)
>   {
> @@ -614,10 +599,6 @@ static struct iommu_sva *intel_svm_bind_mm(struct intel_iommu *iommu,
>   	if (ret)
>   		goto free_sdev;
>   
> -	/* The newly allocated pasid is loaded to the mm. */
> -	if (!(flags & SVM_FLAG_SUPERVISOR_MODE) && list_empty(&svm->devs))
> -		load_pasid(mm, svm->pasid);
> -
>   	list_add_rcu(&sdev->list, &svm->devs);
>   success:
>   	return &sdev->sva;
> @@ -670,11 +651,8 @@ static int intel_svm_unbind_mm(struct device *dev, u32 pasid)
>   			kfree_rcu(sdev, rcu);
>   
>   			if (list_empty(&svm->devs)) {
> -				if (svm->notifier.ops) {
> +				if (svm->notifier.ops)
>   					mmu_notifier_unregister(&svm->notifier, mm);
> -					/* Clear mm's pasid. */
> -					load_pasid(mm, PASID_DISABLED);
> -				}
>   				pasid_private_remove(svm->pasid);
>   				/* We mandate that no page faults may be outstanding
>   				 * for the PASID when intel_svm_unbind_mm() is called.
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ