[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/8] IOMMU/x86: drop locking from quarantine_init() hooks


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 11 Apr 2022 12:18:13 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FUbQDo9Kb3I9PKZFWq4LglkV3RQY7wo+HxS/U2Ly0qk=; b=nO851Hi2g9TlPsPgfS7tGkfpw6T2DS7AZmYA6lOwuTy0kkonqu/iqQIJaTaw67hf7lOrpK/1CgsipDiFCGikecKXra7gmo0/GVHR+uU7CJHUFglvKjUweloXTzRQ1JlKyBkT3KJoFxGN/Npzj1ueRh7h9uuyrOCG/XUmEHzgyAWZpZflSo82FRFXiCvrTH3/lM5pBbJw8CkA1Q0rWElmywaJa9pXU9XvsC94W2/t2LgIKuJze9ErTc38YvVwOgdEFlhZeUXTdoxQnieXpfUAvs5Uc3EgoPWhcOXpuUsmBtCO7eXt9JRNKwtxjgJBco7kn+4T/Tg78TW0fIQYH5Vt2A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LdWIi1dNOsgQpmxsW/6NGoQbeM6I5AFHde32T8r1Q7xCwHV71m1jCWI4vYvNYpkDiHdtrtZPrj+wowPNhhHkGfDqknZ67enzoi9CTqhiNaQbuxAxZQmZkWvWBOi8YWdRLFOEYG0D05AYlaBZbKcgZLVLIjHLJq0kreP7iTwV/bzTZ9lAHOSvRoVjJLSMtXE0AMtAUiM0sOx+61A5McOoJ7OoAEnpWeyeud9DnXUTXVPeV62StmWBMcwbNXFhFeFXdAQ3VwweAOBy5pL/SLhQCyFJMM8rDHcuT+t0OzCL64HrNg0cIp7+f02a9STYTT1/cvKf3b+Oa2mOvE6pQAsJ3Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Kevin Tian <kevin.tian@xxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 11 Apr 2022 10:18:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.04.2022 12:01, Andrew Cooper wrote:
> On 11/04/2022 10:35, Jan Beulich wrote:
>> Prior extension of these functions to enable per-device quarantine page
>> tables already didn't add more locking there, but merely left in place
>> what had been there before. But really locking is unnecessary here:
>> We're running with pcidevs_lock held (i.e. multiple invocations of the
>> same function [or their teardown equivalents] are impossible, and hence
>> there are no "local" races), while all consuming of the data being
>> populated here can't race anyway due to happening sequentially
>> afterwards. See also the comment in struct arch_pci_dev.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> It is only legitimate to drop these calls if you delete the mapping_lock
> entirely.  Otherwise you're breaking the semantics of mapping_lock.

Not for all domains other than DomIO. And DomIO is, well, special. As
is at what times quarantine_init() is actually being invoked.

> Your argument of "well this is already guarded by the pci lock" means
> that these are uncontended lock/unlock operations, and therefore not
> interesting to drop in the first place.
> 
> This patch is specifically setting us up for an XSA in the future when
> the behaviour of the the PCI lock changes, the fix for which will be
> revert this patch.

That wouldn't suffice then. As said in the description, and as discussed
during the development of the XSA-400 series, further locking would need
adding then.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.