lkml.org 
[lkml]   [2023]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 6/8] iommu/arm-smmu-v3: Move CD table to arm_smmu_master
On Wed, Aug 02, 2023 at 02:35:23AM +0800, Michael Shavit wrote:
> @@ -2465,6 +2440,22 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
> if (smmu_domain->stage != ARM_SMMU_DOMAIN_BYPASS)
> master->ats_enabled = arm_smmu_ats_supported(master);
>
> + if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1) {
> + if (!master->cd_table.cdtab) {
> + ret = arm_smmu_alloc_cd_tables(master);
> + if (ret) {

Again, I didn't look very closely at your locking, but what lock is
being held to protect the read of master->cd_table.cdtab ?

> + master->domain = NULL;
> + goto out_unlock;

This is only the domain lock:
mutex_unlock(&smmu_domain->init_mutex);

Which is no longer sufficient.

You need some kind of lock in the master struct to protect the shared
cd table and everything in it?

Jason

\
 
 \ /
  Last update: 2023-08-02 01:54    [W:0.116 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site