From patchwork Wed Oct 25 09:27:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 117039 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp628244qgn; Wed, 25 Oct 2017 02:29:24 -0700 (PDT) X-Google-Smtp-Source: ABhQp+R+XxuOlgbxKeRwszzZLQp4hDb87NjwmnnU/wWT6qcqSa28koaj7PCM8lfnwWpcM6fJsifw X-Received: by 10.36.103.134 with SMTP id u128mr1156142itc.2.1508923764758; Wed, 25 Oct 2017 02:29:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508923764; cv=none; d=google.com; s=arc-20160816; b=FKbCpiDrpjA0zWQqceelYlQ172xWlVc3L+krw8VZcWRxcb70+RftN7ol3HniGw9kc4 9ZSYuSRzpdMlpGPoAUBMUKt1CI0/Zr4CDw/EtSy4daKciKgKjGCr3SEd8oIKP0rSTGY3 U9jAFWB+M9/lyvM42r55lfZW/hwY4ZKRUgF1E+6SuqD2Wf5a9E517gYfjpCf41/EPToh A8U93uLSvIao9vGyZw2B/V6rJB4L+JwEmpjDLJAY+zGB2PzP2CkGAkVhjswwV2ey9hQb BCcF7fdlf6rBBIV5pe56TUIhEm3eY+f9ZoDtQQ22JCgzFT2k9BgzkmYTIZV6Y0w81JgD FRVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=Mj8o2N/YcfuZAtWNPGCPGeWAbsrhPnFWNEq93zoe0yU=; b=mT7QHlg2mqyyZJKcDyrLo4zkm6U9L6SuQ9NLN1TshW0QtvUmXpyDsFOkjPU2dLnT28 dop+Ptwnc37/3pPxBcqlhbWuCC3qOuL84MMHM0pliui1kbuW/13LL2YQetY02Qk0UZzC MbcylquRadKhNAHDZhpTCJpX6AfAriLnJyW232lculLr76pkbXKnDjyym3W6Mfpyggn5 2kPkSbv3OhOwyQEM0Ox7S49r3iNRzYiodfnv5goXtn6wa2YU9uTRrT9gupLjDSKlmRmZ TSlMXurecrLQhK36FFVLVYa+PrVDP1fuLiNpkCVTWWCqLl2WJC+ByVyR1iSexzVGnyF5 mQMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OZDrRHbz; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id g82si1594123ioa.256.2017.10.25.02.29.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Oct 2017 02:29:24 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OZDrRHbz; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7HyC-0003fN-18; Wed, 25 Oct 2017 09:27:28 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7HyA-0003ex-CS for xen-devel@lists.xenproject.org; Wed, 25 Oct 2017 09:27:26 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id B5/27-00983-DF850F95; Wed, 25 Oct 2017 09:27:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCIsWRWlGSWpSXmKPExsVyMfTAQd2fER8 iDf4sNrP4vmUykwOjx+EPV1gCGKNYM/OS8isSWDMWzv3MWvBUsOLwg8VsDYwXeLsYuTiEBGYx SnzpuscI4rAIzGOWuPprLyuIIyHQzyoxb89Zti5GTiAnT+L66j2sEHaaxMV5m1gg7HKJ+XPaG UFsIQEtiaOnZrNCjG1hkujftY+pi5GDg03ARGJWhwRIjYiAksS9VZOZQGqYBeYzSjRN6gVbIC yQJPHi8CMwm0VAVWLCrHlgC3gFvCW2zmphglgmJ3HzXCcziM0p4CPx6eZkJojF3hJXvi1gnMA ouICRYRWjenFqUVlqka6xXlJRZnpGSW5iZo6uoYGxXm5qcXFiempOYlKxXnJ+7iZGYMgxAMEO xuYvTocYJTmYlER5wz0+RArxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4I0DhrCQYFFqempFWmYOM Phh0hIcPEoivEkgad7igsTc4sx0iNQpRleOC3cu/WHiOLbpMpA8sOcWkOy4eRdIPpv5uoFZiC UvPy9VSpxXC6RZAKQ5ozQPbjQsci8xykoJ8zICHSvEU5BalJtZgir/ilGcg1FJmLcYZApPZl4 J3AWvgI5jAjquSRXsuJJEhJRUA2OryMIs7nunTD4Hqdt4ylvcOdu6j09k2lvnpUfs+G8GN03f pXByHuuHm20mp1bvSLvz59Wn1lvNJy7kK90UtWSM9lvfV+cgk6W27vj8/7d1bZxPe8Y4lJW2m vaWHH3v8/T2jKAlWzXzHCV0JimVTXQ5uvf4PQtGiwNBkqtSJ3xsTNluteiDl58SS3FGoqEWc1 FxIgDhB/8J1wIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-7.tower-31.messagelabs.com!1508923640!104322829!1 X-Originating-IP: [209.85.192.193] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 55918 invoked from network); 25 Oct 2017 09:27:21 -0000 Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by server-7.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 25 Oct 2017 09:27:21 -0000 Received: by mail-pf0-f193.google.com with SMTP id b85so21779033pfj.13 for ; Wed, 25 Oct 2017 02:27:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MbJnOrhSN4dms97WXwW1NxXA95YIfRoF4gRBCjPvfjU=; b=OZDrRHbz4lpJNidquOJ83R61IIpNJtNRVfephuMmcCrrrez6UJ1pzxLJ0/rMaFt+Ow LtX6FB5fLuUKqBs24h8pC9mo0bR4EKBS0+i+tc4Pl0yn3GBuYdgwTnbH8D0Ga/NPArfn aoEK1v4LKDACfZ8+UmRcGpudCSXyzXfpw1uBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MbJnOrhSN4dms97WXwW1NxXA95YIfRoF4gRBCjPvfjU=; b=oVw10aXR3o6Fqs1t6U9zde21qPYiuvo/frC8Eu7WY1Xxxnj5CgQDJhRq+PmkDqosEi q3AsBi6IGPEKj1lW3j28XT14RDqBPejJIPCyPbACMY9cxZyRb7I/LVWW4AQ/ahRDXXeJ Sz2fXtSRJPNU/YHp+ZL2AE9kgw0miMSTpqSVTTb7MZ9NjKVT6nqcRG2wEvPshn5eJZvY fumYxzwTCZbIY2b23J68wKE5lpVJciZmp+6iXWCr+2Gscn8zclnbCruR5ihhDq8+KTsf oSIXvxxTrXxlgOrg0mVW8mN5wbxylFZDYVa793wEx9W8Id0Mxr3D9DmeE/asO+sUwzEa vQjA== X-Gm-Message-State: AMCzsaXA6ynngrzriedBG6TNKCHizQriTka5y2sNiMn9MHiMT2BDkqRd o2u2FfRYIqUVlEJpnSPsmykJhr4ILeY= X-Received: by 10.98.21.86 with SMTP id 83mr1608167pfv.290.1508923640186; Wed, 25 Oct 2017 02:27:20 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id m17sm4022861pfh.28.2017.10.25.02.27.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 02:27:19 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Wed, 25 Oct 2017 14:57:06 +0530 Message-Id: <1508923628-26446-3-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508923628-26446-1-git-send-email-bhupinder.thakur@linaro.org> References: <1508923628-26446-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 3/5 v2] libxc: Fix the data type of mfn parameter passed to xc_map_foreign_range() X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" Currently the data type of mfn parameter passed to xc_map_foreign_range() is unsigned long. This could be problem for 32-bit arm architectures where the lengh of long is 32 bits while mfn happens to be a 64-bit value. To avoid truncating a 64-bit value, the type of mfn is changed from "unsigned long" to xen_pfn_t. Also the parameter name "mfn" is changed to "pfn" which is a more accurate indication of what this parameter represents. Signed-off-by: Bhupinder Thakur Acked-by: Wei Liu --- CC: Ian Jackson CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall This patch is as per the review of commit fa1f157 libxl: Fix the bug introduced in commit "libxl: use correct type tools/libxc/include/xenctrl_compat.h | 2 +- tools/libxc/xc_foreign_memory.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/libxc/include/xenctrl_compat.h b/tools/libxc/include/xenctrl_compat.h index a655e47..5ee72bf 100644 --- a/tools/libxc/include/xenctrl_compat.h +++ b/tools/libxc/include/xenctrl_compat.h @@ -26,7 +26,7 @@ */ void *xc_map_foreign_range(xc_interface *xch, uint32_t dom, int size, int prot, - unsigned long mfn ); + xen_pfn_t pfn); void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot, const xen_pfn_t *arr, int num ); diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c index 4053d26..c1f114a 100644 --- a/tools/libxc/xc_foreign_memory.c +++ b/tools/libxc/xc_foreign_memory.c @@ -33,7 +33,7 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot, void *xc_map_foreign_range(xc_interface *xch, uint32_t dom, int size, int prot, - unsigned long mfn) + xen_pfn_t pfn) { xen_pfn_t *arr; int num; @@ -46,7 +46,7 @@ void *xc_map_foreign_range(xc_interface *xch, return NULL; for ( i = 0; i < num; i++ ) - arr[i] = mfn + i; + arr[i] = pfn + i; ret = xc_map_foreign_pages(xch, dom, prot, arr, num); free(arr);