[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 21 Jul 2023 09:43:49 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=4o9FARo0eOG84FGqt1nysGSmKwavLPWF7xFvPEsgPh8=; b=d6+H7AjHC0NP6QBzP8XvPOu/8uU9iYjDL7A9dDwyh+hQJ0SQ4lG6OxyQqXXkd9O7gxjtx3ZXRhhN1qJSSrIKtpK5I/N1xqNFgThmNfD4criwepEE9ZzPQzZbnjstAsp7zLSX9tm0S8tuY4FNtq/KQTGFmP8gL93VjhutEuy8STGrGSyFcfvqKIXhWzM+dJtY9ic6cs5D1Whw8WlE/ehVv4Qz+I0ueyjfJzHQbOtg2ZbohJyExr0FkE3LwNT67D3+NpmR9b11SE1gTaD7UcsgY1K9dTn9h8C3A8VaSuXesZf0kVM7z+h+l0MsCp9XrcqhOt273D2yKZ6HzlgsDrgZUA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I26TCpBtTQzLCcmgKPxYL2QahkijLHGQQ7bHxM0ENLMfETBsmIjsEdcafXVkkLMK3fhY/qTmmugA+d3w+qPMG8YxwQzTYEhRBsiY+tmJ/+xuTE4wNJOIcLXj/d7q2P/5KdbA4jrzWITCM961mZmELcaAbbEtHlumJstVK/CtLZPild8C8B1zZqPvv3aaSNJzVj/QBbVkzzTKNpgtctDRnPbFx0D5uZ80sd/bdG8tMhBideTGiFY30eeeb7MuN7GuXlSNZW/1zqANp58XowoJuvk/HkOTskz6Kwx7FCvNr8qfLO7qnPbio2cCbeVOQtDV8lFwQNUYNz7mx9jXjxIUng==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 21 Jul 2023 07:44:21 +0000
  • Ironport-data: A9a23:fBYdbqy6oDJLEKcQTUV6t+fnxyrEfRIJ4+MujC+fZmUNrF6WrkUOz 2IeDG2Ha6zZZWemLtEjYdy+8kJSvcDWzoNkSFY5+SAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhP6gT5zcyqlFOZH4hDfDpR5fHatE88t6SH 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KVhW/ MUFEwgXUjWGi9C4n7nmbNRBoMt2eaEHPKtH0p1h5RfwKK9+BLX8GeDN79Ie2yosjMdTG/qYf 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjWVlVQhuFTuGIO9ltiiX8Jak1zev mvb12/4HgsbJJqUzj/tHneE37aRzX+iBdhIfFG+3vlMjGaJ5i9CMhY1SEudgcvlqEiFS/sKf iT4/QJr98De7neDTNPwQhm5q36spQMHVpxbFOhSwD+Kzq3Y8gOIHF8uRzRKaMElnMIuTDls3 ViM9/vOATFsq7STRWiq37GYty6pOSMVIGkBYgcJVQIApdLkpekbnh/JC9puDqOxptn0Ai3rh SCHqjAkgLcehtJN0L+0lW0rmBqpr5nNCwsqvAPeWzv96hsjPdb1IYu19VLc8PBMap6DSUWMt 2QFnM7Y6/0SCZaKl2qGR+Bl8KyV2stp+Qb02TZHd6TNPRz0k5J/Vei8OA1DGXo=
  • Ironport-hdrordr: A9a23:/o4KLatdbUwui5HkiOcTz9bS7skDjNV00zEX/kB9WHVpm6yj+v xGUs566faUskd0ZJhEo7q90ca7Lk80maQa3WBzB8bGYOCFghrKEGgK1+KLrwEIcxeUygc379 YDT0ERMrzN5VgRt7eG3OG7eexQvOVuJsqT9JjjJ3QGd3AVV0l5hT0JbTpyiidNNXJ77ZxSLu v72uN34wCOVF4wdcqBCnwMT4H41qf2fMKPW29+O/Y/gjP+9Q+V1A==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

> 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®.