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

Re: [PATCH v2] libxl: Fix stubdom PCI passthrough

  • To: Jason Andryuk <jandryuk@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 12 Aug 2021 08:18:50 +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-SenderADCheck; bh=OmTiY1w5jVT0tuKdZpAX6o+y1qfIcJz67cooNmJd/DY=; b=YWJCwAd8GrXTKqR4sjoDIzXtBEW9z6R/1xvkPFOABMA+CZrGiVVraN5iheaVheyjIW9Jv75vMJZVNjcmWa2ritIg7yR0ahNYLhAj/uGMi6wRrrYsAoyzIowQ10TfjF5qPgPh2o5x9ucEQElWd4WYkapNZxjhVg+e3Uru9Gk6f9Qy6cBtkG4u5qJbHjQ5rbOodTa8lFKa+o+ktrU7oyOt/JoM/Fj6/YY4T9PiVfkQPnxrxzInZ0FQDyEosPn+5/Clenm3BKcboWE1F2xzLmvvlzzSGdFj3JdIi6Jgjhxh6nohB93ctY7X17lyEhITtYoU04v8vVQQ8rz8og2ESIHuHw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F+8mVmcGrlbtdF4YaLofOQincWPdOGbmCD99zMHdHPWyYbvI/tM+XPstYCg+T+JjumSaYkSQaNB4StE233tJ4ZNuwXvBSc0S6Xo+ahaq/3RZjocLaPoTRZLnfJyz0tJRlbZSbGUZbtrHkCZLywNnnHYnVd1KgwOq0JhD8DQptisu5l3bGnC/yvlo7y3AjxQ/fMIcwBBLs05HMc38YIQJGewSNBr1TM6utU4ws4z9gkwYHJQHeypTH5XBJIHBm8nP09ljVkltj5yshWr/2PZEnzVOGAd7ki5gPT+2N6/Twtz7D0mnI1D5c0ybm+cCIOA2e4D8dPUfutH9+85cvcUQnw==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: pdurrant@xxxxxxxxxx, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 12 Aug 2021 06:19:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.08.2021 02:57, Jason Andryuk wrote:
> commit 0fdb48ffe7a1 "libxl: Make sure devices added by pci-attach are
> reflected in the config" broken stubdom PCI passthrough when it moved
> libxl__create_pci_backend later in the function.  xl pci-attach for a
> running PV domain may also have been broken, but that was not verified.
> The stubdomain is running (!starting) and PV, so it calls
> libxl__wait_for_backend.  With the new placement of
> libxl__create_pci_backend, the path does not exist and the call
> immediately fails.
> libxl: error: libxl_device.c:1388:libxl__wait_for_backend: Backend 
> /local/domain/0/backend/pci/43/0 does not exist
> libxl: error: libxl_pci.c:1764:device_pci_add_done: Domain 
> 42:libxl__device_pci_add failed for PCI device 0:2:0.0 (rc -3)
> libxl: error: libxl_create.c:1857:domcreate_attach_devices: Domain 42:unable 
> to add pci devices
> The wait is only relevant when the backend is already present.  num_devs
> is already used to determine if the backend needs to be created.  Re-use
> num_devs to determine if the backend wait is necessary.  The wait is
> necessary to avoid racing with another PCI attachment reconfiguring the
> front/back. If we are creating the backend, then we don't have to worry
> about a racing reconfigure.

And why is such a race possible in the first place? If two independent
actions are permitted in parallel on a domain, wouldn't there better
be synchronization closer to the root of the call tree?




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