WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [PATCH 3/7] vti save-restore: reap ioreq after resume

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH 3/7] vti save-restore: reap ioreq after resume
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Mon, 22 Oct 2007 16:29:50 +0900
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Delivery-date: Mon, 22 Oct 2007 00:30:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Date 1192528085 -32400
# Node ID 75280d0f64d5946bf0351a9f2cbc178b26696df1
# Parent  c45062957ef2e79bd7e4339fd25c9a1b2f02eea3
reap ioreq after resume. otherwise ioreq is left as STATE_IORESP_READY
so that the domain will be paniced.
PATCHNAME: reap_ioreq_after_restore

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r c45062957ef2 -r 75280d0f64d5 xen/arch/ia64/vmx/vmx_init.c
--- a/xen/arch/ia64/vmx/vmx_init.c      Mon Oct 22 11:47:39 2007 +0900
+++ b/xen/arch/ia64/vmx/vmx_init.c      Tue Oct 16 18:48:05 2007 +0900
@@ -430,7 +430,32 @@ int vmx_setup_platform(struct domain *d)
        return 0;
 }
 
-void vmx_do_launch(struct vcpu *v)
-{
+void vmx_do_resume(struct vcpu *v)
+{
+       ioreq_t *p;
+
        vmx_load_all_rr(v);
-}
+       migrate_timer(&v->arch.arch_vmx.vtm.vtm_timer, v->processor);
+
+       /* stolen from hvm_do_resume() in arch/x86/hvm/hvm.c */
+       /* NB. Optimised for common case (p->state == STATE_IOREQ_NONE). */
+       p = &get_vio(v->domain, v->vcpu_id)->vp_ioreq;
+       while (p->state != STATE_IOREQ_NONE) {
+               switch (p->state) {
+               case STATE_IORESP_READY: /* IORESP_READY -> NONE */
+                       vmx_io_assist(v);
+                       break;
+               case STATE_IOREQ_READY:
+               case STATE_IOREQ_INPROCESS:
+                       /* IOREQ_{READY,INPROCESS} -> IORESP_READY */
+                       wait_on_xen_event_channel(v->arch.arch_vmx.xen_port,
+                                         (p->state != STATE_IOREQ_READY) &&
+                                         (p->state != STATE_IOREQ_INPROCESS));
+                       break;
+               default:
+                       gdprintk(XENLOG_ERR,
+                                "Weird HVM iorequest state %d.\n", p->state);
+                       domain_crash_synchronous();
+               }
+       }
+}
diff -r c45062957ef2 -r 75280d0f64d5 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Mon Oct 22 11:47:39 2007 +0900
+++ b/xen/arch/ia64/xen/domain.c        Tue Oct 16 18:48:05 2007 +0900
@@ -203,11 +203,9 @@ void schedule_tail(struct vcpu *prev)
        context_saved(prev);
        ia64_disable_vhpt_walker();
 
-       if (VMX_DOMAIN(current)) {
-               vmx_do_launch(current);
-               migrate_timer(&current->arch.arch_vmx.vtm.vtm_timer,
-                             current->processor);
-       } else {
+       if (VMX_DOMAIN(current))
+               vmx_do_resume(current);
+       else {
                if (VMX_DOMAIN(prev))
                        ia64_set_iva(&ia64_ivt);
                load_region_regs(current);
diff -r c45062957ef2 -r 75280d0f64d5 xen/include/asm-ia64/vmx.h
--- a/xen/include/asm-ia64/vmx.h        Mon Oct 22 11:47:39 2007 +0900
+++ b/xen/include/asm-ia64/vmx.h        Tue Oct 16 18:48:05 2007 +0900
@@ -34,7 +34,7 @@ extern void vmx_save_state(struct vcpu *
 extern void vmx_save_state(struct vcpu *v);
 extern void vmx_load_state(struct vcpu *v);
 extern int vmx_setup_platform(struct domain *d);
-extern void vmx_do_launch(struct vcpu *v);
+extern void vmx_do_resume(struct vcpu *v);
 extern void vmx_io_assist(struct vcpu *v);
 extern int ia64_hypercall (struct pt_regs *regs);
 extern void vmx_save_state(struct vcpu *v);

Attachment: 16180_75280d0f64d5_reap_ioreq_after_restore.patch
Description: Text Data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH 3/7] vti save-restore: reap ioreq after resume, Isaku Yamahata <=