From patchwork Wed Dec 14 07:51:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Lagerwall X-Patchwork-Id: 9473775 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 70E1F60571 for ; Wed, 14 Dec 2016 07:54:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 661372855E for ; Wed, 14 Dec 2016 07:54:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AFC4286D2; Wed, 14 Dec 2016 07:54:47 +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 0052B2855E for ; Wed, 14 Dec 2016 07:54:46 +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 1cH4Mn-0001km-Ek; Wed, 14 Dec 2016 07:52:45 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cH4Ml-0001hW-Eg for xen-devel@lists.xen.org; Wed, 14 Dec 2016 07:52:43 +0000 Received: from [193.109.254.147] by server-2.bemta-6.messagelabs.com id 24/4A-22326-B4AF0585; Wed, 14 Dec 2016 07:52:43 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphkeJIrShJLcpLzFFi42JxWrrBXtfrV0C EQeMrA4slHxezODB6HN39mymAMYo1My8pvyKBNWNT20uWgr9KFZs7nrM0MK6V7GLk5JAQ8Jc4 d+EHO4jNJmAgcevSd2YQW0RAVmJ11xygOBcHs8AKRol733eydDFycAgL2EssXREDUsMioCrx/ up0sHpeAU+JS9dvMkHMlJO4ea4TLM4p4CXR/OgeG4gtBFRzfvkeVghbTeLt8jMsEL2CEidnPg GzmQUkJA6+eME8gZF3FpLULCSpBYxMqxjVi1OLylKLdI31kooy0zNKchMzc3QNDcz0clOLixP TU3MSk4r1kvNzNzECQ4cBCHYwdvxzOsQoycGkJMrLdTUgQogvKT+lMiOxOCO+qDQntfgQowwH h5IEr80PoJxgUWp6akVaZg4wiGHSEhw8SiK8V0DSvMUFibnFmekQqVOMilLivAY/gRICIImM0 jy4NljkXGKUlRLmZQQ6RIinILUoN7MEVf4VozgHo5IwrzrIFJ7MvBK46a+AFjMBLRZd4g+yuC QRISXVwCjmKxh69JW57rQbXXY1n7mapsz2L71z7XhFYYTcpPAZ3o+mfJuov0L25OPLv9/k9jQ s1u7W+3eQey6jrMJy1gd1eX7H2/1nml5JPMXhEbe89F7U+ZkrYmN5pu1n7eF5IrRHi0PZtJr1 1YYKK8lrZ8xNa+6qbuS+/beotnF1yPTvVxnU5qwXParEUpyRaKjFXFScCADJOgfSlwIAAA== X-Env-Sender: prvs=149da8861=ross.lagerwall@citrix.com X-Msg-Ref: server-16.tower-27.messagelabs.com!1481701961!76952634!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 39932 invoked from network); 14 Dec 2016 07:52:42 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 14 Dec 2016 07:52:42 -0000 X-IronPort-AV: E=Sophos;i="5.33,345,1477958400"; d="scan'208";a="403521733" From: Ross Lagerwall To: Date: Wed, 14 Dec 2016 07:51:56 +0000 Message-ID: <1481701920-13758-5-git-send-email-ross.lagerwall@citrix.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481701920-13758-1-git-send-email-ross.lagerwall@citrix.com> References: <1481701920-13758-1-git-send-email-ross.lagerwall@citrix.com> MIME-Version: 1.0 Cc: Ross Lagerwall , Ian Jackson , Wei Liu Subject: [Xen-devel] [PATCH v2 4/8] livepatch: Fix documentation of timeout 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 hypervisor expects the timeout from the hypercall to be in nanoseconds, so document this correctly. Also correctly document what happens when timeout is set to zero. Signed-off-by: Ross Lagerwall Acked-by: Wei Liu --- docs/misc/livepatch.markdown | 13 +++++++------ tools/libxc/include/xenctrl.h | 2 +- xen/common/livepatch.c | 4 ++-- xen/include/public/sysctl.h | 5 +++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/docs/misc/livepatch.markdown b/docs/misc/livepatch.markdown index 8f0559f..54a6b85 100644 --- a/docs/misc/livepatch.markdown +++ b/docs/misc/livepatch.markdown @@ -689,9 +689,9 @@ The caller provides: payload. If the operation takes more time than the upper bound of time the `rc` in `xen_livepatch_status' retrieved via **XEN_SYSCTL_LIVEPATCH_GET** will be -XEN_EBUSY. - * `time` the upper bound of time (ms) the cmd should take. Zero means infinite. - If within the time the operation does not succeed the operation would go in - error state. + * `time` the upper bound of time (ns) the cmd should take. Zero means to use + the hypervisor default. If within the time the operation does not succeed + the operation would go in error state. * `pad` - *MUST* be zero. The return value will be zero unless the provided fields are incorrect. @@ -706,9 +706,10 @@ The structure is as follow: struct xen_sysctl_livepatch_action { xen_livepatch_name_t name; /* IN, name of the patch. */ uint32_t cmd; /* IN: LIVEPATCH_ACTION_* */ - uint32_t time; /* IN: Zero if no timeout. */ - /* Or upper bound of time (ms) */ - /* for operation to take. */ + uint32_t time; /* IN: If zero then uses */ + /* hypervisor default. */ + /* Or upper bound of time (ns) */ + /* for operation to take. */ }; diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index 2c83544..4ab0f57 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -2703,7 +2703,7 @@ int xc_livepatch_list(xc_interface *xch, unsigned int max, unsigned int start, * The operations are asynchronous and the hypervisor may take a while * to complete them. The `timeout` offers an option to expire the * operation if it could not be completed within the specified time - * (in ms). Value of 0 means let hypervisor decide the best timeout. + * (in ns). Value of 0 means let hypervisor decide the best timeout. */ int xc_livepatch_apply(xc_interface *xch, char *name, uint32_t timeout); int xc_livepatch_revert(xc_interface *xch, char *name, uint32_t timeout); diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c index fc8ef99..246e673 100644 --- a/xen/common/livepatch.c +++ b/xen/common/livepatch.c @@ -1227,8 +1227,8 @@ static int schedule_work(struct payload *data, uint32_t cmd, uint32_t timeout) livepatch_work.data = data; livepatch_work.timeout = timeout ?: MILLISECS(30); - dprintk(XENLOG_DEBUG, LIVEPATCH "%s: timeout is %"PRI_stime"ms\n", - data->name, livepatch_work.timeout / MILLISECS(1)); + dprintk(XENLOG_DEBUG, LIVEPATCH "%s: timeout is %"PRIu32"ns\n", + data->name, livepatch_work.timeout); atomic_set(&livepatch_work.semaphore, -1); diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h index 28ac56c..00f5e77 100644 --- a/xen/include/public/sysctl.h +++ b/xen/include/public/sysctl.h @@ -1067,8 +1067,9 @@ struct xen_sysctl_livepatch_action { #define LIVEPATCH_ACTION_APPLY 3 #define LIVEPATCH_ACTION_REPLACE 4 uint32_t cmd; /* IN: LIVEPATCH_ACTION_*. */ - uint32_t timeout; /* IN: Zero if no timeout. */ - /* Or upper bound of time (ms) */ + uint32_t timeout; /* IN: If zero then uses */ + /* hypervisor default. */ + /* Or upper bound of time (ns) */ /* for operation to take. */ }; typedef struct xen_sysctl_livepatch_action xen_sysctl_livepatch_action_t;