[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: Thu, 20 Jul 2023 18:14:11 +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=S5XqeSpoSMiHGxJV+Hfwi6aytvUycZVxS45ve2ddLmY=; b=LskurM+gdbwEM6FO557nLfVU3ilBOg4sqcP2ms1LJ93jLTGyq0E3KFYkx690WFc9FvzXEy3FzHnuwDRjN6GflC3eIFVg5jPaBpJbdzIulAXqPuYxlvqqC+eUnLMSOYwP6C0cA8JWTSPRuq2XGekb8Ht55GV5xgsA0gAM5u0mMhPpDa7mdC9yObH84JkUrIMrGq8h6SrWI+TeAmhkDZKUkux3m1kVvFgpoyqUi5kWZZIoEd8j8neQ14uiTAu0AmrTmkjevEtPUltQHcaZ68Eeg9DVVQ+R9ulEylJyWTlJZ/bT8IDe11zhfH8SJgtBi3g8ifu49DcSE/AEyYzSoJ0x9w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YgDr00UbT3RrAUGa+2nLhl5CKM1H8jwo4bb++ZGscQjGUVPmbv6sJAFY5RVPXbfCq3ChDCMop7teQ4iFB/yo5SYwWo+cSDdwDInR59XPiyeXTIrLK/tRaPd4BLQTPwTnTc0KE2ryUc7YFAIY9tpffOxSPuEpFQGXuh0RjbK3z4x7LaIHtgyCUtwnOcVtvi4yn+a3EQ5Zv/LWRsM7YRw4pHQjYTEO0pdLmTD1i3ggopG4Luex1btjc9sNf8yTCAslWu5/cAPd49sTY4tdNpkOZltxJMe91+/YCPFKoME+F3xj66q9TuDe2ZZsIQlsfCDmQGhXhZ3tNfMcgRoEznknhQ==
  • 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: Thu, 20 Jul 2023 16:14:41 +0000
  • Ironport-data: A9a23:zbxjVq/jWdWsOweIN1VkDrUDUX+TJUtcMsCJ2f8bNWPcYEJGY0x3m zceXj3UbP+LN2Khf9BzPYvl8BxTsZOGzdc3T1A//Cw8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ird7ks21BjOkGlA5AdmOqoT5AW2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDkl+1 KAfNTkyfyyGuNic/ZaybsZtqMA8eZyD0IM34hmMzBn/JNN/G9XmfP+P4tVVmjAtmspJAPDSI dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTaNilAruFTuGIO9ltiiX8Jak1zev mvb12/4HgsbJJqUzj/tHneE37aRxHOnBtlJfFG+3q5k22CNgWg3NEdIRECBrsvmyXWSS80Kf iT4/QJr98De7neDTNPwQhm5q36spQMHVpxbFOhSwD+Kzq3Y8gOIHF8uRzRKaMElnMIuTDls3 ViM9/vOATFsq7STRWiq37GYty6pOSMVIGkBYgcJVQIApdLkpekbnh/JC9puDqOxptn0Ai3rh SCHqjAkgLcehtJN0L+0lW0rmBqpr5nNCwsqvAPeWzv/6hsjPNL/IYu19VLc8PBMap6DSUWMt 2QFnM7Y6/0SCZaKl2qGR+Bl8KyV2stp+Qb02TZHd6TNPRz3k5J/Vei8OA1DGXo=
  • Ironport-hdrordr: A9a23:YjbMPalD6ovpPABiwy/5a+GZVQjpDfLo3DAbv31ZSRFFG/Fw9/ rCoB17726QtN91YhsdcL+7V5VoLUmzyXcX2/hyAV7BZmnbUQKTRekP0WKL+Vbd8kbFh41gPM lbEpSXCLfLfCJHZcSR2njELz73quP3jJxBho3lvghQpRkBUdAF0+/gYDzranGfQmN9dP0EPa vZ3OVrjRy6d08aa8yqb0N1JNQq97Xw5fTbiQdtPW9f1DWz
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Jul 20, 2023 at 06:03:49PM +0200, Jan Beulich wrote:
> On 20.07.2023 02:32, Volodymyr Babchuk wrote:
> > --- a/xen/drivers/vpci/msi.c
> > +++ b/xen/drivers/vpci/msi.c
> > @@ -190,6 +190,8 @@ static int cf_check init_msi(struct pci_dev *pdev)
> >      uint16_t control;
> >      int ret;
> >  
> > +    ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
> 
> I'm afraid I have to ask the opposite question, compared to Roger's:
> Why do you need the lock held for write here (and in init_msix())?
> Neither list of devices nor the pdev->vpci pointer are being
> altered.

This is called from vpci_add_handlers() which will acquire (or
requires being called) with the lock in write mode in order to set
pdev->vpci I would assume.  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().

Thanks, Roger.



 


Rackspace

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