xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ross Lagerwall <ross.lagerwall@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	konrad@kernel.org, xen-devel@lists.xenproject.org,
	sasha.levin@oracle.com, andrew.cooper3@citrix.com,
	mpohlack@amazon.de
Cc: Wei Liu <wei.liu2@citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Ian Jackson <ian.jackson@eu.citrix.com>
Subject: Re: [PATCH v8 02/25] xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op
Date: Wed, 20 Apr 2016 14:18:48 +0100	[thread overview]
Message-ID: <571781B8.8080703@citrix.com> (raw)
In-Reply-To: <1460581796-30071-3-git-send-email-konrad.wilk@oracle.com>

On 04/13/2016 10:09 PM, Konrad Rzeszutek Wilk wrote:
snip
> +static int xsplice_action(xen_sysctl_xsplice_action_t *action)
> +{
> +    struct payload *data;
> +    char n[XEN_XSPLICE_NAME_SIZE];
> +    int rc;
> +
> +    rc = verify_name(&action->name, n);
> +    if ( rc )
> +        return rc;
> +
> +    spin_lock(&payload_lock);
> +
> +    data = find_payload(n);
> +    if ( IS_ERR_OR_NULL(data) )
> +    {
> +        spin_unlock(&payload_lock);
> +
> +        if ( !data )
> +            return -ENOENT;
> +
> +        return PTR_ERR(data);
> +    }

I think you need something like: rc = -EINVAL;
here. Otherwise running "xen-xsplice unload <patch>" on an applied patch 
succeeds but fails to do anything.

> +
> +    switch ( action->cmd )
> +    {
> +    case XSPLICE_ACTION_CHECK:
> +        if ( data->state == XSPLICE_STATE_CHECKED )
> +        {
> +            /* No implementation yet. */
> +            data->state = XSPLICE_STATE_CHECKED;
> +            data->rc = 0;
> +        }
> +        break;
> +
> +    case XSPLICE_ACTION_UNLOAD:
> +        if ( data->state == XSPLICE_STATE_CHECKED )
> +        {
> +            free_payload(data);
> +            /* No touching 'data' from here on! */
> +            data = NULL;
> +        }
> +        break;
> +
> +    case XSPLICE_ACTION_REVERT:
> +        if ( data->state == XSPLICE_STATE_APPLIED )
> +        {
> +            /* No implementation yet. */
> +            data->state = XSPLICE_STATE_CHECKED;
> +            data->rc = 0;
> +        }
> +        break;
> +
> +    case XSPLICE_ACTION_APPLY:
> +        if ( data->state == XSPLICE_STATE_CHECKED )
> +        {
> +            /* No implementation yet. */
> +            data->state = XSPLICE_STATE_APPLIED;
> +            data->rc = 0;
> +        }
> +        break;
> +
> +    case XSPLICE_ACTION_REPLACE:
> +        if ( data->state == XSPLICE_STATE_CHECKED )
> +        {
> +            /* No implementation yet. */
> +            data->state = XSPLICE_STATE_CHECKED;
> +            data->rc = 0;
> +        }
> +        break;
> +
> +    default:
> +        rc = -EOPNOTSUPP;
> +        break;
> +    }
> +
> +    spin_unlock(&payload_lock);
> +
> +    return rc;
> +}
> +
> +int xsplice_op(xen_sysctl_xsplice_op_t *xsplice)

-- 
Ross Lagerwall

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

  reply	other threads:[~2016-04-20 13:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 21:09 [PATCH v8] xSplice v1 design and implementation Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 01/25] xsplice: Design document Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 02/25] xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op Konrad Rzeszutek Wilk
2016-04-20 13:18   ` Ross Lagerwall [this message]
2016-04-22 18:06     ` Konrad Rzeszutek Wilk
2016-04-25  9:03       ` Jan Beulich
2016-04-25  9:13         ` Ross Lagerwall
2016-04-13 21:09 ` [PATCH v8 03/25] libxc: Implementation of XEN_XSPLICE_op in libxc Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 04/25] xen-xsplice: Tool to manipulate xsplice payloads Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 05/25] arm/x86: Use struct virtual_region to do bug, symbol, and (x86) exception tables lookup Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 06/25] arm/x86/vmap: Add vmalloc_xen, vfree_xen and vm_init_type Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 07/25] x86/mm: Introduce modify_xen_mappings() Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 08/25] xsplice: Add helper elf routines Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 09/25] xsplice: Implement payload loading Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 10/25] xsplice: Implement support for applying/reverting/replacing patches Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 11/25] x86/xen_hello_world.xsplice: Test payload for patching 'xen_extra_version' Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 12/25] xsplice, symbols: Implement symbol name resolution on address Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 13/25] xsplice, symbols: Implement fast symbol names -> virtual addresses lookup Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 14/25] x86, xsplice: Print payload's symbol name and payload name in backtraces Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 15/25] xsplice: Add support for bug frames Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 16/25] xsplice: Add support for exception tables Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 17/25] xsplice: Add support for alternatives Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 18/25] build_id: Provide ld-embedded build-ids Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 19/25] HYPERCALL_version_op: Add VERSION_build_id to retrieve build-id Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 20/25] libxl: info: Display build_id of the hypervisor using XEN_VERSION_build_id Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 21/25] xsplice: Print build_id in keyhandler and on bootup Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 22/25] xsplice: Stacking build-id dependency checking Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 23/25] xsplice/xen_replace_world: Test-case for XSPLICE_ACTION_REPLACE Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 24/25] xsplice: Prevent duplicate payloads from being loaded Konrad Rzeszutek Wilk
2016-04-13 21:09 ` [PATCH v8 25/25] MAINTAINERS/xsplice: Add myself and Ross as the maintainers Konrad Rzeszutek Wilk
2016-04-13 21:57 ` [PATCH v8] xSplice v1 design and implementation Konrad Rzeszutek Wilk
2016-04-13 22:01   ` 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=571781B8.8080703@citrix.com \
    --to=ross.lagerwall@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=ian.jackson@eu.citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=konrad@kernel.org \
    --cc=mpohlack@amazon.de \
    --cc=sasha.levin@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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).