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

Re: [PATCH v3 1/1] xen/pci: Install vpci handlers on x86 and fix error paths


  • To: Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 20 Oct 2021 12:27:08 +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=5IyDp+stLFzCj8UtIhdvIq32s5l76V2yUjZdHjCCAWk=; b=GZtkFqZ0c58/ijufcMih068FyrqkWwwRJYsRwwFEBY/wnnE1PA2wWyF4TR6uwSI02Umg/YXOxU3upV7kpQyZzMI5q+SuqCreueEj33bU1muRDmHKUjZSZV2T60OwAKSZbn04gFp73d34D8zptDl7TYiiIf8MB/e8Snq4p+Xhd6fUFuZHmlGxCgUcCaQWEraDnLbw8xyNjDCBplaGAdLvIryXGOaAhpZyc/MK98sfWgCZA4pDswSRyMa5V6DBrW8Fo2g3Kd6G26Ff888sETyTdzM+ezAurU17nG+Lily7HBVO+pr+RGsuA4tLS40krIbVtv1JjmjCgKOHEKKKhKwmAQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KyEbiE5LvwzlYl+oW/AEnl1/S5IUObS42Fbbb27oagUW/4I30C5aYHcuvRxRWgX7acrbUI8AWyGYX2ZbZmtLvdA0/UYTow5pJFaSSnDhbaHJl8ZDRFyBDqMLjUDigTpkL/BKjeXwxgmjgngO8CeFoP42iai4Ppa7E9YE2ugWH2O8ghGuPx4dRA/QwmsEKkSevSG3toggPVvIE6yX0EkG+xOByIJYJ0sjEEeREugo0mx9ggpUJw/KGI8XNrcE10xj3Jry7INBIr2A9DwUVAKWdzv/OqdtD1Ns8lv3Of79aHSqXMvhhcYhwuz5PbCRDkcubgFPzldYEee3mYeYv02c1Q==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <iwj@xxxxxxxxxxxxxx>, <Oleksandr_Andrushchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Wed, 20 Oct 2021 10:27:58 +0000
  • Ironport-data: A9a23:qfEG1Kt6F0ESNevFN+5QQDA9iOfnVFJYMUV32f8akzHdYApBsoF/q tZmKWDQP/2IM2rxc9wna4zi9h4EvsfTy9ZqTVE5/3pmRCsX+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZQP0VOZigHtIQMsadUsxKbVIiGHhJZS5LwbZj29cw24DhWmthh PupyyHhEA79s9JLGjp8B5Kr8HuDa9yr5Vv0FnRnDRx6lAe2e0s9VfrzFonoR5fMeaFGH/bSe gr25OrRElU1XfsaIojNfr7TKiXmS1NJVOSEoiI+t6OK2nCuqsGuu0qS2TV1hUp/0l20c95NJ NplnoyWGCYLB67wo8cHYSZHHAhTY/Fv0eqSSZS/mZT7I0zudnLtx7NlDV0sPJ1e8eFyaY1M3 aVGcnZXNEnF3r/ohuLgIgVvrp1LwM3DJoQQt2sm1TjEJf0nXYrCU+PB4towMDIY250QR6mEO pFxhTxHZg+bXR9+GUYrKsgjosGouyHgXCN/twfAzUYwyzeKl1EguFT3C/Lrf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//6puNFost8V3P2lqQUhoh+2nH1BOBU 0xB3fGheVWw+nZ68Dg13Shzge3nkc63gjQEmtKzrfHUB1tSlOJ/aNhVUUqJbqNM5kR3RljF1Pr jldyUZeYqTEdgKJtmbAkjouy
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Oct 20, 2021 at 11:05:37AM +0100, Bertrand Marquis wrote:
> Xen might not be able to discover at boot time all devices or some devices
> might appear after specific actions from dom0.
> In this case dom0 can use the PHYSDEVOP_pci_device_add to signal some
> PCI devices to Xen.
> As those devices where not known from Xen before, the vpci handlers must
> be properly installed during pci_device_add for x86 PVH Dom0, in the
> same way as what is done currently on arm (where Xen does not detect PCI
> devices but relies on Dom0 to declare them all the time).
> 
> So this patch is removing the ifdef protecting the call to
> vpci_add_handlers and the comment which was arm specific.
> 
> vpci_add_handlers is called on during pci_device_add which can be called
> at runtime through hypercall physdev_op.
> Remove __hwdom_init as the call is not limited anymore to hardware
> domain init and fix linker script to only keep vpci_array in rodata
> section.
> 
> Add missing vpci handlers cleanup during pci_device_remove and in case
> of error with iommu during pci_device_add.
> 
> Move code adding the domain to the pdev domain_list as vpci_add_handlers
> needs this to be set and remove it from the list in the error path.
> 
> Exit early of vpci_remove_device if the domain has no vpci support.
> 
> Add empty static inline for vpci_remove_device when CONFIG_VPCI is not
> defined.
> 
> Add an ASSERT in vpci_add_handlers to check that the function is not
> called twice for the same device.
> 
> Fixes: d59168dc05 ("xen/arm: Enable the existing x86 virtual PCI support
> for ARM")
> Suggested-by: Jan Beulich <jbeulich@xxxxxxxx>
> Signed-off-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks!



 


Rackspace

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