All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] [PATCH 0/4][IA64][HVM] Windows 2003 server crashdump suppprt
@ 2006-12-04 10:43 Masaki Kanno
  2006-12-04 10:43 ` [RFC] [PATCH 1/4][IA64][HVM] " Masaki Kanno
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Masaki Kanno @ 2006-12-04 10:43 UTC (permalink / raw)
  To: xen-ia64-devel, xen-devel

Hi all,

These patches are able to collect a crashdump of Windows 2003 
server on HVM domain on ia64.

In the ia64 machine, there is an INIT switch. By pushing the 
INIT switch, an INIT interruption is generated. The INIT 
interruption triggers off when the Windows 2003 server collects 
the crashdump.

Currently, we don't provide a virtual INIT switch. Therefore, 
Windows 2003 server on HVM domain is not able to collect the 
crashdump. We provide a new xm command as the virtual INIT 
switch. 

The new xm command: xm os-init <Domain>

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>

Best regards,
 Kan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC] [PATCH 1/4][IA64][HVM] Windows 2003 server crashdump suppprt
  2006-12-04 10:43 [RFC] [PATCH 0/4][IA64][HVM] Windows 2003 server crashdump suppprt Masaki Kanno
@ 2006-12-04 10:43 ` Masaki Kanno
  2006-12-04 10:44 ` [RFC] [PATCH 2/4][IA64][HVM] " Masaki Kanno
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Masaki Kanno @ 2006-12-04 10:43 UTC (permalink / raw)
  To: xen-ia64-devel, xen-devel

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 20 bytes --]

[1/4]

Tools side.


[-- Attachment #2: xm_osinit_tools_side.patch --]
[-- Type: application/octet-stream, Size: 5205 bytes --]

diff -r 3bd721db6db5 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Sun Dec 03 17:44:14 2006 +0000
+++ b/tools/libxc/xc_domain.c	Mon Dec 04 14:17:51 2006 +0900
@@ -540,6 +540,19 @@ int xc_domain_iomem_permission(int xc_ha
     domctl.u.iomem_permission.allow_access = allow_access;
 
     return do_domctl(xc_handle, &domctl);
+}
+
+int xc_domain_send_init(int xc_handle,
+                        uint32_t domid)
+{
+#ifdef __ia64__
+    DECLARE_DOMCTL;
+    domctl.cmd = XEN_DOMCTL_send_init;
+    domctl.domain = (domid_t)domid;
+    return do_domctl(xc_handle, &domctl);
+#else
+    return -1;
+#endif
 }
 
 /*
diff -r 3bd721db6db5 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Sun Dec 03 17:44:14 2006 +0000
+++ b/tools/libxc/xenctrl.h	Mon Dec 04 14:13:50 2006 +0900
@@ -374,6 +374,16 @@ int xc_sched_credit_domain_get(int xc_ha
                                uint32_t domid,
                                struct xen_domctl_sched_credit *sdom);
 
+/**
+ * This function sends INIT interruption to a HVM domain of ia64.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm domid the domain id to send 
+ * return 0 on success, -1 on failure
+ */
+int xc_domain_send_init(int xc_handle,
+                        uint32_t domid);
+
 /*
  * EVENT CHANNEL FUNCTIONS
  */
diff -r 3bd721db6db5 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c	Sun Dec 03 17:44:14 2006 +0000
+++ b/tools/python/xen/lowlevel/xc/xc.c	Mon Dec 04 14:13:50 2006 +0900
@@ -861,6 +861,11 @@ static PyObject *pyxc_domain_set_time_of
     return zero;
 }
 
+static PyObject *pyxc_domain_send_init(XcObject *self, PyObject *args)
+{
+    return dom_op(self, args, xc_domain_send_init);
+}
+
 static PyObject *dom_op(XcObject *self, PyObject *args,
                         int (*fn)(int, uint32_t))
 {
@@ -1172,6 +1177,13 @@ static PyMethodDef pyxc_methods[] = {
       METH_VARARGS, "\n"
       "Set a domain's time offset to Dom0's localtime\n"
       " dom        [int]: Domain whose time offset is being set.\n"
+      "Returns: [int] 0 on success; -1 on error.\n" },
+
+    { "domain_send_init", 
+      (PyCFunction)pyxc_domain_send_init, 
+      METH_VARARGS, "\n"
+      "Send INIT interruption to a domain.\n"
+      " dom [int]: Identifier of domain to be sent INIT interruption.\n\n"
       "Returns: [int] 0 on success; -1 on error.\n" },
 
     { NULL, NULL, 0, NULL }
diff -r 3bd721db6db5 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py	Sun Dec 03 17:44:14 2006 +0000
+++ b/tools/python/xen/xend/XendDomain.py	Mon Dec 04 14:13:50 2006 +0900
@@ -44,6 +44,7 @@ from xen.xend.XendDevices import XendDev
 from xen.xend.XendDevices import XendDevices
 
 from xen.xend.xenstore.xstransact import xstransact
+from xen.xend.xenstore.xsutil import GetDomainPath
 from xen.xend.xenstore.xswatch import xswatch
 from xen.util import mkdir, security
 from xen.xend import uuid
@@ -1378,6 +1379,33 @@ class XendDomain:
         except Exception, ex:
             raise XendError(str(ex))
 
+    def domain_send_init(self, domid):
+        """Send INIT interruption to a domain for ia64.
+
+        @param domid: Domain ID or Name
+        @type domid: int or string.
+        @raise XendError: failed to send INIT interruption
+        @raise XendInvalidDomain: Domain is not valid        
+        @rtype: 0
+        """
+        mch = os.uname()[4]
+        if mch != 'ia64':
+            raise XendError("This command is Xen/ia64 only")
+
+        dominfo = self.domain_lookup_nr(domid)
+        if not dominfo:
+            raise XendInvalidDomain(str(domid))
+
+        vmpath = xstransact.Read(GetDomainPath(dominfo.getDomid()), "vm")
+        ostype = xstransact.Read(vmpath, "image/ostype")
+        if ostype != 'hvm':
+            raise XendError("This command is HVM domain only")
+
+        try:
+            return xc.domain_send_init(dominfo.getDomid())
+        except Exception, ex:
+            raise XendError(str(ex))
+    
 
 def instance():
     """Singleton constructor. Use this instead of the class constructor.
diff -r 3bd721db6db5 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py	Sun Dec 03 17:44:14 2006 +0000
+++ b/tools/python/xen/xm/main.py	Mon Dec 04 14:13:50 2006 +0900
@@ -124,6 +124,7 @@ SUBCOMMAND_HELP = {
     'vcpu-set'    : ('<Domain> <vCPUs>',
                      'Set the number of active VCPUs for allowed for the'
                      ' domain.'),
+    'os-init'     : ('<Domain>', 'Send a INIT to a domain.'),
 
     # device commands
 
@@ -256,6 +257,7 @@ domain_commands = [
     "mem-max",
     "mem-set",
     "migrate",
+    "os-init",
     "pause",
     "reboot",
     "rename",
@@ -1174,6 +1176,11 @@ def xm_sysrq(args):
     req = args[1]
     server.xend.domain.send_sysrq(dom, req)    
 
+def xm_osinit(args):
+    arg_check(args, "os-init", 1)
+    dom = args[0]
+    server.xend.domain.send_init(dom)
+
 def xm_top(args):
     arg_check(args, "top", 0)
 
@@ -1486,6 +1493,7 @@ commands = {
     "uptime": xm_uptime,
     "suspend": xm_suspend,
     "list": xm_list,
+    "os-init": xm_osinit,
     # memory commands
     "mem-max": xm_mem_max,
     "mem-set": xm_mem_set,

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC] [PATCH 2/4][IA64][HVM] Windows 2003 server crashdump suppprt
  2006-12-04 10:43 [RFC] [PATCH 0/4][IA64][HVM] Windows 2003 server crashdump suppprt Masaki Kanno
  2006-12-04 10:43 ` [RFC] [PATCH 1/4][IA64][HVM] " Masaki Kanno
@ 2006-12-04 10:44 ` Masaki Kanno
  2006-12-04 10:44 ` [RFC] [PATCH 3/4][IA64][HVM] " Masaki Kanno
  2006-12-04 10:45 ` [RFC] [PATCH 4/4][IA64][HVM] " Masaki Kanno
  3 siblings, 0 replies; 5+ messages in thread
From: Masaki Kanno @ 2006-12-04 10:44 UTC (permalink / raw)
  To: xen-ia64-devel, xen-devel

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 25 bytes --]

[2/4]

Xen common side.


[-- Attachment #2: xm_osinit_xen_common_side.patch --]
[-- Type: application/octet-stream, Size: 1242 bytes --]

diff -r 3bd721db6db5 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Sun Dec 03 17:44:14 2006 +0000
+++ b/xen/include/public/domctl.h	Mon Dec 04 14:13:50 2006 +0900
@@ -355,12 +355,14 @@ typedef struct xen_domctl_ioport_permiss
 typedef struct xen_domctl_ioport_permission xen_domctl_ioport_permission_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_ioport_permission_t);
 
+
 #define XEN_DOMCTL_hypercall_init    22
 struct xen_domctl_hypercall_init {
     uint64_t  gmfn;            /* GMFN to be initialised */
 };
 typedef struct xen_domctl_hypercall_init xen_domctl_hypercall_init_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_hypercall_init_t);
+
 
 #define XEN_DOMCTL_arch_setup        23
 #define _XEN_DOMAINSETUP_hvm_guest 0
@@ -378,12 +380,17 @@ typedef struct xen_domctl_arch_setup {
 } xen_domctl_arch_setup_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_arch_setup_t);
 
+
 #define XEN_DOMCTL_settimeoffset     24
 struct xen_domctl_settimeoffset {
     int32_t  time_offset_seconds; /* applied to domain wallclock time */
 };
 typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t);
+
+
+#define XEN_DOMCTL_send_init         26
+
 
 struct xen_domctl {
     uint32_t cmd;

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC] [PATCH 3/4][IA64][HVM] Windows 2003 server crashdump suppprt
  2006-12-04 10:43 [RFC] [PATCH 0/4][IA64][HVM] Windows 2003 server crashdump suppprt Masaki Kanno
  2006-12-04 10:43 ` [RFC] [PATCH 1/4][IA64][HVM] " Masaki Kanno
  2006-12-04 10:44 ` [RFC] [PATCH 2/4][IA64][HVM] " Masaki Kanno
@ 2006-12-04 10:44 ` Masaki Kanno
  2006-12-04 10:45 ` [RFC] [PATCH 4/4][IA64][HVM] " Masaki Kanno
  3 siblings, 0 replies; 5+ messages in thread
From: Masaki Kanno @ 2006-12-04 10:44 UTC (permalink / raw)
  To: xen-ia64-devel, xen-devel

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 28 bytes --]

[3/4]

Xen arch/ia64 side.


[-- Attachment #2: xm_osinit_xen_arch-ia64_side.patch --]
[-- Type: application/octet-stream, Size: 3947 bytes --]

diff -r 3bd721db6db5 xen/arch/ia64/vmx/mmio.c
--- a/xen/arch/ia64/vmx/mmio.c	Sun Dec 03 17:44:14 2006 +0000
+++ b/xen/arch/ia64/vmx/mmio.c	Mon Dec 04 14:13:50 2006 +0900
@@ -386,7 +386,7 @@ memread_p(VCPU *vcpu, u64 *src, u64 *des
  */
 #define PAL_INIT_ENTRY 0x80000000ffffffa0
 #define PSR_SET_BITS (IA64_PSR_DT | IA64_PSR_IT | IA64_PSR_RT |	\
-                      IA64_PSR_IC | IA64_PSR_RI)
+                      IA64_PSR_IC | IA64_PSR_RI | IA64_PSR_I)
 
 static void vmx_inject_guest_pal_init(VCPU *vcpu)
 {
@@ -433,6 +433,14 @@ static void deliver_ipi (VCPU *vcpu, uin
         panic_domain (NULL, "Deliver reserved IPI!\n");
         break;
     }
+}
+
+/*
+ * Deliver the INIT interruption to guest.
+ */
+void deliver_pal_init(VCPU *vcpu)
+{
+    deliver_ipi(vcpu, 5, 0);
 }
 
 /*
diff -r 3bd721db6db5 xen/arch/ia64/vmx/vlsapic.c
--- a/xen/arch/ia64/vmx/vlsapic.c	Sun Dec 03 17:44:14 2006 +0000
+++ b/xen/arch/ia64/vmx/vlsapic.c	Mon Dec 04 14:13:50 2006 +0900
@@ -586,6 +586,18 @@ chk_irq_exit:
 }
 
 /*
+ * Set a INIT interruption request to vcpu[0] of target domain.
+ * The INIT interruption is injected into each vcpu by guest firmware.
+ */
+vmx_pend_pal_init(struct domain *d)
+{
+    VCPU *vcpu;
+
+    vcpu = d->vcpu[0];
+    vcpu->arch.arch_vmx.pal_init_pending = 1;
+}
+
+/*
  * Only coming from virtualization fault.
  */
 void guest_write_eoi(VCPU *vcpu)
diff -r 3bd721db6db5 xen/arch/ia64/vmx/vmx_process.c
--- a/xen/arch/ia64/vmx/vmx_process.c	Sun Dec 03 17:44:14 2006 +0000
+++ b/xen/arch/ia64/vmx/vmx_process.c	Mon Dec 04 14:13:50 2006 +0900
@@ -225,6 +225,12 @@ void leave_hypervisor_tail(struct pt_reg
         if (v->vcpu_id == 0) {
             int callback_irq =
                 d->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
+            if ( v->arch.arch_vmx.pal_init_pending ) {
+                /*inject INIT interruption to guest pal*/
+                v->arch.arch_vmx.pal_init_pending = 0;
+                deliver_pal_init(v);
+                return;
+            }
             if (callback_irq != 0 && local_events_need_delivery()) {
                 /*inject para-device call back irq*/
                 v->vcpu_info->evtchn_upcall_mask = 1;
diff -r 3bd721db6db5 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c	Sun Dec 03 17:44:14 2006 +0000
+++ b/xen/arch/ia64/xen/dom0_ops.c	Mon Dec 04 14:13:50 2006 +0900
@@ -170,6 +170,20 @@ long arch_do_domctl(xen_domctl_t *op, XE
         put_domain(d);
     }
     break;
+
+    case XEN_DOMCTL_send_init:
+    {
+        struct domain *d = find_domain_by_id(op->domain);
+
+        if ( d == NULL ) {
+            ret = -ESRCH;
+            break;
+        }
+        vmx_pend_pal_init(d);
+        put_domain(d);
+    }
+    break;
+
     default:
         printk("arch_do_domctl: unrecognized domctl: %d!!!\n",op->cmd);
         ret = -ENOSYS;
diff -r 3bd721db6db5 xen/include/asm-ia64/vmx.h
--- a/xen/include/asm-ia64/vmx.h	Sun Dec 03 17:44:14 2006 +0000
+++ b/xen/include/asm-ia64/vmx.h	Mon Dec 04 14:13:50 2006 +0900
@@ -56,6 +56,8 @@ extern void vmx_die_if_kernel(char *str,
 extern void vmx_die_if_kernel(char *str, struct pt_regs *regs, long err);
 extern void vmx_send_assist_req(struct vcpu *v);
 extern void vmx_vioapic_set_irq(struct domain *d, int irq, int level);
+extern void deliver_pal_init(struct vcpu *vcpu);
+extern void vmx_pend_pal_init(struct domain *d);
 
 static inline vcpu_iodata_t *get_vio(struct domain *d, unsigned long cpu)
 {
diff -r 3bd721db6db5 xen/include/asm-ia64/vmx_vpd.h
--- a/xen/include/asm-ia64/vmx_vpd.h	Sun Dec 03 17:44:14 2006 +0000
+++ b/xen/include/asm-ia64/vmx_vpd.h	Mon Dec 04 14:13:50 2006 +0900
@@ -104,6 +104,7 @@ struct arch_vmx_struct {
 //	unsigned long	in_service[4];	// vLsapic inservice IRQ bits
     unsigned long   flags;
     unsigned long   xen_port;
+    char pal_init_pending;
 #ifdef VTI_DEBUG
     unsigned long  ivt_current;
     struct ivt_debug ivt_debug[IVT_DEBUG_MAX];

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC] [PATCH 4/4][IA64][HVM] Windows 2003 server crashdump suppprt
  2006-12-04 10:43 [RFC] [PATCH 0/4][IA64][HVM] Windows 2003 server crashdump suppprt Masaki Kanno
                   ` (2 preceding siblings ...)
  2006-12-04 10:44 ` [RFC] [PATCH 3/4][IA64][HVM] " Masaki Kanno
@ 2006-12-04 10:45 ` Masaki Kanno
  3 siblings, 0 replies; 5+ messages in thread
From: Masaki Kanno @ 2006-12-04 10:45 UTC (permalink / raw)
  To: xen-ia64-devel, xen-devel

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 20 bytes --]

[4/4]

Linux side.


[-- Attachment #2: xm_osinit_linux_side.patch --]
[-- Type: application/octet-stream, Size: 518 bytes --]

diff -r 3bd721db6db5 linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c	Sun Dec 03 17:44:14 2006 +0000
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c	Mon Dec 04 14:13:50 2006 +0900
@@ -303,6 +303,7 @@ xencomm_privcmd_domctl(privcmd_hypercall
 	case XEN_DOMCTL_hypercall_init:
 	case XEN_DOMCTL_arch_setup:
 	case XEN_DOMCTL_settimeoffset:
+	case XEN_DOMCTL_send_init:
 		break;
 	default:
 		printk("%s: unknown domctl cmd %d\n", __func__, kern_op.cmd);

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-12-04 10:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-04 10:43 [RFC] [PATCH 0/4][IA64][HVM] Windows 2003 server crashdump suppprt Masaki Kanno
2006-12-04 10:43 ` [RFC] [PATCH 1/4][IA64][HVM] " Masaki Kanno
2006-12-04 10:44 ` [RFC] [PATCH 2/4][IA64][HVM] " Masaki Kanno
2006-12-04 10:44 ` [RFC] [PATCH 3/4][IA64][HVM] " Masaki Kanno
2006-12-04 10:45 ` [RFC] [PATCH 4/4][IA64][HVM] " Masaki Kanno

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.