[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: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 20 Oct 2021 12:28:38 +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=aaQclbOfoQtGYQAytwUkuyo6xuuvjSo3FjzBsYvMo8U=; b=k8bmdG1oah66Sa7oMndHTzbe+p7sLwUQZPiNtAAD49yUWymEMdM8xiGc086F17Kn16xAgDZmexa1JycJWHHeiYe50pxaReG1cjhV5GcABPTpGRGLLIZLh1nLBdjIDL/AV0FXv83C6+4vs8Kry1QpRCNI/zQ85TzH19yCmJR6mPSVH7cz2yo5oBZ7KXw/brEtPVZkuhCJsiiacnSLeQ+380q1XS58MHxURirosfg/0MqjXsH2wW1endrdWRttC+5+UZyqGQBitqWvEqYHcdSE9bS+ofe591KjCF0Qtt/C4HxgPrto3AH072RhRoiBW8KqVdX7hS3ebAE0auqi2YGeTg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JHvVMQiS2CGeH1dlBTZ2zjEfCP5ey8W4c8uqJ66jvMcSmysMrPyozm+s7u+0+Zbw/Et/xiSFR8EH1OWh/gxF+xQ+zlb/roFwNyVNfRiymSXCxp+5t3BZ+UTEmtN5olEXj2qVq9QvVHBGU0HpmA6f4jBhvIAYHv+cfNHI3qiNA3X6SkFPAEVkydqWHG29pNyHXKq9k4TgADygaDb/FG6VIVfZau+b0HPgZYwli72iuAcTZ4fifZEaDH4OBZiIoFBGcvKJEN9RnjkIWgCmjaoi+2JiUmdAl1m+WgR1yY6sijKFhp7yCjYKZIzSg3psKi/uWrw5UnGm5Pr9f6ui8abqBw==
  • 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: iwj@xxxxxxxxxxxxxx, Oleksandr_Andrushchenko@xxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 20 Oct 2021 10:28:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.10.2021 12:05, 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>

This looks to address all review comments, so
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Thanks, Jan




 


Rackspace

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