[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] gnttab: adjust unmap checking of dev_bus_addr
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 30 Aug 2021 16:26:15 +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-SenderADCheck; bh=on6IJ8bcIQNSiQqVavMkbCsM+NjUYh7qd2eyG4FO7co=; b=GAOHM/FYcLIH0vkE1PpuGXEK2LsZKTQ4j4SmkRCw62VVQ4INCv3QFQgtdLD0JCJp8wW7su0Sf19zySJGl6eU+OiYNIWn0pa+mDUnrsQX6KgkmMG0UEycg7M/GcpE40/Vl9RMNUsHSIN2JZVoPVBg649Z3WNt7yImR9NVkRw/uYfA9Cham+JJnTlV8SiYG42pNBQuS6cvsumvDLjK4w5XHlakW2UFkNaoan0C3aOtOTPz/7o2nRaDVZ4ddliTwJyRCkph+1dMsRuOQI4oeQ9rGQ8JvToEDHXpmjD+7IUgp81wB3iwz6LVLJLFPxbDGs8zAyLkD12Q5Cvbwhe2rD7I+g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LT7SIZiGZp/qk7p5m/QCz77RygU8lJ9NMlSiYL+94P/RAKh9LpB80s2JPeR2I2MgbSSrQeUVOMT9G32QIc1H9IiGapz2S5fZgYVvnCer7Ii1yUWJnVVihRefKCnz2Qdfww8ekl+y6mARHGG59zCh5E8Bcj9czJLhPBRw6zkISCLOfIyuVZEPz+n1D6gub4OxOGVXmKmibV5ALnSgpJydlwnwZnzKiGblgGUwKX/oaF52mwtMDJbUyJQ5L3oyo45u3kOH4mx28H5pSYM42VqX8soWk7rT7BstNkSmhBmBOy4jEx175Y1cBHEO81gDXHSi1REj75LMP0gToau28btd8w==
- Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Mon, 30 Aug 2021 14:26:24 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
There's no point checking ->dev_bus_addr when GNTMAP_device_map isn't
set (and hence the field isn't going to be consumed). And if there is a
mismatch, use the so far unused GNTST_bad_dev_addr error indicator - if
not here, where else would this (so far unused) value be used?
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1450,9 +1450,9 @@ unmap_common(
op->mfn = act->mfn;
- if ( op->dev_bus_addr &&
+ if ( op->dev_bus_addr && (flags & GNTMAP_device_map) &&
unlikely(op->dev_bus_addr != mfn_to_maddr(act->mfn)) )
- PIN_FAIL(act_release_out, GNTST_general_error,
+ PIN_FAIL(act_release_out, GNTST_bad_dev_addr,
"Bus address doesn't match gntref (%"PRIx64" !=
%"PRIpaddr")\n",
op->dev_bus_addr, mfn_to_maddr(act->mfn));
|