From: Alexander Graf <agraf@suse.de>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
Thomas Huth <thuth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v2 5/5] cpus: Enable nmi() callback use
Date: Mon, 31 Mar 2014 14:47:05 +0200 [thread overview]
Message-ID: <533963C9.1080409@suse.de> (raw)
In-Reply-To: <1396011112-23559-6-git-send-email-aik@ozlabs.ru>
On 03/28/2014 01:51 PM, Alexey Kardashevskiy wrote:
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Missing patch description.
Also, this patch should be among the first in your patch set. It makes
review a lot easier on code movements like this when you always remove
and add back the same code inside the same patch. So you'd keep the
#ifdef's here, then slowly move x86 and s390 over to QMP functions.
Apart from the missing QMP description patch I think this patch set
makes sense. But please verify that x86 and s390x NMIs still work.
Alex
> ---
> cpus.c | 33 +++++++--------------------------
> 1 file changed, 7 insertions(+), 26 deletions(-)
>
> diff --git a/cpus.c b/cpus.c
> index 1104d61..2c8d620 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -1469,33 +1469,14 @@ exit:
>
> void qmp_inject_nmi(Error **errp)
> {
> -#if defined(TARGET_I386)
> - CPUState *cs;
> + CPUState *cs = qemu_get_cpu(monitor_get_cpu_index());
> + CPUClass *cc = CPU_GET_CLASS(cs);
> + int ret = -1;
>
> - CPU_FOREACH(cs) {
> - X86CPU *cpu = X86_CPU(cs);
> -
> - if (!cpu->apic_state) {
> - cpu_interrupt(cs, CPU_INTERRUPT_NMI);
> - } else {
> - apic_deliver_nmi(cpu->apic_state);
> - }
> + if (cs && cc->nmi) {
> + ret = cc->nmi(cs);
> }
> -#elif defined(TARGET_S390X)
> - CPUState *cs;
> - S390CPU *cpu;
> -
> - CPU_FOREACH(cs) {
> - cpu = S390_CPU(cs);
> - if (cpu->env.cpu_num == monitor_get_cpu_index()) {
> - if (s390_cpu_restart(S390_CPU(cs)) == -1) {
> - error_set(errp, QERR_UNSUPPORTED);
> - return;
> - }
> - break;
> - }
> + if (ret) {
> + error_set(errp, QERR_UNSUPPORTED);
> }
> -#else
> - error_set(errp, QERR_UNSUPPORTED);
> -#endif
> }
prev parent reply other threads:[~2014-03-31 12:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-28 12:51 [Qemu-devel] [PATCH v2 0/5] nmi: add interface Alexey Kardashevskiy
2014-03-28 12:51 ` [Qemu-devel] [PATCH v2 1/5] cpu: Add NMI callback Alexey Kardashevskiy
2014-03-31 12:32 ` Alexander Graf
2014-03-28 12:51 ` [Qemu-devel] [PATCH v2 2/5] target-i386: Implement nmi() callback Alexey Kardashevskiy
2014-03-31 2:55 ` Alexey Kardashevskiy
2014-03-31 3:20 ` Richard Henderson
2014-03-31 12:33 ` Alexander Graf
2014-03-28 12:51 ` [Qemu-devel] [PATCH v2 3/5] target-s390: " Alexey Kardashevskiy
2014-03-28 12:51 ` [Qemu-devel] [PATCH v2 4/5] target-ppc: " Alexey Kardashevskiy
2014-03-31 12:41 ` Alexander Graf
2014-03-28 12:51 ` [Qemu-devel] [PATCH v2 5/5] cpus: Enable nmi() callback use Alexey Kardashevskiy
2014-03-31 12:47 ` Alexander Graf [this message]
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=533963C9.1080409@suse.de \
--to=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@linux.vnet.ibm.com \
/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.