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

Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci structure


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 21 Jul 2023 10:48:27 +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=7+oZB76d4fwc3fm43fnQwwm3jFf+WcExKC0WCwYj3NE=; b=dIdqUPWpRqo/IjdGCkO7XtSxz8d/nhVmCYuOzq6AZsm43GgrlRXiAvdBnKWfSxFeHWmwIUSlB0FDuh+o7MbQuXSW+y2Td8rZS9E7UveBdmVBjKoNreg1pf1r39mgL8AMIqC/2svx6lCWKJi1D0w18jqDGPn8rIeoC5q7S35BqzLWFXjn7kDKrv8nhr6LWggaqX2YItBjxmbxO3bpshRMVVKAt/9YRkKyBlWGa42SoA+sFr9ITirierKm3jWWTjkZhDEz8QM+IMuLZvdGKcs6IGdd16Puph/7/9j109XGvvhSaeRjvnnBfQ/5tCP7ErDHSspsiwSysQXH8RVo+RI+/A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZRLgz0HnpTlyceeD208nB2++m+jDf0DLbaReyYhX1J2Z1Xm0TSpre5PpTdloWR9fuQzgjxXY36473oIRqwGLI+lm7cDazBGt2uJYNhn+iOm1oNRuX7l/zNQnvFfhCxJ3dsGoh7s88TAcgjXhsREmSFE2fK3LLr4WdHZgFoWlk/1xrfB6gTYB/OE8Quq+33QzEkc3/qNLt+UKHbXn3g4GjAePwZWPPGgV/oOmKLiIiBa50cIrC1jTPjjgW4BTheTGvn47bZq1wUWEve4gZ++g3fXsG0BUcnYImbmfi6QEIyUiy4D/S9unGTo0Ycpcc2A9tu3DD2zZxnkblVT6mk3CJg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 21 Jul 2023 08:48:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21.07.2023 09:43, Roger Pau Monné wrote:
> On Fri, Jul 21, 2023 at 08:02:33AM +0200, Jan Beulich wrote:
>> On 20.07.2023 18:14, Roger Pau Monné wrote:
>>>  Strictly speaking however the init
>>> handlers don't require the lock in write mode unless we use such
>>> locking to get exclusive access to all the devices assigned to the
>>> domain BARs array for modify_bars().
>>
>> Aiui in the present model modify_bars() has to use the vpci lock for
>> protection.
> 
> But the current protection is insufficient, as we only hold the vpci
> lock of the current device, but we don't hold the vpci lock of the
> other devices when we iterate over in order to find overlapping bars
> (or else it wold be an ABBA deadlock situation).
> 
> So my suggestion (which can be done later) is to take the newly
> introduced per-domain rwlock in exclusive mode for modify_bars() in
> order to assert there are no changes to the other devices vpci bar
> fields.

I think this makes sense, just that it doesn't belong in this patch.

Jan

>> Therefore imo in any of the init functions the assertions
>> should either express the real requirements of those functions, or be
>> omitted on the basis that they're all called out of add-handlers
>> anyway.
> 
> I'm happy to omit for the time being.  Iff we agree that modify_bars()
> requires the rwlock in exclusive mode then we could add the assertion
> there, but not in the init functions themselves.
> 
> Thanks, Roger.




 


Rackspace

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