On Wed, Dec 11, 2024 at 08:15:35AM +0000, Tian, Kevin wrote:
From: Nicolin Chen nicolinc@nvidia.com Sent: Wednesday, December 4, 2024 6:10 AM
Use it to store all vSMMU-related data. The vsid (Virtual Stream ID) will be the first use case. Then, add a rw_semaphore to protect it.
Also add a pair of arm_smmu_attach_prepare/commit_vmaster helpers and put them in the existing arm_smmu_attach_prepare/commit(). Note that identity and blocked ops don't call arm_smmu_attach_prepare/commit(), thus simply call the new helpers at the top.
Probably a dumb question. viommu is tied to a nested parent domain which cannot be identity or blocked. Why do we need to change them too?
For identity/blocked domains, prepare() would return 0 without allocating a vmaster pointer, so later on commit() would update master->vmaster with a NULL, i.e. it's a cleanup routine when switching from a paging/dma domain to an identity/blocked one.
I will update the commit message to make this clear.
Thanks Nic