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

[PATCH v2] vpci/header: cope with devices not having vpci allocated


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Thu, 25 May 2023 16:54:05 +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=+7lYlhK5AwmL/nNaSMu10HnFnCudJ9cJnJ6lzC2Kzwg=; b=SCnbPMYJth3NZCKNihCUOdWEBK8NdU5WkzhK6YE8pjykAzgIvx5F3QJktZkjbKiV1PoCjugDQ/KaZie7lmVftCS+aY76cTxfyIhOrGZfHmvUVCQC2pnohumoAnEyPVnZr6OMRSq/cdZGLGDHyP/82JD/tk2v0p/YyeCredZbIciBXQIicyUJ0LdKyLjBvLirHMMaRC3VlxtC6Z6kOy0Pkvy9nQBJe7OP1wiLce8JdC8l9Vd9jGEuNAWvyTm70pU5tiUt5uYDfNa9b7BYSIluNWb6JejuBkQpgVL9wZuS5pKZIrWvZY37iGF6ksJzrhRQ6Qx0HMypuRD1SY5BtIHb9A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ahwcnJP1mTEv4Dl7J5kvEQWlU6eIzP6LMQurKpcEz+M663alUno6mZvJpbjiSnTY93EVVd3GmGlObCn0q5qv8GMoLVfxHbYd9BFn+NvDfR0G9DsITNhdNRpw2KJl1fYgbmZkhx75ltZ3wIdrYmxDe91tEqq0PHRYnkU2qrKJetHzxAw45exaPgyvhAX1d/pnF7KrL0ngBWrJAefm4q7GdRkQIvgDlIhIY/1sh+A8P69l0Si+QeWXUPGSlBNulmcuVjSE1XNvZz0aRR6RonmARJ4aisz6bu0XWd3GCNGOgagQO+eyF2WSkWiN7UBvutL6T8IzE2fUne7RGsaPsZ8M4Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 25 May 2023 14:54:34 +0000
  • Ironport-data: A9a23:GKHAjKpFbyx1jW/U3EEHVXy5ViBeBmIZZBIvgKrLsJaIsI4StFCzt garIBnUM/6JZGL9ct8jOY2+909T6sfXydJrTAE6/3g8Q3ka85uZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GtwUmAWP6gR5weDzSRNVfrzGInqR5fGatgMdgKFb 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay RAXAGAsSRrY38C9+pbhEcdclMQ/HZC2E4xK7xmMzRmBZRonabbqZvySoPV+g3I3jM0IGuvCb c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3j+CraYKJEjCJbZw9ckKwv GXJ8n6/GhgHHNee1SCE4jSngeqncSbTAdtKTuzkq6cy6LGV7nAuBS1VcQu7ncKGlVSxRdlAF U9KwwN7+MDe82TuFLERRSaQsHOC+xIRRddUO+k78x2WjLrZ5R6DAWoJRSIHb8Yp3PLaXhQv3 16N2tnvWjpmteTNTWrHr+/I6zSvJSISMGkOIzceShcI6MXip4d1iQ/TStFkE+i+idid9SzM/ g1mZRMW39075fPnHY3glbwbq1pAfqT0czM=
  • Ironport-hdrordr: A9a23:hsfhPqwI98zTqqmPa3HEKrPw2r1zdoMgy1knxilNoHxuH/BwWf rPoB17726TtN91YhsdcL+7V5VoLUmzyXcx2/hyAV7AZniAhILLFvAA0WKK+VSJdxEWtNQtsJ uIG5IUNDSaNykfsS+V2miF+9ZL+qj5zEir792usUuEm2tRGtBdBwQSMHfqLqVvLjM2fKbQjP Cnl7d6TzzLQwVuUu2LQkMrcsLkvNPxmJfvcXc9dmIaAFnnt0LS1FbieSLopCsjbw==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

When traversing the list of pci devices assigned to a domain cope with
some of them not having the vpci struct allocated. It should be
possible for the hardware domain to have read-only devices assigned
that are not handled by vPCI, such support will be added by further
patches.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Changes since v1:
 - Do not mention domU plans.
---
 xen/drivers/vpci/header.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index ec2e978a4e6b..766fd98b2196 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -289,6 +289,14 @@ static int modify_bars(const struct pci_dev *pdev, 
uint16_t cmd, bool rom_only)
      */
     for_each_pdev ( pdev->domain, tmp )
     {
+        if ( !tmp->vpci )
+            /*
+             * For the hardware domain it's possible to have devices assigned
+             * to it that are not handled by vPCI, either because those are
+             * read-only devices, or because vPCI setup has failed.
+             */
+            continue;
+
         if ( tmp == pdev )
         {
             /*
-- 
2.40.0




 


Rackspace

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