From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Feng Wu <feng.wu@intel.com>, xen-devel@lists.xen.org
Cc: tim@xen.org, keir.xen@gmail.com, stefano.stabellini@citrix.com,
ian.campbell@citrix.com, JBeulich@suse.com
Subject: Re: [PATCH v2 3/5] x86: Make set_nmi_callback return the old nmi callback
Date: Thu, 29 May 2014 08:01:24 +0100 [thread overview]
Message-ID: <5386DB44.3070909@citrix.com> (raw)
In-Reply-To: <1401341669-5237-4-git-send-email-feng.wu@intel.com>
On 29/05/2014 06:34, Feng Wu wrote:
> This patch makes set_nmi_callback return the old nmi callback, so
> we can set it back later.
>
> Signed-off-by: Feng Wu <feng.wu@intel.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> xen/arch/x86/traps.c | 4 +++-
> xen/include/asm-x86/nmi.h | 4 ++--
> 2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
> index 1722912..171cff0 100644
> --- a/xen/arch/x86/traps.c
> +++ b/xen/arch/x86/traps.c
> @@ -3322,9 +3322,11 @@ void do_nmi(struct cpu_user_regs *regs)
> }
> }
>
> -void set_nmi_callback(nmi_callback_t callback)
> +nmi_callback_t set_nmi_callback(nmi_callback_t callback)
> {
> + nmi_callback_t old_nmi_callback = nmi_callback;
> nmi_callback = callback;
> + return old_nmi_callback;
> }
>
> void unset_nmi_callback(void)
> diff --git a/xen/include/asm-x86/nmi.h b/xen/include/asm-x86/nmi.h
> index 98b5e04..58cd9a1 100644
> --- a/xen/include/asm-x86/nmi.h
> +++ b/xen/include/asm-x86/nmi.h
> @@ -15,9 +15,9 @@ typedef int (*nmi_callback_t)(struct cpu_user_regs *regs, int cpu);
> * set_nmi_callback
> *
> * Set a handler for an NMI. Only one handler may be
> - * set. Return 1 if the NMI was handled.
> + * set. Return the old nmi callback handler.
> */
> -void set_nmi_callback(nmi_callback_t callback);
> +nmi_callback_t set_nmi_callback(nmi_callback_t callback);
>
> /**
> * unset_nmi_callback
next prev parent reply other threads:[~2014-05-29 7:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-29 5:34 [PATCH v2 0/5] x86: Use alternative mechanism to define CLAC/STAC Feng Wu
2014-05-29 5:34 ` [PATCH v2 1/5] Use STR() as the only method for performing preprocessor stringificaion Feng Wu
2014-05-29 7:00 ` Andrew Cooper
2014-05-29 15:00 ` Jan Beulich
2014-05-29 5:34 ` [PATCH v2 2/5] x86: Add definitions for NOP operation Feng Wu
2014-05-29 8:43 ` Andrew Cooper
2014-05-29 5:34 ` [PATCH v2 3/5] x86: Make set_nmi_callback return the old nmi callback Feng Wu
2014-05-29 7:01 ` Andrew Cooper [this message]
2014-05-29 5:34 ` [PATCH v2 4/5] x86: Port the basic alternative mechanism from Linux to Xen Feng Wu
2014-05-29 8:55 ` Andrew Cooper
2014-05-29 9:28 ` Wu, Feng
2014-05-29 14:59 ` Andrew Cooper
2014-05-30 4:48 ` Wu, Feng
2014-05-30 7:07 ` Jan Beulich
2014-05-29 5:34 ` [PATCH v2 5/5] x86: Use alternative mechanism to define CLAC/STAC Feng Wu
2014-05-29 8:56 ` Andrew Cooper
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=5386DB44.3070909@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=feng.wu@intel.com \
--cc=ian.campbell@citrix.com \
--cc=keir.xen@gmail.com \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.org \
--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.