All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ross Lagerwall <ross.lagerwall@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: Re: [PATCH v1 02/11] xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op
Date: Wed, 4 Nov 2015 16:17:32 -0500	[thread overview]
Message-ID: <20151104211732.GD16253@char.us.oracle.com> (raw)
In-Reply-To: <1446574568-9644-2-git-send-email-ross.lagerwall@citrix.com>

On Tue, Nov 03, 2015 at 06:15:59PM +0000, Ross Lagerwall wrote:
> From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

It is very hard for me to review my own code, but mostly
what I see are some quite simple things (really really simple)

> diff --git a/xen/common/xsplice.c b/xen/common/xsplice.c
> new file mode 100644
> index 0000000..d984c8a
> --- /dev/null
> +++ b/xen/common/xsplice.c
> +struct payload {
> +    int32_t state;     /* One of XSPLICE_STATE_*. */
> +    int32_t rc;         /* 0 or -EXX. */
> +
> +    struct list_head   list;   /* Linked to 'payload_list'. */
> +
> +    char  id[XEN_XSPLICE_NAME_SIZE + 1];          /* Name of it. */
> +};

There is some space between char and id. Actually all of these look
like they were at the same indentation but are now a bit off.

It would be nice to have them align (the comments) and the
space between 'list_head   list' and 'char  id' shorten.


..snip..
> +int find_payload(xen_xsplice_id_t *id, bool_t need_lock, struct payload **f)
> +{
> +    struct payload *data;
> +    XEN_GUEST_HANDLE_PARAM(char) str;
> +    char name[XEN_XSPLICE_NAME_SIZE + 1] = { 0 }; /* 128 + 1 bytes on stack. Perhaps kzalloc? */

Jan was not too worried about the kzalloc so I think we can
remove the comment.

> +    int rc = -EINVAL;
> +
> +    rc = verify_id(id);
> +    if ( rc )
> +        return rc;
> +
> +    str = guest_handle_cast(id->name, char);
> +    if ( copy_from_guest(name, str, id->size) )
> +        return -EFAULT;
> +
> +    if ( need_lock )
> +        spin_lock(&payload_list_lock);
> +
> +    rc = -ENOENT;
> +    list_for_each_entry ( data, &payload_list, list )
> +    {
> +        if ( !strcmp(data->id, name) )
> +        {
> +            *f = data;
> +            rc = 0;
> +            break;
> +        }
> +    }
> +
> +    if ( need_lock )
> +        spin_unlock(&payload_list_lock);
> +
> +    return rc;
> +}
> +
> +

And we have an extra \n here. 

.. And besides that I realized that there is some code for which
we have CONFIG_ around (lock profile, gcov, kdump?, etc). We
should probably make the xSplice code also be guarded by this
as well.

Ross, I can do these changes easily. Unless you are itching
to do it now :-)

  reply	other threads:[~2015-11-04 21:17 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 18:15 [PATCH v1 01/11] xsplice: Design document (v2) Ross Lagerwall
2015-11-03 18:15 ` [PATCH v1 02/11] xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op Ross Lagerwall
2015-11-04 21:17   ` Konrad Rzeszutek Wilk [this message]
2015-11-12 16:28   ` Jan Beulich
2015-11-13 14:13     ` Konrad Rzeszutek Wilk
2015-11-13 23:50   ` Daniel De Graaf
2015-11-03 18:16 ` [PATCH v1 03/11] libxc: Implementation of XEN_XSPLICE_op in libxc Ross Lagerwall
2015-11-03 18:16 ` [PATCH v1 04/11] xen-xsplice: Tool to manipulate xsplice payloads Ross Lagerwall
2015-11-04 21:27   ` Konrad Rzeszutek Wilk
2015-11-03 18:16 ` [PATCH v1 05/11] elf: Add relocation types to elfstructs.h Ross Lagerwall
2015-11-05 10:38   ` Jan Beulich
2015-11-05 11:52     ` Ross Lagerwall
2015-11-03 18:16 ` [PATCH v1 06/11] xsplice: Add helper elf routines Ross Lagerwall
2015-11-04 21:49   ` Konrad Rzeszutek Wilk
2015-11-03 18:16 ` [PATCH v1 07/11] xsplice: Implement payload loading Ross Lagerwall
2015-11-04 22:21   ` Konrad Rzeszutek Wilk
2015-11-05 10:35     ` Jan Beulich
2015-11-05 11:51       ` Ross Lagerwall
2015-11-05 12:13         ` Jan Beulich
2015-11-05 11:15     ` Ross Lagerwall
2015-11-05 20:12       ` Konrad Rzeszutek Wilk
2015-11-03 18:16 ` [PATCH v1 08/11] xsplice: Implement support for applying patches Ross Lagerwall
2015-11-05  3:17   ` Konrad Rzeszutek Wilk
2015-11-05 11:45     ` Ross Lagerwall
2015-11-05 20:08       ` Konrad Rzeszutek Wilk
2015-11-05  3:19   ` Konrad Rzeszutek Wilk
2015-11-27 13:51   ` Martin Pohlack
2015-11-03 18:16 ` [PATCH v1 09/11] xsplice: Add support for bug frames Ross Lagerwall
2015-11-05 19:43   ` Konrad Rzeszutek Wilk
2015-11-03 18:16 ` [PATCH v1 10/11] xsplice: Add support for exception tables Ross Lagerwall
2015-11-05 19:47   ` Konrad Rzeszutek Wilk
2015-11-27 16:28   ` Martin Pohlack
2015-11-27 17:05     ` Ross Lagerwall
2015-11-03 18:16 ` [PATCH v1 11/11] xsplice: Add support for alternatives Ross Lagerwall
2015-11-05 19:48   ` Konrad Rzeszutek Wilk
2015-11-04 21:10 ` [PATCH v1 01/11] xsplice: Design document (v2) Konrad Rzeszutek Wilk
2015-11-05 10:49   ` Ross Lagerwall
2015-11-05 19:56     ` Konrad Rzeszutek Wilk
2015-11-10  9:55 ` Ross Lagerwall
2015-11-27 12:48 ` Martin Pohlack

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=20151104211732.GD16253@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=ross.lagerwall@citrix.com \
    --cc=stefano.stabellini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.