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

Re: [PATCH] [RFC] xen/vpci: modify pci_get_pdev_by_domain() & pci_get_pdev()


  • To: Rahul Singh <rahul.singh@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 9 Aug 2022 17:15:00 +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=CEjsAV+hPmvUmvQeU8zd98n8DEcdmdh6CIw4GL+C9RA=; b=lqqjtlC30X89bGrnyl20vABcN9Kn08tpft6xX7uToem6PgYPwQ4tiUTTqZ4brv8uufrdBpFRXvmFRZd1im6vfg34vUj3BJ7mwoxvkfPp0a9oorAHurdldwX1EXMnO22nFuXpAKOqE7jAXkIGRd6J5Tj68ncVSlKCmYndlzaPd1tngW+J5VtQKvZKzg11zgSJGeTuLAY1KNyD09cvTTwYkIJPz7XM2owcBeV5ji7PYyktgvw0AjUR10rmC2ubz1BSgiZbbRYuaGjLtuN8qjX2DZ2JPIIoupGUG6u6W397LT7gQlXt1DHseHCB7s3KY99p3IS1yIxoppQtnykPulTl1g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JJRd89r6X6RMxhEDbipIPEorq6cEaa7X7aJA4C67z/Wm0zc/RDUC4OTHCPwtMJwcM+BW6So6/u0cGwqNI7QvP8oGM4f63ZP5PLLNBT+z4VeqypB9uvfc1gYtlgodalw4Fgg2Fy/Xe1eArGIpHDgzp85+/mroT58spVF7lnmkBpLa+paRFCixvlCURcGCLHacyPtmVGWL+kFZD6JXKMOthqQlnVjPx32DTtytjACzwyxWA759YrAAw/hMxDKvNPMS2FTihBveo6cpgraQN6/zS848sU2vNQnY4Kwfwk70ynWv+Xu20Gsh1ZYS2A2rbcF0qwGsdjSNxM8brTJsTCGEOQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: bertrand.marquis@xxxxxxx, Paul Durrant <paul@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 09 Aug 2022 15:15:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 05.08.2022 17:43, Rahul Singh wrote:
> pci_get_pdev_by_domain() and pci_get_pdev() functions find the pdev in
> the pseg list. If pdev is not in the pseg list, the functions will try
> to find the pdev in the next segment. It is not right to find the pdev
> in the next segment as this will result in the corruption of another
> device in a different segment with the same BDF.
> 
> An issue that was observed when implementing the PCI passthrough on ARM.
> When we deassign the device from domU guest, the device is assigned
> to dom_io and not to dom0, but the tool stack that runs in dom0 will try
> to configure the device from dom0. vpci will find the device based on
> conversion of GPA to SBDF and will try to find the device in dom0, but
> because device is assigned to dom_io, pci_get_pdev_by_domain() will
> return pdev with same BDF from next segment.
> 
> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>

Actually one more thing: While you're working on vPCI as I understand,
the subject prefix here really wants to mention PCI, not vPCI.

Jan



 


Rackspace

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