From patchwork Thu Sep 28 10:24:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9975731 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8C041603F2 for ; Thu, 28 Sep 2017 10:27:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B46D29554 for ; Thu, 28 Sep 2017 10:27:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7022A29558; Thu, 28 Sep 2017 10:27:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F2B0129554 for ; Thu, 28 Sep 2017 10:27:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxVzn-0001CW-Rh; Thu, 28 Sep 2017 10:24:43 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxVzm-0001C4-D6 for xen-devel@lists.xenproject.org; Thu, 28 Sep 2017 10:24:42 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id 66/B5-02044-9EDCCC95; Thu, 28 Sep 2017 10:24:41 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCIsWRWlGSWpSXmKPExsXitHRDpO7Ls2c iDa6/57X4vmUykwOjx+EPV1gCGKNYM/OS8isSWDOmrrrFXPCXtWLR59IGxh7WLkZODgkBf4nO DRcYQWw2AWWJn529bCC2iICeRNOB52BxZoFiiZ77l1hAbGEBR4lTDRPA4iwCqhK3/z0Dqufg4 BWwkJh5UgtipLzErraLrCBhTgFLiQ3740DCQkAVH9p3skLYChId048xgdi8AoISJ2c+YYHYJC Fx8MUL5gmMvLOQpGYhSS1gZFrFqFGcWlSWWqRrZKaXVJSZnlGSm5iZo2toYKyXm1pcnJiempO YVKyXnJ+7iREYNvUMDIw7GBv2+h1ilORgUhLl1TlxJlKILyk/pTIjsTgjvqg0J7X4EKMMB4eS BO+aM0A5waLU9NSKtMwcYADDpCU4eJREeJeCpHmLCxJzizPTIVKnGI05bjy8/oeJo+Pm3T9MQ ix5+XmpUuK8vSClAiClGaV5cINgkXWJUVZKmJeRgYFBiKcgtSg3swRV/hWjOAejkjDvbpApPJ l5JXD7XgGdwgR0yuSJYKeUJCKkpBoYFT/u3fuFK2yy/cuSfW/e6ESWft4icut7+YYgs9+Bsbp xtdGnrix/pdVyIuHI3wVaCTNOn/x8bO3Np2Erl4b4JC9d5WKuYDd/fsDeM7tcd92fcCP3+L0V 7FoW++bdVjjB6KG9sP+Z5o8d63TerFCvX3Dwm4APN9uZxz9lA2Y4/LxwTUSKszJ2T5kSS3FGo qEWc1FxIgAzozdkpwIAAA== X-Env-Sender: prvs=4379d8120=wei.liu2@citrix.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1506594279!116920262!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46201 invoked from network); 28 Sep 2017 10:24:40 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-3.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 28 Sep 2017 10:24:40 -0000 X-IronPort-AV: E=Sophos;i="5.42,449,1500940800"; d="scan'208";a="441575185" From: Wei Liu To: Xen-devel Date: Thu, 28 Sep 2017 11:24:25 +0100 Message-ID: <20170928102425.22745-3-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170928102425.22745-1-wei.liu2@citrix.com> References: <20170928102425.22745-1-wei.liu2@citrix.com> MIME-Version: 1.0 Cc: Ian Jackson , Paul Durrant , Wei Liu Subject: [Xen-devel] [PATCH 2/2] libxendevicemodel: initialise extent to zero 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The pad field needs to be zero as required by the hypervisor. Instead of setting the pad separately, memset extent to zero. Signed-off-by: Wei Liu --- Cc: Ian Jackson Cc: Paul Durrant Backport to 4.9 --- tools/libs/devicemodel/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/libs/devicemodel/core.c b/tools/libs/devicemodel/core.c index fcb260d29b..af06936262 100644 --- a/tools/libs/devicemodel/core.c +++ b/tools/libs/devicemodel/core.c @@ -485,6 +485,8 @@ int xendevicemodel_modified_memory( { struct xen_dm_op_modified_memory_extent extent; + memset(&extent, 0, sizeof(extent)); + extent.first_pfn = first_pfn; extent.nr = nr;