lkml.org 
[lkml]   [2018]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 02/12] iommu/vt-d: Manage scalalble mode PASID tables
On Tue, Dec 04, 2018 at 01:58:06PM +0800, Lu Baolu wrote:
> This function is called in an unsleepable context.
>
> spin_lock(&lock)
> [...]
> if (pasid_table_is_necessary)
> allocate_pasid_table(dev)
> [...]
> spin_unlock(&lock)
>
> We can move it out of the lock range.
>
> How about
>
> if (pasid_table_is_necessary)
> pasid_table = allocate_pasid_table(dev)
>
> spin_lock(&lock)
> [...]
> if (pasid_table_is_necessary)
> set_up_pasid_table(pasid_table)
> [...]
> spin_unlock(&lock)

Hmm, so when the IOMMU is configured in scalable mode we can just
allocate a pasid-table for the device when we set it up, right?

Scalable mode is a boot-time decision, so we know for sure whether we
need a pasid-table on device-setup time. And the device-setup code it
preemptable, so I think it this allocation should be outside of any
spin-locked section.


Joerg

\
 
 \ /
  Last update: 2018-12-05 16:51    [W:0.064 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site