xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ross Lagerwall <ross.lagerwall@citrix.com>
To: xen-devel@lists.xen.org
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>
Subject: [PATCH v2 4/8] livepatch: Fix documentation of timeout
Date: Wed, 14 Dec 2016 07:51:56 +0000	[thread overview]
Message-ID: <1481701920-13758-5-git-send-email-ross.lagerwall@citrix.com> (raw)
In-Reply-To: <1481701920-13758-1-git-send-email-ross.lagerwall@citrix.com>

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 <ross.lagerwall@citrix.com>
---
 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. */
 };  
 
 </pre>
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;
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-12-14  7:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14  7:51 [PATCH v2 0/8] xen-livepatch misc fixes/changes Ross Lagerwall
2016-12-14  7:51 ` [PATCH v2 1/8] tools/livepatch: Show the correct expected state before action Ross Lagerwall
2016-12-14  7:51 ` [PATCH v2 2/8] tools/livepatch: Set stdout and stderr unbuffered Ross Lagerwall
2016-12-14  7:54   ` Wei Liu
2016-12-14  7:51 ` [PATCH v2 3/8] tools/livepatch: Improve output Ross Lagerwall
2016-12-14  7:51 ` Ross Lagerwall [this message]
2016-12-14  7:54   ` [PATCH v2 4/8] livepatch: Fix documentation of timeout Wei Liu
2016-12-14  7:51 ` [PATCH v2 5/8] tools/livepatch: Remove pointless retry loop Ross Lagerwall
2016-12-14  7:55   ` Wei Liu
2016-12-14  7:51 ` [PATCH v2 6/8] tools/livepatch: Remove unused struct member Ross Lagerwall
2016-12-14  7:51 ` [PATCH v2 7/8] tools/livepatch: Save errno where needed Ross Lagerwall
2016-12-14  7:55   ` Wei Liu
2016-12-14  7:52 ` [PATCH v2 8/8] tools/livepatch: Exit with 2 if a timeout occurs Ross Lagerwall
2016-12-14  7:56   ` Wei Liu
2016-12-14 18:16 ` [PATCH v2 0/8] xen-livepatch misc fixes/changes Konrad Rzeszutek Wilk
2016-12-14 20:32   ` Konrad Rzeszutek Wilk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1481701920-13758-5-git-send-email-ross.lagerwall@citrix.com \
    --to=ross.lagerwall@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).