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: <bbaabe2a-8525-e73c-1b62-8cc8eaafe005@linux.intel.com>
Date:   Thu, 6 Dec 2018 09:13:50 +0800
From:   Lu Baolu <baolu.lu@...ux.intel.com>
To:     Joerg Roedel <joro@...tes.org>
Cc:     baolu.lu@...ux.intel.com, "Liu, Yi L" <yi.l.liu@...el.com>,
        David Woodhouse <dwmw2@...radead.org>,
        "Raj, Ashok" <ashok.raj@...el.com>,
        "Kumar, Sanjay K" <sanjay.k.kumar@...el.com>,
        "Pan, Jacob jun" <jacob.jun.pan@...el.com>,
        "Tian, Kevin" <kevin.tian@...el.com>,
        "Sun, Yi Y" <yi.y.sun@...el.com>,
        "peterx@...hat.com" <peterx@...hat.com>,
        Jean-Philippe Brucker <jean-philippe.brucker@....com>,
        "iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Jacob Pan <jacob.jun.pan@...ux.intel.com>
Subject: Re: [PATCH v5 02/12] iommu/vt-d: Manage scalalble mode PASID tables

Hi Joerg,

On 12/5/18 11:50 PM, Joerg Roedel wrote:
> 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.

Fair enough. I will fix this up in the next version.

Thank you for pointing this out.

Best regards,
Lu Baolu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ