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

Re: [RFC PATCH] pci: introduce per-domain PCI rwlock


  • To: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 12 Jul 2023 13:23:39 +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=eDtPm9QkeCo50XZePz2iRaGDHxRvfJHfslIqfxv1a/0=; b=KARu8srMsBJ7ribndubHC4KQkKAK14SHzO5hFWELeSd1DKC25zk8Bc8Im/s/5ihjSNCOVivv+ISyLouiGwGm5emY5tmu+Y44wLC4AMXdMrckH3snWQee8nbDwL2IC4d4UPZZ9/uWeWfPKD6vnF73oa5PY6m1uI7szcNoHNi0/SWwDQfoH0Z3HGgEWxio+Up9W7DgbzNNe5AZbJZXuI6te2DEy6pHuIMWq66Agog42HXPgYuctFtidLR7iPsJ0GGN2kPhOfNqnoYVmS+qS1ole0wPb5pwgREFaNaMV9xSmYVzh5+pp1fYT9Nztjf9RAl9SvB1WvzHqqZQakgyRK9mJQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LAekG3TQtwH0dkcnbtNeiJw9rcZVG9h3pmNYZ/hioXq43AmwBoehGn0PGMbf1/JCRhs3DkWLzz7g11G1NPT05/VkO6h23Qtj1lQcwdVn0R9NEVnKoshn/LrqHThhbG8gr8O8qvpoq+wcLyNlj0Jkwa9x0epcK1MHBfjZoKHF9X0l+hBtRpBnTKXLCBGfjvC8tVeQFH4CDM2CxW9v1QgGIPddiCZ1rvtP3NMBJnIE2gbm4P9xLC2+taig46soCn826IMkfDZUq/Q4fPGnfooPqEMhJO1sgFpzikBLEGlGQIhy0e/TuSj0TXLahg6BGPmHJRK8rk4yyESTX1q6Z0th5A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Oleksandr Tyshchenko <olekstysh@xxxxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 12 Jul 2023 11:23:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.07.2023 13:09, Volodymyr Babchuk wrote:
> Jan Beulich <jbeulich@xxxxxxxx> writes:
> 
>> Up front remark: I'm sorry for some possibly unhelpful replies below. I,
>> for one, am of the opinion that some of the issues you ask about are to
>> be looked into by whoever wants / needs to rework the locking model.
>> After all this (likely) is why nobody has dared to make an attempt before
>> the need became apparent.
> 
> I have no great need desire or need to rework the locking model. I was
> perfectly fine with much narrower vpci_lock. As you remember, it is
> Roger who suggested to extend this lock to the include the whole PCI
> device.
> 
> I already tried something like this as part of the another patch series:
> "[RFC,01/10] xen: pci: add per-domain pci list lock" [1], with the same
> result: it was considered very hard to do this properly, so I dropped
> that effort. I am not so familiar with x86-specific code as a whole and
> IOMMU drivers in particular to be 100% sure that I am doing correct
> changes. Without support from x86 guys I can't do proper patches and
> looks like x86 guys are not interested in this.

That's not the case, no. The problem is time: I don't have the time to
take on this effort myself. I'm willing to help where necessary, within
reasonable bounds. But I can't realistically do large parts of the
analysis that is inevitably needed. (I'm also a little sick of doing
code audits for other, unrelated reasons.) Hence that earlier "up front"
remark.

> So, this is dead end.
> 
> Roger, in [2] I proposed another approach to fix ABBA in modify_bars():
> store copy of BARs in the domain structure. Taking into account that my
> effort to introduce d->pci_lock basically failed (again), I am proposing
> to return back to d->vpci_lock + BARs shadow copy in the domain
> struct. What do you think? And you, Jan?

I support Roger's earlier request, and I think that doing what you
propose would move us further away from where we want to arrive at some
point.

I'm sorry that this is all pretty unpleasant.

Jan

> [1] 
> https://lore.kernel.org/all/20220831141040.13231-2-volodymyr_babchuk@xxxxxxxx/
> [2] https://lore.kernel.org/all/87ilbfnqmo.fsf@xxxxxxxx/
> 




 


Rackspace

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