[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Make multicall state per-vcpu rather than per-cpu



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1289912503 0
# Node ID 894d10d315c2e714f7c3f2e4c0f12c3097e20d13
# Parent  07bbfe6dd27d51f2ace6dc1e127f899eee672ba6
Make multicall state per-vcpu rather than per-cpu

This is a prerequisite for allowing guest descheduling within a
hypercall.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---
 xen/arch/ia64/xen/hypercall.c   |    2 +-
 xen/arch/x86/domain.c           |    4 ++--
 xen/arch/x86/x86_64/compat/mm.c |    2 +-
 xen/common/domain.c             |   13 -------------
 xen/common/multicall.c          |    3 +--
 xen/common/schedule.c           |    1 -
 xen/include/xen/multicall.h     |    2 --
 xen/include/xen/sched.h         |    4 ++++
 8 files changed, 9 insertions(+), 22 deletions(-)

diff -r 07bbfe6dd27d -r 894d10d315c2 xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c     Tue Nov 16 12:42:35 2010 +0000
+++ b/xen/arch/ia64/xen/hypercall.c     Tue Nov 16 13:01:43 2010 +0000
@@ -419,7 +419,7 @@ unsigned long hypercall_create_continuat
 unsigned long hypercall_create_continuation(
        unsigned int op, const char *format, ...)
 {
-    struct mc_state *mcs = &this_cpu(mc_state);
+    struct mc_state *mcs = &current->mc_state;
     struct vcpu *v = current;
     const char *p = format;
     unsigned long arg;
diff -r 07bbfe6dd27d -r 894d10d315c2 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Tue Nov 16 12:42:35 2010 +0000
+++ b/xen/arch/x86/domain.c     Tue Nov 16 13:01:43 2010 +0000
@@ -1556,7 +1556,7 @@ unsigned long hypercall_create_continuat
 unsigned long hypercall_create_continuation(
     unsigned int op, const char *format, ...)
 {
-    struct mc_state *mcs = &this_cpu(mc_state);
+    struct mc_state *mcs = &current->mc_state;
     struct cpu_user_regs *regs;
     const char *p = format;
     unsigned long arg;
@@ -1638,7 +1638,7 @@ int hypercall_xlat_continuation(unsigned
 int hypercall_xlat_continuation(unsigned int *id, unsigned int mask, ...)
 {
     int rc = 0;
-    struct mc_state *mcs = &this_cpu(mc_state);
+    struct mc_state *mcs = &current->mc_state;
     struct cpu_user_regs *regs;
     unsigned int i, cval = 0;
     unsigned long nval = 0;
diff -r 07bbfe6dd27d -r 894d10d315c2 xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c   Tue Nov 16 12:42:35 2010 +0000
+++ b/xen/arch/x86/x86_64/compat/mm.c   Tue Nov 16 13:01:43 2010 +0000
@@ -308,7 +308,7 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mm
             if ( err == __HYPERVISOR_mmuext_op )
             {
                 struct cpu_user_regs *regs = guest_cpu_user_regs();
-                struct mc_state *mcs = &this_cpu(mc_state);
+                struct mc_state *mcs = &current->mc_state;
                 unsigned int arg1 = !test_bit(_MCSF_in_multicall, &mcs->flags)
                                     ? regs->ecx
                                     : mcs->call.args[1];
diff -r 07bbfe6dd27d -r 894d10d315c2 xen/common/domain.c
--- a/xen/common/domain.c       Tue Nov 16 12:42:35 2010 +0000
+++ b/xen/common/domain.c       Tue Nov 16 13:01:43 2010 +0000
@@ -495,19 +495,6 @@ void __domain_crash_synchronous(void)
 {
     __domain_crash(current->domain);
 
-    /*
-     * Flush multicall state before dying if a multicall is in progress.
-     * This shouldn't be necessary, but some architectures are calling
-     * domain_crash_synchronous() when they really shouldn't (i.e., from
-     * within hypercall context).
-     */
-    if ( this_cpu(mc_state).flags != 0 )
-    {
-        dprintk(XENLOG_ERR,
-                "FIXME: synchronous domain crash during a multicall!\n");
-        this_cpu(mc_state).flags = 0;
-    }
-
     vcpu_end_shutdown_deferral(current);
 
     for ( ; ; )
diff -r 07bbfe6dd27d -r 894d10d315c2 xen/common/multicall.c
--- a/xen/common/multicall.c    Tue Nov 16 12:42:35 2010 +0000
+++ b/xen/common/multicall.c    Tue Nov 16 13:01:43 2010 +0000
@@ -15,7 +15,6 @@
 #include <asm/hardirq.h>
 
 #ifndef COMPAT
-DEFINE_PER_CPU(struct mc_state, mc_state);
 typedef long ret_t;
 #define xlat_multicall_entry(mcs)
 #endif
@@ -24,7 +23,7 @@ do_multicall(
 do_multicall(
     XEN_GUEST_HANDLE(multicall_entry_t) call_list, unsigned int nr_calls)
 {
-    struct mc_state *mcs = &this_cpu(mc_state);
+    struct mc_state *mcs = &current->mc_state;
     unsigned int     i;
 
     if ( unlikely(__test_and_set_bit(_MCSF_in_multicall, &mcs->flags)) )
diff -r 07bbfe6dd27d -r 894d10d315c2 xen/common/schedule.c
--- a/xen/common/schedule.c     Tue Nov 16 12:42:35 2010 +0000
+++ b/xen/common/schedule.c     Tue Nov 16 13:01:43 2010 +0000
@@ -1048,7 +1048,6 @@ static void schedule(void)
     struct task_slice     next_slice;
 
     ASSERT(!in_irq());
-    ASSERT(this_cpu(mc_state).flags == 0);
 
     perfc_incr(sched_run);
 
diff -r 07bbfe6dd27d -r 894d10d315c2 xen/include/xen/multicall.h
--- a/xen/include/xen/multicall.h       Tue Nov 16 12:42:35 2010 +0000
+++ b/xen/include/xen/multicall.h       Tue Nov 16 13:01:43 2010 +0000
@@ -25,6 +25,4 @@ struct mc_state {
     };
 };
 
-DECLARE_PER_CPU(struct mc_state, mc_state);
-
 #endif /* __XEN_MULTICALL_H__ */
diff -r 07bbfe6dd27d -r 894d10d315c2 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h   Tue Nov 16 12:42:35 2010 +0000
+++ b/xen/include/xen/sched.h   Tue Nov 16 13:01:43 2010 +0000
@@ -25,6 +25,7 @@
 #include <public/mem_event.h>
 #include <xen/cpumask.h>
 #include <xen/nodemask.h>
+#include <xen/multicall.h>
 
 #ifdef CONFIG_COMPAT
 #include <compat/vcpu.h>
@@ -169,6 +170,9 @@ struct vcpu
     /* Tasklet for continue_hypercall_on_cpu(). */
     struct tasklet   continue_hypercall_tasklet;
 
+    /* Multicall information. */
+    struct mc_state  mc_state;
+
     struct arch_vcpu arch;
 };
 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.