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-changelog

[Xen-changelog] [xen-unstable] [HVM] No need to call hvm_do_resume() on

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [HVM] No need to call hvm_do_resume() on every vm entry.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 23 Oct 2006 13:10:15 +0000
Delivery-date: Mon, 23 Oct 2006 06:10:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 6f72d00fc1ece1473df04b8b53b9cb458d704f9b
# Parent  637eace6d5c64c52d6f8b521720aedb89e47c0a7
[HVM] No need to call hvm_do_resume() on every vm entry.
Original patch from Xin Li <xin.b.li@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c              |   11 ++++++++---
 xen/arch/x86/hvm/platform.c         |    3 ++-
 xen/arch/x86/hvm/svm/x86_32/exits.S |    3 ---
 xen/arch/x86/hvm/svm/x86_64/exits.S |    2 --
 xen/arch/x86/hvm/vmx/x86_32/exits.S |    3 ---
 xen/arch/x86/hvm/vmx/x86_64/exits.S |    2 --
 xen/include/xen/event.h             |    7 +++++++
 7 files changed, 17 insertions(+), 14 deletions(-)

diff -r 637eace6d5c6 -r 6f72d00fc1ec xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Mon Oct 23 11:20:37 2006 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Mon Oct 23 11:46:41 2006 +0100
@@ -237,12 +237,17 @@ void hvm_do_resume(struct vcpu *v)
     }
 
     p = &get_vio(v->domain, v->vcpu_id)->vp_ioreq;
-    wait_on_xen_event_channel(v->arch.hvm.xen_port,
+    wait_on_xen_event_channel(v->arch.hvm_vcpu.xen_port,
                               p->state != STATE_IOREQ_READY &&
                               p->state != STATE_IOREQ_INPROCESS);
-    if ( p->state == STATE_IORESP_READY )
+    switch ( p->state )
+    {
+    case STATE_IORESP_READY:
         hvm_io_assist(v);
-    if ( p->state != STATE_INVALID ) {
+        break;
+    case STATE_INVALID:
+        break;
+    default:
         printf("Weird HVM iorequest state %d.\n", p->state);
         domain_crash(v->domain);
     }
diff -r 637eace6d5c6 -r 6f72d00fc1ec xen/arch/x86/hvm/platform.c
--- a/xen/arch/x86/hvm/platform.c       Mon Oct 23 11:20:37 2006 +0100
+++ b/xen/arch/x86/hvm/platform.c       Mon Oct 23 11:46:41 2006 +0100
@@ -727,7 +727,8 @@ static void hvm_send_assist_req(struct v
         domain_crash(v->domain);
         return;
     }
-    wmb();
+
+    prepare_wait_on_xen_event_channel(v->arch.hvm_vcpu.xen_port);
     p->state = STATE_IOREQ_READY;
     notify_via_xen_event_channel(v->arch.hvm_vcpu.xen_port);
 }
diff -r 637eace6d5c6 -r 6f72d00fc1ec xen/arch/x86/hvm/svm/x86_32/exits.S
--- a/xen/arch/x86/hvm/svm/x86_32/exits.S       Mon Oct 23 11:20:37 2006 +0100
+++ b/xen/arch/x86/hvm/svm/x86_32/exits.S       Mon Oct 23 11:46:41 2006 +0100
@@ -139,9 +139,6 @@ ENTRY(svm_asm_do_resume)
 ENTRY(svm_asm_do_resume)
 svm_test_all_events:
         GET_CURRENT(%ebx)
-        pushl %ebx
-        call hvm_do_resume
-        addl $4, %esp
 /*test_all_events:*/
         xorl %ecx,%ecx
         notl %ecx
diff -r 637eace6d5c6 -r 6f72d00fc1ec xen/arch/x86/hvm/svm/x86_64/exits.S
--- a/xen/arch/x86/hvm/svm/x86_64/exits.S       Mon Oct 23 11:20:37 2006 +0100
+++ b/xen/arch/x86/hvm/svm/x86_64/exits.S       Mon Oct 23 11:46:41 2006 +0100
@@ -153,8 +153,6 @@ ENTRY(svm_asm_do_resume)
 ENTRY(svm_asm_do_resume)
 svm_test_all_events:
         GET_CURRENT(%rbx)
-        movq %rbx, %rdi
-        call hvm_do_resume
 /*test_all_events:*/
         cli                             # tests must not race interrupts
 /*test_softirqs:*/
diff -r 637eace6d5c6 -r 6f72d00fc1ec xen/arch/x86/hvm/vmx/x86_32/exits.S
--- a/xen/arch/x86/hvm/vmx/x86_32/exits.S       Mon Oct 23 11:20:37 2006 +0100
+++ b/xen/arch/x86/hvm/vmx/x86_32/exits.S       Mon Oct 23 11:46:41 2006 +0100
@@ -97,9 +97,6 @@ vmx_process_softirqs:
         ALIGN
 ENTRY(vmx_asm_do_vmentry)
         GET_CURRENT(%ebx)
-        pushl %ebx
-        call hvm_do_resume
-        addl $4, %esp
         cli                             # tests must not race interrupts
 
         movl VCPU_processor(%ebx),%eax
diff -r 637eace6d5c6 -r 6f72d00fc1ec xen/arch/x86/hvm/vmx/x86_64/exits.S
--- a/xen/arch/x86/hvm/vmx/x86_64/exits.S       Mon Oct 23 11:20:37 2006 +0100
+++ b/xen/arch/x86/hvm/vmx/x86_64/exits.S       Mon Oct 23 11:46:41 2006 +0100
@@ -106,8 +106,6 @@ vmx_process_softirqs:
         ALIGN
 ENTRY(vmx_asm_do_vmentry)
         GET_CURRENT(%rbx)
-        movq %rbx, %rdi
-        call hvm_do_resume
         cli                             # tests must not race interrupts
 
         movl  VCPU_processor(%rbx),%eax
diff -r 637eace6d5c6 -r 6f72d00fc1ec xen/include/xen/event.h
--- a/xen/include/xen/event.h   Mon Oct 23 11:20:37 2006 +0100
+++ b/xen/include/xen/event.h   Mon Oct 23 11:46:41 2006 +0100
@@ -70,4 +70,11 @@ void notify_via_xen_event_channel(int lp
         do_softirq();                                                   \
     } while ( 0 )
 
+#define prepare_wait_on_xen_event_channel(port)                         \
+    do {                                                                \
+        set_bit(_VCPUF_blocked_in_xen, &current->vcpu_flags);           \
+        raise_softirq(SCHEDULE_SOFTIRQ);                                \
+        mb(); /* set blocked status /then/ caller does his work */      \
+    } while ( 0 )
+
 #endif /* __XEN_EVENT_H__ */

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [HVM] No need to call hvm_do_resume() on every vm entry., Xen patchbot-unstable <=