From patchwork Fri Feb 19 18:36:57 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: 8363441 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 22E6B9F372 for ; Fri, 19 Feb 2016 18:39:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2E2EE2052D for ; Fri, 19 Feb 2016 18:39:29 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 31E0920461 for ; Fri, 19 Feb 2016 18:39:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aWpvZ-000648-Hj; Fri, 19 Feb 2016 18:37:17 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aWpvX-00063W-FO for xen-devel@lists.xenproject.org; Fri, 19 Feb 2016 18:37:15 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id 51/B6-04039-AD067C65; Fri, 19 Feb 2016 18:37:14 +0000 X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1455907032!23141551!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 52953 invoked from network); 19 Feb 2016 18:37:13 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-11.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 19 Feb 2016 18:37:13 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1JIb4UY031480 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 19 Feb 2016 18:37:04 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1JIb3q0008219 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 19 Feb 2016 18:37:04 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1JIb2P6023537; Fri, 19 Feb 2016 18:37:03 GMT Received: from localhost.localdomain (/209.6.196.81) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 19 Feb 2016 10:37:02 -0800 Date: Fri, 19 Feb 2016 13:36:57 -0500 From: Konrad Rzeszutek Wilk To: Jan Beulich Message-ID: <20160219183652.GA11420@localhost.localdomain> References: <1455300361-13092-1-git-send-email-konrad.wilk@oracle.com> <1455314229-22155-1-git-send-email-konrad.wilk@oracle.com> <1455314229-22155-2-git-send-email-konrad.wilk@oracle.com> <56C5FD4002000078000D3C51@prv-mh.provo.novell.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <56C5FD4002000078000D3C51@prv-mh.provo.novell.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: Keir Fraser , Ian Campbell , jinsong.liu@alibaba-inc.com, Ian Jackson , Tim Deegan , mpohlack@amazon.de, ross.lagerwall@citrix.com, andrew.cooper3@citrix.com, xen-devel@lists.xenproject.org Subject: Re: [Xen-devel] [PATCH v3 MISSING/23] xsplice: Design document (v7). X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Feb 18, 2016 at 09:20:00AM -0700, Jan Beulich wrote: > >>> On 12.02.16 at 22:57, wrote: > > +struct xsplice_patch_func { > > + const char *name; > > + Elf64_Xwordnew_addr; > > Missing space. > > > + Elf64_Xword old_addr; > > + Elf64_Word new_size; > > + Elf64_Word long old_size; > > There are still two types left here. That wouldn't compile very well. > > > +### XEN_SYSCTL_XSPLICE_GET (1) > > + > > +Retrieve an status of an specific payload. This caller provides: > > + > > + * A `struct xen_xsplice_name` called `name` which has the unique name. > > + * A `struct xen_xsplice_status` structure which has all members > > + set to zero: That is: > > + * `status` *MUST* be set to zero. > > + * `rc` *MUST* be set to zero. > > Why is this? .. It had an _pad entry in earlier versions. Let me remove the whole 'set to zero.." > > > +The structure is as follow: > > + > > +
> > +struct xen_xsplice_status {  
> > +#define XSPLICE_STATUS_LOADED       1  
> > +#define XSPLICE_STATUS_CHECKED      2  
> > +#define XSPLICE_STATUS_APPLIED      3  
> > +    int32_t state;                  /* OUT: XSPLICE_STATE_*. IN: MUST be zero. */  
> > +    int32_t rc;                     /* OUT: 0 if no error, otherwise -XEN_EXX. */  
> > +                                    /* IN: MUST be zero. */
> > +};  
> > +
> > +struct xen_sysctl_xsplice_summary {  
> > +    xen_xsplice_name_t name;        /* IN, the name of the payload. */  
> > +    xen_xsplice_status_t status;    /* IN/OUT: status of the payload. */  
> > +};  
> 
> With the operation being named XEN_SYSCTL_XSPLICE_GET, shouldn't
> the structure tag be xen_sysctl_xsplice_get?

Yes!
> 
> > +### XEN_SYSCTL_XSPLICE_LIST (2)
> > +
> > +Retrieve an array of abbreviated status and names of payloads that are 
> > loaded in the
> > +hypervisor.
> > +
> > +The caller provides:
> > +
> > + * `version`. Initially (on first hypercall) *MUST* be zero.
> > + * `idx` index iterator. On first call *MUST* be zero, subsequent calls varies.
> > + * `nr` the max number of entries to populate.
> > + * `pad` - *MUST* be zero.
> > + * `status` virtual address of where to write `struct xen_xsplice_status`
> > +   structures. Caller *MUST* allocate up to `nr` of them.
> > + * `name` - virtual address of where to write the unique name of the payload.
> > +   Caller *MUST* allocate up to `nr` of them. Each *MUST* be of
> > +   **XEN_XSPLICE_NAME_SIZE** size.
> > + * `len` - virtual address of where to write the length of each unique name
> > +   of the payload. Caller *MUST* allocate up to `nr` of them. Each *MUST* be
> > +   of sizeof(uint32_t) (4 bytes).
> > +
> > +If the hypercall returns an positive number, it is the number (upto `nr`
> > +provided to the hypercall) of the payloads returned, along with `nr` updated
> > +with the number of remaining payloads, `version` updated (it may be the same
> > +across hypercalls - if it varies the data is stale and further calls could
> > +fail). The `status`, `name`, and `len`' are updated at their designed index
> > +value (`idx`) with the returned value of data.
> > +
> > +If the hypercall returns -XEN_E2BIG the `nr` is too big and should be
> > +lowered.
> > +
> > +If the hypercall returns an zero value that means there are no payloads.
> 
> Maybe worth changing to "... there are no (more) payloads",
> considering the iterative nature of the operation?

Yes.

This is the change I did:


> 
> Jan
>

diff --git a/docs/misc/xsplice.markdown b/docs/misc/xsplice.markdown
index 9a95243..69c5176 100644
--- a/docs/misc/xsplice.markdown
+++ b/docs/misc/xsplice.markdown
@@ -289,10 +289,10 @@ describing the functions to be patched:
 
 struct xsplice_patch_func {  
     const char *name;  
-    Elf64_Xwordnew_addr;  
+    Elf64_Xword new_addr;  
     Elf64_Xword old_addr;  
     Elf64_Word new_size;  
-    Elf64_Word long old_size;  
+    Elf64_Word old_size;  
     uint8_t pad[32];  
 };  
 
@@ -425,10 +425,8 @@ struct xen_sysctl_xsplice_upload { Retrieve an status of an specific payload. This caller provides: * A `struct xen_xsplice_name` called `name` which has the unique name. - * A `struct xen_xsplice_status` structure which has all members - set to zero: That is: - * `status` *MUST* be set to zero. - * `rc` *MUST* be set to zero. + * A `struct xen_xsplice_status` structure. The member values will + be over-written upon completion. Upon completion the `struct xen_xsplice_status` is updated. @@ -473,12 +471,11 @@ struct xen_xsplice_status { #define XSPLICE_STATUS_LOADED 1 #define XSPLICE_STATUS_CHECKED 2 #define XSPLICE_STATUS_APPLIED 3 - int32_t state; /* OUT: XSPLICE_STATE_*. IN: MUST be zero. */ + int32_t state; /* OUT: XSPLICE_STATE_*. */ int32_t rc; /* OUT: 0 if no error, otherwise -XEN_EXX. */ - /* IN: MUST be zero. */ }; -struct xen_sysctl_xsplice_summary { +struct xen_sysctl_xsplice_get { xen_xsplice_name_t name; /* IN, the name of the payload. */ xen_xsplice_status_t status; /* IN/OUT: status of the payload. */ }; @@ -514,7 +511,7 @@ value (`idx`) with the returned value of data. If the hypercall returns -XEN_E2BIG the `nr` is too big and should be lowered. -If the hypercall returns an zero value that means there are no payloads. +If the hypercall returns an zero value there are no more payloads. Note that due to the asynchronous nature of hypercalls the control domain might have added or removed a number of payloads making this information stale. It is