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

Re: [PATCH v4 3/6] x86/PVH: permit more physdevop-s to be used by Dom0


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 22 Oct 2021 12:17:53 +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=sxuHHN9Arm1v4Q9NZNZy/rQ5hYYMUHQICf84d246qtg=; b=Ypu4NgfHLd/uQsHn6EDwpsFxqzbhJul5htS2FKG5rF1OFAS+6mBkYTZ2mtMGVWrsXWpJci0lfcCuVltZjaLGyPW5dz0nNyA9w0weHnJgbOI848wxRcvslfp3xPYKRVmUcbmNm9BxqPFDjhRZskWvgKv9pEQgS2/gonLYjQEikpz7jLuVJiHcZiesaTy8a6MXPMc1lMqgBUuzK6qo8YKgCI7cqnkaeXQIHnRQ6Y1tQctS0zSniTMDauOyrDOoR20+XJfrpAfbXCILRTsfLS9LtxTO8lEfKRS0x4S94mUhW3Z48zpkRmJN0u0JFWCto8WG/BOnVdbt1r9lF9xpIdjUdA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RS+fCqgCyGg5zF1LTtOHNouGsBp1hBzQ/+htTea7YsLwFgE/6wlzv8vKX4MfrrgHS80eaJyMcEHR731K3xuRZwWKdJu4tsLsu6/k1m5elXHKDXxfkhGOSg6VbZ4KdMEfOnJ7Eg6zCaPpwuvvQz5p7+REykTHm0NrflHFCYdoJBYcZK0UxNg1PtZJhMoCpzAAJkTFzu19iAwEBdxZTT4BTSbYyKs2GD0Zctgxcg8lgxl3G8EQLtsM1Mvq/grlAZdszHW0O76f15smspvTz0VXhFxLAYHmSEfs824llSMmuraWg14dmridZXOwdguCrl7KK+p35dcX21PcGE3FvF8RLg==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 22 Oct 2021 10:18:14 +0000
  • Ironport-data: A9a23:y7zm7qsM3UmkQZY0LPmInAaSA+fnVI1ZMUV32f8akzHdYApBsoF/q tZmKTiEbP2MY2CjfNFzPI+0/BhT7JTUydc3SVdlqi9nFC1B+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZQP0VOZigHtIQMsadUsxKbVIiGHhJZS5LwbZj29cw24LhWWthh PupyyHhEA79s9JLGjp8B5Kr8HuDa9yr5Vv0FnRnDRx6lAe2e0s9VfrzFonoR5fMeaFGH/bSe gr25OrRElU1XfsaIojNfr7TKiXmS1NJVOSEoiI+t6OK2nCuqsGuu0qS2TV1hUp/0l20c95NJ Nplia6yaTgiDLbwl+lHS0JfKDpEF/xl0eqSSZS/mZT7I0zudnLtx7NlDV0sPJ1e8eFyaY1M3 aVGcnZXNEnF3r/ohuLgIgVvrp1LwM3DJoQQt2sm1TjEJf0nXYrCU+PB4towMDIY258RRq+AP JFxhTxHUEqZXT5CJkwtLJcQw92Vu2fjMBBlpwfAzUYwyzeKl1EguFT3C/LKfvSaSMMTmVyXz krW8mK8DhwEOdi3zTue7mnqluLJhTn8Wo8ZCPu/7PECqF+Zy3EXCRYWfUCmuvT/gUm7M++zM GRNpHBo9/JrshX2EJ+tBHVUvUJooDYgadhwLOYI8z2Cx/DMuAGiHVIuHx1oPY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zEnrv5an854Ed3AUV0gK1XYeNu/0KDwTeOEQbqBJaK Z0q/A37AaISDAyVICWF3MFV+/Mq5nik4/nWwcPA1oC5BOVhT2lxbbmG1zAty1uHg9n8PMHyy zoggb57qKsv7WSzQLd7Xba69BzlMH6wtVOKcSQgow+KynqiCyveIN9Mofy9gwdkaWK0hIHgd PMqxAvM4Ba7G7QRHi8pV/X1wzpwF8Vmgnf4G7dpUGmjd3yRTo8BcYEr5leaAHl500pu8w5+L 5X3kqC3qAnQy/orWDY3ZzlRhtqnk27rT4JiugIlUFSVoMYdft4sZEfxkVIC50NdRiKp7zPKN MeTP002cwmMm9zNxvizytSKZ2XLzgO9y69Mwk/Upf/6UkSoJh7p3Fos/D30E1wsK7VcKM0lN gsBJ4Y4I2mfvVmHZ6VO91xM/dfKla9CC4kY1jiaWgOKsk8SgfwQtjMkfII2N0=
  • Ironport-sdr: 3sZh67wHG9cgODIgrX50v550rXfpvBu4/Wr3NfKvgOEeoO6qFuo126ehEVvgXrGNbTQXIfmXFY B+r0HD1koYumc05RD18PVRPxdGbC+0FiWvjKubnpgcOKbit96B55QTcw4z/iMIuabi1nOo8VXv J9N9gFYyq/JgWCRZeyqAZ2uZYUE3mYMsUPZ+7oFiNh90ZliJcjsZiAeRkx/fr2xrTON9+d8nsq KW2e7lUf1y6Os9U9jq3Ej0l+sXWoqfLFvBAr3jA1AHd2027Rla8SrTsEyKSAV7ce7Oob8InvrO VqxdriVROumPKETgUqWXaf9c
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Sep 29, 2021 at 03:14:13PM +0200, Jan Beulich wrote:
> Certain notifications of Dom0 to Xen are independent of the mode Dom0 is
> running in. Permit further PCI related ones (only their modern forms).
> Also include the USB2 debug port operation at this occasion.

Sorry, I realize now that I failed to provide a reply on the previous
patch.

> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> I'm uncertain about the has_vpci() part of the check: I would think
> is_hardware_domain() is both sufficient and concise. Without vPCI a PVH
> Dom0 won't see any PCI devices in the first place (and hence would
> effectively be non-functioning). Dropping this would in particular make
> PHYSDEVOP_dbgp_op better fit in the mix.

I agree, it's not an option to have a non-vPCI PVH dom0 anyway, and
the important restriction for those operations is the hardware domain
part.

> ---
> v3: New.
> 
> --- a/xen/arch/x86/hvm/hypercall.c
> +++ b/xen/arch/x86/hvm/hypercall.c
> @@ -94,6 +94,12 @@ static long hvm_physdev_op(int cmd, XEN_
>          break;
>  
>      case PHYSDEVOP_pci_mmcfg_reserved:
> +    case PHYSDEVOP_pci_device_add:
> +    case PHYSDEVOP_pci_device_remove:

Those are indeed fine.

> +    case PHYSDEVOP_restore_msi_ext:

While I understand the current need for this one in order to possibly
restore the MSI interrupt for the serial console, it might be a
cleaner approach to let dom0 restore the PCI state on it's own using
the native methods like it's done for initial setup.

I realize we are missing a bunch of stuff here, for once vPCI state
should be reset and put in sync with the hardware values after a
restore from suspension.

And then we likely need to either limit PHYSDEVOP_restore_msi_ext to
just restore Xen used MSI vectors, or if technically possible it would
be best from Xen to setup it's own MSI vectors when restoring without
relying on dom0.

> +    case PHYSDEVOP_dbgp_op:

This one is also fine.

> +    case PHYSDEVOP_prepare_msix:
> +    case PHYSDEVOP_release_msix:

Those two again I'm not sure should be added right now, as we still
haven't decided how pci passthrough will work from the hardware domain
PoV. I'm explicitly concerned about those two because they will mess
with the MSI-X state behind the back of vPCI, and nothing good will
came out of it.

If we really need those two in the future, code should be added so
that vPCI state is properly updated.

Thanks, Roger.



 


Rackspace

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