All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH]Implement domctl_sendtrigger_nmi for x86 hvm
Date: Fri, 13 Jul 2007 11:09:16 +0900	[thread overview]
Message-ID: <4696DECC.4020504@ab.jp.nec.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 242 bytes --]

Hi there,

This patch implements DOMCTL_SENDTRIGGER_NMI hypercall
for x86 hvm domains.
we can manually inject NMI into a domain by using
'xm trigger [domain] nmi [vcpu]'.

Regards,
-------------------
Yosuke Iwamatsu
        NEC Corporation


[-- Attachment #2: domctl_sendtrigger_nmi.patch --]
[-- Type: text/plain, Size: 1540 bytes --]

# HG changeset patch
# User Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
# Date 1184291863 -32400
# Node ID aa538b0b8a496fee48a1c75ae0bec78ea7f31dfc
# Parent  1f348e70a5affdea9b44c1e39cd5ef094ad4a0bf
Implement DOMCTL_SENDTRIGGER_NMI for x86 hvm

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>

diff -r 1f348e70a5af -r aa538b0b8a49 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Jul 10 11:10:38 2007 +0100
+++ b/xen/arch/x86/domctl.c	Fri Jul 13 10:57:43 2007 +0900
@@ -427,6 +427,46 @@ long arch_do_domctl(
     }
     break;
 
+    case XEN_DOMCTL_sendtrigger:
+    {
+        struct domain *d;
+        struct vcpu *v;
+
+        ret = -ESRCH;
+        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
+            break;
+
+        ret = -EINVAL;
+        if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
+            goto sendtrigger_out;
+
+        ret = -ESRCH;
+        if ( (v = d->vcpu[domctl->u.sendtrigger.vcpu]) == NULL )
+            goto sendtrigger_out;
+
+        switch (domctl->u.sendtrigger.trigger)
+        {
+        case XEN_DOMCTL_SENDTRIGGER_NMI:
+        {
+            ret = -ENOSYS;
+            if ( !is_hvm_domain(d) )
+                break;
+
+            ret = 0;
+            if ( !test_and_set_bool(v->arch.hvm_vcpu.nmi_pending) )
+                vcpu_kick(v);
+        }
+        break;
+
+        default:
+            ret = -ENOSYS;
+        }
+
+    sendtrigger_out:
+        rcu_unlock_domain(d);
+    }
+    break;
+
     default:
         ret = -ENOSYS;
         break;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

                 reply	other threads:[~2007-07-13  2:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4696DECC.4020504@ab.jp.nec.com \
    --to=y-iwamatsu@ab.jp.nec.com \
    --cc=xen-devel@lists.xensource.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.