[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 3/6] vpci: crash domain if we wasn't able to (un) map vPCI regions
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Date: Tue, 14 Mar 2023 20:56:30 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=bujiMIeI01tpfNGAxOt9A1TohJ0brfLaSY560ql/6y8=; b=ZcKZPIYzvjg3a+xuzBXN9aGpneT1iz6/fZq+mxyxa9YGVAItEWeYY1NLE0mMrgCOVxgrbx0TN82Vxxcj3IsH9oPtvcY+qlnDq/q1RdbvKVU9c4AnJEXu28uexFQPmRXI6AwYEhLNE9DTMjQ1aw3c5hAqWC38cF13WR4BJ4DGlEry/cuAcgHAD7UngKrQrjv1gdvABrmoaIs+mtzIa06juDL8zxqF8DhQjN2WRwXpSfdbwKmLImNXJjC2LdipW/SiUH6JuWJijiaEVDu3+y/q4KM42DyHZwAw14msDPjmjrL5popYL85mUbHpmhpazMUBCXd8tqcLsMhcKxbg9SErdw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PQDEFzFQEctIMciwl+OzILvSR+CtxdwKClPvqkzCdH+oDsbR9ODNhE8AncllQnO8TSsW/yZq+NotDcTmu2ybRbcGf2+PFWXDusjKKJOVzlT6LNkcytQ2Z+cVSqIUQSAMI6oUW6wfxrDROeeoKX7UHO1rytiTm1846btTwvuhwz1b1eQS9CkbUqNsa/otfhF40hbd+mru89BHYXDTG0ssSImnBMNrhT/Yew/ne3ka/Gwjd/3GICVvkxsan+rnmtwjZcJUT3Ulm/oQ0eLT/Hg4/jafJUd6SGrgGCS3RqHmqT+Du49cdLShBOtnQuq/sc0mIjwYUdcBwTMWgAWY0r+kNg==
- Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Tue, 14 Mar 2023 20:57:05 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHZVrdzRVfDuhWpnEqbBuMRX+vTVw==
- Thread-topic: [PATCH v3 3/6] vpci: crash domain if we wasn't able to (un) map vPCI regions
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);
+ }
}
return false;
--
2.39.2
|