From patchwork Fri Sep 30 18:11:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 9358719 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 5ABEE60757 for ; Fri, 30 Sep 2016 18:14:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5424C2A14C for ; Fri, 30 Sep 2016 18:14:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 485A52A153; Fri, 30 Sep 2016 18:14:24 +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, UNPARSEABLE_RELAY 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 B265D2A14C for ; Fri, 30 Sep 2016 18:14:23 +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 1bq2IJ-0005ak-L7; Fri, 30 Sep 2016 18:12:23 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bq2II-0005ZN-7Y for xen-devel@lists.xenproject.org; Fri, 30 Sep 2016 18:12:22 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id 3A/16-29563-50BAEE75; Fri, 30 Sep 2016 18:12:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRWlGSWpSXmKPExsXSO6nOVZd19bt wg1UrWC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1ox5G3vYC6YrVextim9gfCDZxcjJISQwmUni w0ExCPsbo8TF/7pdjFxA9kZGicbtk1ghnAmMEne+P2LqYuTgYBMwkXizyhGkQUTAVGL7xJMsI DazgJvE4fMf2UFsYQFviS0XZzOC2CwCqhKXl55nBbF5BVwlft05zA4yRkJAXuLZ7XqQMCdQ6+ 0t0xghbnCV6PxzAqxcQsBYov3tRbYJjHwLGBlWMWoUpxaVpRbpGprpJRVlpmeU5CZm5ugaGpj p5aYWFyemp+YkJhXrJefnbmIEhggDEOxgvL8x4BCjJAeTkiiv7NG34UJ8SfkplRmJxRnxRaU5 qcWHGGU4OJQkeB+ufBcuJFiUmp5akZaZAwxWmLQEB4+SCK8ESJq3uCAxtzgzHSJ1ilFRSpx3J UhCACSRUZoH1waLkEuMslLCvIxAhwjxFKQW5WaWoMq/YhTnYFQS5t0KMoUnM68EbvoroMVMQI vzj74BWVySiJCSamA0cF+pGyh062Wjjsmpa+ycNhr774Ut+pXFe9n8c+hZifaQWVmxUQbCzHN zDmlmO6rwfrtz0OHHJkfxh8venbRsso5c/bLW91eEmsvbLZysRx58qLC9++/Ay6y9c9krRE74 MiZwLut1/hl+Vqzn7VaB8NLND/sm6kdkJelwrDbl3sEysT9GcpcSS3FGoqEWc1FxIgA4vCeYi wIAAA== X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-5.tower-27.messagelabs.com!1475259139!62671363!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17688 invoked from network); 30 Sep 2016 18:12:20 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 30 Sep 2016 18:12:20 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u8UICHna005515 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Sep 2016 18:12:17 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id u8UICHAM022509 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 30 Sep 2016 18:12:17 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u8UICFYO029249; Fri, 30 Sep 2016 18:12:16 GMT Received: from localhost.us.oracle.com (/10.154.132.195) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 30 Sep 2016 11:12:14 -0700 From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org, konrad@kernel.org Date: Fri, 30 Sep 2016 14:11:50 -0400 Message-Id: <1475259114-8693-6-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1475259114-8693-1-git-send-email-konrad.wilk@oracle.com> References: <1475259114-8693-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] Cc: Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v2 5/9] tmem/sysctl: Add union in struct xen_sysctl_tmem_op 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" X-Virus-Scanned: ClamAV using ClamSMTP No functional change. We do this to prepare for another entry to be added in the union. See patch titled: "tmem/libxc: Squash XEN_SYSCTL_TMEM_OP_[SET|SAVE]" Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Andrew Cooper --- v2: New submission. --- tools/libxc/xc_tmem.c | 4 ++-- xen/common/tmem.c | 8 ++++---- xen/common/tmem_control.c | 4 ++-- xen/include/public/sysctl.h | 4 +++- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tools/libxc/xc_tmem.c b/tools/libxc/xc_tmem.c index 24c8b43..e1de16e 100644 --- a/tools/libxc/xc_tmem.c +++ b/tools/libxc/xc_tmem.c @@ -81,7 +81,7 @@ int xc_tmem_control(xc_interface *xch, } } - set_xen_guest_handle(sysctl.u.tmem_op.buf, buf); + set_xen_guest_handle(sysctl.u.tmem_op.u.buf, buf); rc = do_sysctl(xch, &sysctl); @@ -127,7 +127,7 @@ int xc_tmem_control_oid(xc_interface *xch, } } - set_xen_guest_handle(sysctl.u.tmem_op.buf, buf); + set_xen_guest_handle(sysctl.u.tmem_op.u.buf, buf); rc = do_sysctl(xch, &sysctl); diff --git a/xen/common/tmem.c b/xen/common/tmem.c index 95b97b8..abc2f67 100644 --- a/xen/common/tmem.c +++ b/xen/common/tmem.c @@ -1841,19 +1841,19 @@ int do_tmem_control(struct xen_sysctl_tmem_op *op) case XEN_SYSCTL_TMEM_OP_RESTORE_BEGIN: case XEN_SYSCTL_TMEM_OP_SAVE_END: ret = tmemc_save_subop(op->cli_id, pool_id, cmd, - guest_handle_cast(op->buf, char), op->arg1); + guest_handle_cast(op->u.buf, char), op->arg1); break; case XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_PAGE: ret = tmemc_save_get_next_page(op->cli_id, pool_id, - guest_handle_cast(op->buf, char), op->arg1); + guest_handle_cast(op->u.buf, char), op->arg1); break; case XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_INV: ret = tmemc_save_get_next_inv(op->cli_id, - guest_handle_cast(op->buf, char), op->arg1); + guest_handle_cast(op->u.buf, char), op->arg1); break; case XEN_SYSCTL_TMEM_OP_RESTORE_PUT_PAGE: ret = tmemc_restore_put_page(op->cli_id, pool_id, oidp, op->arg2, - guest_handle_cast(op->buf, char), op->arg1); + guest_handle_cast(op->u.buf, char), op->arg1); break; case XEN_SYSCTL_TMEM_OP_RESTORE_FLUSH_PAGE: ret = tmemc_restore_flush_page(op->cli_id, pool_id, oidp, op->arg2); diff --git a/xen/common/tmem_control.c b/xen/common/tmem_control.c index ba003a8..fc20a9f 100644 --- a/xen/common/tmem_control.c +++ b/xen/common/tmem_control.c @@ -384,7 +384,7 @@ int tmem_control(struct xen_sysctl_tmem_op *op) break; case XEN_SYSCTL_TMEM_OP_LIST: ret = tmemc_list(op->cli_id, - guest_handle_cast(op->buf, char), op->arg1, op->arg2); + guest_handle_cast(op->u.buf, char), op->arg1, op->arg2); break; case XEN_SYSCTL_TMEM_OP_SET_WEIGHT: case XEN_SYSCTL_TMEM_OP_SET_COMPRESS: @@ -401,7 +401,7 @@ int tmem_control(struct xen_sysctl_tmem_op *op) case XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_NPAGES: case XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_UUID: ret = tmemc_save_subop(op->cli_id, pool_id, cmd, - guest_handle_cast(op->buf, char), op->arg1); + guest_handle_cast(op->u.buf, char), op->arg1); break; default: ret = do_tmem_control(op); diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h index 728b80c..af128a8 100644 --- a/xen/include/public/sysctl.h +++ b/xen/include/public/sysctl.h @@ -818,7 +818,9 @@ struct xen_sysctl_tmem_op { uint32_t arg2; /* IN: If not applicable to command use 0. */ uint32_t pad; /* Padding so structure is the same under 32 and 64. */ xen_tmem_oid_t oid; /* IN: If not applicable to command use 0s. */ - XEN_GUEST_HANDLE_64(char) buf; /* IN/OUT: Buffer to save and restore ops. */ + union { + XEN_GUEST_HANDLE_64(char) buf; /* IN/OUT: Buffer to save and restore ops. */ + } u; }; typedef struct xen_sysctl_tmem_op xen_sysctl_tmem_op_t; DEFINE_XEN_GUEST_HANDLE(xen_sysctl_tmem_op_t);