[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 3/6] vpci: crash domain if we wasn't able to (un) map vPCI regions
- To: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 16 Mar 2023 17:32:27 +0100
- 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=QE9FB3PKrGusax0VFJ15lgof7u3GvuDyqan//uxuyCU=; b=MmeO8aYHTXxl7l9W8cLyp2ksCXCC24H1H5Klzvw+fknTF9sOG3j5G42RiUMWpjVxozBKLuCMvK4OaPgX5fU+vmNAYpXm8hiLWqWWONAG9MGuu9RN24TLzuKJpHjhZ7SFmiCZAN7zpPXY0OYj+YuERYNuwcRN+gqiIEjgUCdxttD5tIPCy/sYBlc6ivkuBYuew38rNbV9OEZ5BQ9hFliYq/TIHVEuCQ1/EfBkW5bCBErti8vaGpM21meB4VNALIcYDb9gvvYGLQMau9YAR2b9xEgnpGTjKCm9rrw6X1VfdJsH37aLYMhSa1cdYERf6kJSuAMQxg1dau/toQVUfqtJCA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nvmYbKNnWbnKoD8RjK8bCHbJbmg+t1h+yik0Dpqtp4GQD9T2cLhL5HE6iuLdMW95JmgzjI5PSU+YAjbjCrV9kJBPiHXjs87pCaiFnyCsxdRtlGc1SrEEPyxJm1zqE2PRZTlRF+/WQE5UhNlsEfwpWyd7WwpmGPN1dCM1CaPgw/JLjyHPqlqJo+NUGSizBD6qMb3FRizjQnZ6O6t4qDvwioRvKRYe1wRjbcyCMEudZ4/v+ju7SbsAV+eS0ReEBD7I7gYqtdmjuKx3BbBpjmBIMxJsvoDtUEOSBGbZFm7lZXYeMVcuCsHXx+tapFu8guRKDvggcXEWvVjh+oW0LHb7hw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 16 Mar 2023 16:32:50 +0000
- Ironport-data: A9a23:JSa0I62CA4mm+TdB8vbD5fZwkn2cJEfYwER7XKvMYLTBsI5bp2cGz 2cWWDiOOPfeYzOketBxaY7k9EpT75DWztRhTFA5pC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8tuTS+HuDgNyo4GlD5gdnO6gU1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfD39vx cNJITA0YQHe2f2bxIuSeNMymZF2RCXrFNt3VnBI6xj8VK5ja7acBqLA6JlfwSs6gd1IEbDGf c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxouy6KlFQZPLvFabI5fvSQQspYhACAr 3/u9GXlGBAKcteYzFJp91r13raWwXKrCdp6+LuQ26dSm3KDhWovLQBHU1edrcSJl2mRYocKQ 6AT0m90xUQoz2SVSd36Uwy9sWSzlBcWUNpNEMU38AiIjKHT5m6xFmUCCzJMdtEinMs3XiAxk E+EmcvzAj5iu6HTTmiSnop4thu3MCkRaGUEOikNSFJd58G5+dlryBXSUtxkDai5yMXvHi39y CyLqy54gKgPickM1OOw+lWvby+Qm6UlhzUdvm3/Nl9JJCsgDGJ5T+REMWTm0Ms=
- Ironport-hdrordr: A9a23:Cwl6f6AgeIOnZwnlHehJsceALOsnbusQ8zAXPh9KIyC9I/byqy nxppwmPEfP+U8ssQIb6Ki90ci7MAXhHPtOjLX5Uo3SOTUO1FHHEGgm1/qF/9SCIVy2ygc+79 YFT0EWMrSdYmSSz/yKhzVQeOxB/DDzytHLuQ6o9QYPcegFUcBdxjY8LjzePlx9RQFAC5Z8Po Gb/NB7qz2pfmlSRtinB1EeNtKz7OHjpdbDW1orFhQn4A6BgXeD87jhCSWV2R8YTndm3aoiy2 7YiAb0j5/T+c1TiyWsmlM73a4m1+cJ+eEzSvBkv/JlZgkExDzYJbiJEIfyxwzd6NvfkmrC1u O86yvIdv4Dlk/5byW7pwDg1BLn1ytr43j+yUWAiX+musDhQikmYvAx8L6xXyGpmHbIhusMop 5jziacrd5aHBnAlCPy65zBUAxrjFO9pT4nnfQIh3JSXIMCYPsJxLZvi399AdMFBmb3+YonGO 5hAIXV4+tXa0qTazTcsnN0yNKhU3wvFlONQ1QEuMaSzz9K9UoJu3cw1YgahDMN5Zg9Q55L66 DNNblpjqhHSosMYad0FI46MLuK46z2MGPx2U6pUCra/fs8Sg7wQrbMkcoI2N0=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Tue, Mar 14, 2023 at 08:56:30PM +0000, Volodymyr Babchuk wrote:
> In that unlikely case, when map_range() fails to do it's job,
> domain memory mapping will be left in inconsistent state. As there is
> no easy way to remove stale p2m mapping we need to crash domain, as
> FIXME suggests.
>
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
>
> ---
>
> v3:
> - new patch
> ---
> xen/drivers/vpci/header.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
> index ec2e978a4e..8319fe4c1d 100644
> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -162,14 +162,11 @@ bool vpci_process_pending(struct vcpu *v)
> rangeset_destroy(v->vpci.mem);
> v->vpci.mem = NULL;
> if ( rc )
> - /*
> - * FIXME: in case of failure remove the device from the domain.
> - * Note that there might still be leftover mappings. While this
> is
> - * safe for Dom0, for DomUs the domain will likely need to be
> - * killed in order to avoid leaking stale p2m mappings on
> - * failure.
> - */
> + {
> vpci_remove_device(v->vpci.pdev);
> + if ( !is_hardware_domain(v->domain) )
> + domain_crash(v->domain);
No need to remove the device if you are crashing the domain, so the
vpci_remove_device() call can be placed in the else branch of the
conditional.
Thanks, Roger.
|