ia64/xen-unstable

changeset 13376:aa127e545b73

[XEN] 32on64: need to take multicall context into consideration
when determining the continuation arguments for mmuext ops.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Emmanuel Ackaouy <ack@xensource.com>
date Wed Jan 10 17:26:58 2007 +0000 (2007-01-10)
parents 160ff08f8b1f
children b61be7771104
files xen/arch/x86/x86_64/compat/mm.c
line diff
     1.1 --- a/xen/arch/x86/x86_64/compat/mm.c	Wed Jan 10 16:17:35 2007 +0000
     1.2 +++ b/xen/arch/x86/x86_64/compat/mm.c	Wed Jan 10 17:26:58 2007 +0000
     1.3 @@ -1,6 +1,7 @@
     1.4  #ifdef CONFIG_COMPAT
     1.5  
     1.6  #include <xen/event.h>
     1.7 +#include <xen/multicall.h>
     1.8  #include <compat/memory.h>
     1.9  #include <compat/xen.h>
    1.10  
    1.11 @@ -289,20 +290,27 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mm
    1.12              if ( err == __HYPERVISOR_mmuext_op )
    1.13              {
    1.14                  struct cpu_user_regs *regs = guest_cpu_user_regs();
    1.15 -                unsigned int left = regs->ecx & ~MMU_UPDATE_PREEMPTED;
    1.16 +                struct mc_state *mcs = &this_cpu(mc_state);
    1.17 +                unsigned int arg1 = !test_bit(_MCSF_in_multicall, &mcs->flags)
    1.18 +                                    ? regs->ecx
    1.19 +                                    : mcs->call.args[1];
    1.20 +                unsigned int left = arg1 & ~MMU_UPDATE_PREEMPTED;
    1.21  
    1.22 -                BUG_ON(!(regs->ecx & MMU_UPDATE_PREEMPTED));
    1.23 +                BUG_ON(left == arg1);
    1.24                  BUG_ON(left > count);
    1.25                  guest_handle_add_offset(nat_ops, count - left);
    1.26                  BUG_ON(left + i < count);
    1.27                  guest_handle_add_offset(cmp_uops, (signed int)(count - left - i));
    1.28                  left = 1;
    1.29                  BUG_ON(!hypercall_xlat_continuation(&left, 0x01, nat_ops, cmp_uops));
    1.30 -                BUG_ON(left != regs->ecx);
    1.31 -                regs->ecx += count - i;
    1.32 +                BUG_ON(left != arg1);
    1.33 +                if (!test_bit(_MCSF_in_multicall, &mcs->flags))
    1.34 +                    regs->_ecx += count - i;
    1.35 +                else
    1.36 +                    mcs->compat_call.args[1] += count - i;
    1.37              }
    1.38              else
    1.39 -                BUG_ON(rc > 0);
    1.40 +                BUG_ON(err > 0);
    1.41              rc = err;
    1.42          }
    1.43