ia64/xen-unstable

changeset 15753:e9a5c6b2acbe

xen: Cache 'current' vcpu in physdev_op hcall implementation.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author kfraser@localhost.localdomain
date Tue Aug 14 15:58:16 2007 +0100 (2007-08-14)
parents ef79bf6f0142
children 0d367c186e8c
files xen/arch/x86/physdev.c
line diff
     1.1 --- a/xen/arch/x86/physdev.c	Tue Aug 14 09:56:46 2007 +0100
     1.2 +++ b/xen/arch/x86/physdev.c	Tue Aug 14 15:58:16 2007 +0100
     1.3 @@ -28,6 +28,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
     1.4  {
     1.5      int irq;
     1.6      ret_t ret;
     1.7 +    struct vcpu *v = current;
     1.8  
     1.9      switch ( cmd )
    1.10      {
    1.11 @@ -36,13 +37,13 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
    1.12          ret = -EFAULT;
    1.13          if ( copy_from_guest(&eoi, arg, 1) != 0 )
    1.14              break;
    1.15 -        ret = pirq_guest_eoi(current->domain, eoi.irq);
    1.16 +        ret = pirq_guest_eoi(v->domain, eoi.irq);
    1.17          break;
    1.18      }
    1.19  
    1.20      /* Legacy since 0x00030202. */
    1.21      case PHYSDEVOP_IRQ_UNMASK_NOTIFY: {
    1.22 -        ret = pirq_guest_unmask(current->domain);
    1.23 +        ret = pirq_guest_unmask(v->domain);
    1.24          break;
    1.25      }
    1.26  
    1.27 @@ -70,7 +71,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
    1.28          if ( copy_from_guest(&apic, arg, 1) != 0 )
    1.29              break;
    1.30          ret = -EPERM;
    1.31 -        if ( !IS_PRIV(current->domain) )
    1.32 +        if ( !IS_PRIV(v->domain) )
    1.33              break;
    1.34          ret = ioapic_guest_read(apic.apic_physbase, apic.reg, &apic.value);
    1.35          if ( copy_to_guest(arg, &apic, 1) != 0 )
    1.36 @@ -84,7 +85,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
    1.37          if ( copy_from_guest(&apic, arg, 1) != 0 )
    1.38              break;
    1.39          ret = -EPERM;
    1.40 -        if ( !IS_PRIV(current->domain) )
    1.41 +        if ( !IS_PRIV(v->domain) )
    1.42              break;
    1.43          ret = ioapic_guest_write(apic.apic_physbase, apic.reg, apic.value);
    1.44          break;
    1.45 @@ -98,7 +99,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
    1.46              break;
    1.47  
    1.48          ret = -EPERM;
    1.49 -        if ( !IS_PRIV(current->domain) )
    1.50 +        if ( !IS_PRIV(v->domain) )
    1.51              break;
    1.52  
    1.53          irq = irq_op.irq;
    1.54 @@ -120,7 +121,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
    1.55          if ( set_iopl.iopl > 3 )
    1.56              break;
    1.57          ret = 0;
    1.58 -        current->arch.iopl = set_iopl.iopl;
    1.59 +        v->arch.iopl = set_iopl.iopl;
    1.60          break;
    1.61      }
    1.62  
    1.63 @@ -135,11 +136,11 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
    1.64              break;
    1.65          ret = 0;
    1.66  #ifndef COMPAT
    1.67 -        current->arch.iobmp       = set_iobitmap.bitmap;
    1.68 +        v->arch.iobmp       = set_iobitmap.bitmap;
    1.69  #else
    1.70 -        guest_from_compat_handle(current->arch.iobmp, set_iobitmap.bitmap);
    1.71 +        guest_from_compat_handle(v->arch.iobmp, set_iobitmap.bitmap);
    1.72  #endif
    1.73 -        current->arch.iobmp_limit = set_iobitmap.nr_ports;
    1.74 +        v->arch.iobmp_limit = set_iobitmap.nr_ports;
    1.75          break;
    1.76      }
    1.77