From patchwork Thu Sep 28 10:46:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9975785 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 163436037E for ; Thu, 28 Sep 2017 10:48:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 079442928D for ; Thu, 28 Sep 2017 10:48:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEC46292F3; Thu, 28 Sep 2017 10:48:54 +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 7600D2928D for ; Thu, 28 Sep 2017 10:48:54 +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 1dxWKs-00048h-9A; Thu, 28 Sep 2017 10:46:30 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxWKr-00048Z-73 for xen-devel@lists.xenproject.org; Thu, 28 Sep 2017 10:46:29 +0000 Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id 82/55-02208-403DCC95; Thu, 28 Sep 2017 10:46:28 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsXitHRDpC7z5TO RBitm6Vt83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBnXf3eyFfSIVTSdPsfSwLhFqIuRk0NCwF9i 7owtbCA2i4CqxLFJc1hBbDYBZYmfnb1gcREBLYkJW7YygdjMAgsZJXo2l3UxcnAIC3hInGurA QnzClhILF30B6xcSGA+o8T1PaUQcUGJkzOfsEC06kgs2P2JDaSVWUBaYvk/DpAwJ9CUjsXHwL aKCqhIdC6dwwIxRkGiY/oxpgmMfLOQTJqFZNIshEkLGJlXMaoXpxaVpRbpmuolFWWmZ5TkJmb m6BoamOrlphYXJ6an5iQmFesl5+duYgQGGQMQ7GD80u98iFGSg0lJlDfu4plIIb6k/JTKjMTi jPii0pzU4kOMMhwcShK8EpeAcoJFqempFWmZOcBwh0lLcPAoifCKgKR5iwsSc4sz0yFSpxh1O Y5tuvyHSYglLz8vVUqc9yDIfAGQoozSPLgRsNi7xCgrJczLCHSUEE9BalFuZgmq/CtGcQ5GJW FeVZBVPJl5JXCbXgEdwQR0xOSJYEeUJCKkpBoYfdc/qrY61M5uYnTsWsq6LQdzdtzZPPcfi+g 2P9PZm4RLA+1LF5f/bNbTe5eZGbnDe9vk96e36bvfC517xTFV9/X/jLJNS0L5T7w1av78/Guc zuT+6/3iG4Lv/6iwlZQJXfL5vNAF4TQBd3OmSq/M9uWGfrHc/rk7bp/V/hUfLihgnFuUcNZVi aU4I9FQi7moOBEAIqQv0bgCAAA= X-Env-Sender: prvs=4379d8120=wei.liu2@citrix.com X-Msg-Ref: server-3.tower-206.messagelabs.com!1506595586!110065372!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 29928 invoked from network); 28 Sep 2017 10:46:27 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-3.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 28 Sep 2017 10:46:27 -0000 X-IronPort-AV: E=Sophos;i="5.42,449,1500940800"; d="scan'208";a="441577082" Date: Thu, 28 Sep 2017 11:46:24 +0100 From: Wei Liu To: Paul Durrant Message-ID: <20170928104624.eirld27ric2umhjb@citrix.com> References: <20170928103625.896-1-wei.liu2@citrix.com> <20170928103625.896-3-wei.liu2@citrix.com> <52c46f96410a4f3ab2d1610da3d997d4@AMSPEX02CL03.citrite.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <52c46f96410a4f3ab2d1610da3d997d4@AMSPEX02CL03.citrite.net> User-Agent: NeoMutt/20170113 (1.7.2) Cc: Anthony Perard , Xen-devel , Wei Liu , Ian Jackson Subject: Re: [Xen-devel] [PATCH v2 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 On Thu, Sep 28, 2017 at 11:40:45AM +0100, Paul Durrant wrote: > > -----Original Message----- > > From: Wei Liu [mailto:wei.liu2@citrix.com] > > Sent: 28 September 2017 11:36 > > To: Xen-devel > > Cc: Anthony Perard ; Wei Liu > > ; Ian Jackson ; Paul Durrant > > > > Subject: [PATCH v2 2/2] libxendevicemodel: initialise extent to zero > > > > The pad field needs to be zero as required by the hypervisor. > > > > Instead of setting the pad separately, use C99 initialiser to clear > > extent. > > > > Signed-off-by: Wei Liu > > --- > > Cc: Ian Jackson > > Cc: Paul Durrant > > > > Backport to 4.9 > > --- > > tools/libs/devicemodel/core.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/libs/devicemodel/core.c b/tools/libs/devicemodel/core.c > > index fcb260d29b..986f147658 100644 > > --- a/tools/libs/devicemodel/core.c > > +++ b/tools/libs/devicemodel/core.c > > @@ -483,7 +483,7 @@ int xendevicemodel_modified_memory( > > xendevicemodel_handle *dmod, domid_t domid, uint64_t first_pfn, > > uint32_t nr) > > { > > - struct xen_dm_op_modified_memory_extent extent; > > + struct xen_dm_op_modified_memory_extent extent = { }; > > Not quite. I meant: > > struct xen_dm_op_modified_memory_extent extent = { > .first_pfn = first_pfn, > .nr = nr, > }; > > then you can drop the lines below. Here you go. ---8<--- From 75c955c2d2c7077fe59b5e3b14e3deff613025e8 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Thu, 28 Sep 2017 11:00:00 +0100 Subject: [PATCH] libxendevicemodel: initialise extent.pad to zero The pad field needs to be zero as required by the hypervisor. Instead of setting the pad separately, use C99 initialiser. Signed-off-by: Wei Liu Reviewed-by: Paul Durrant --- Cc: Ian Jackson Cc: Paul Durrant Backport to 4.9 --- tools/libs/devicemodel/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/libs/devicemodel/core.c b/tools/libs/devicemodel/core.c index fcb260d29b..0f2c1a791f 100644 --- a/tools/libs/devicemodel/core.c +++ b/tools/libs/devicemodel/core.c @@ -483,10 +483,10 @@ int xendevicemodel_modified_memory( xendevicemodel_handle *dmod, domid_t domid, uint64_t first_pfn, uint32_t nr) { - struct xen_dm_op_modified_memory_extent extent; - - extent.first_pfn = first_pfn; - extent.nr = nr; + struct xen_dm_op_modified_memory_extent extent = { + .first_pfn = first_pfn, + .nr = nr, + }; return xendevicemodel_modified_memory_bulk(dmod, domid, &extent, 1); }