ia64/xen-unstable

changeset 14953:d0acb5a3e8d8

acm: Remove unecessary compat shim from do_acm_op().
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Apr 26 15:36:09 2007 +0100 (2007-04-26)
parents f8fd9afd2aad
children 58205257517d
files xen/arch/x86/x86_64/compat/entry.S xen/common/Makefile xen/common/acm_ops.c xen/common/compat/acm_ops.c xen/include/Makefile xen/include/xlat.lst
line diff
     1.1 --- a/xen/arch/x86/x86_64/compat/entry.S	Thu Apr 26 15:25:09 2007 +0100
     1.2 +++ b/xen/arch/x86/x86_64/compat/entry.S	Thu Apr 26 15:36:09 2007 +0100
     1.3 @@ -331,7 +331,7 @@ ENTRY(compat_hypercall_table)
     1.4          .quad compat_vcpu_op
     1.5          .quad compat_ni_hypercall       /* 25 */
     1.6          .quad compat_mmuext_op
     1.7 -        .quad compat_acm_op
     1.8 +        .quad do_acm_op
     1.9          .quad compat_nmi_op
    1.10          .quad compat_sched_op
    1.11          .quad compat_callback_op        /* 30 */
    1.12 @@ -374,7 +374,7 @@ ENTRY(compat_hypercall_args_table)
    1.13          .byte 3 /* compat_vcpu_op           */
    1.14          .byte 0 /* compat_ni_hypercall      */  /* 25 */
    1.15          .byte 4 /* compat_mmuext_op         */
    1.16 -        .byte 1 /* compat_acm_op            */
    1.17 +        .byte 1 /* do_acm_op                */
    1.18          .byte 2 /* compat_nmi_op            */
    1.19          .byte 2 /* compat_sched_op          */
    1.20          .byte 2 /* compat_callback_op       */  /* 30 */
     2.1 --- a/xen/common/Makefile	Thu Apr 26 15:25:09 2007 +0100
     2.2 +++ b/xen/common/Makefile	Thu Apr 26 15:36:09 2007 +0100
     2.3 @@ -43,7 +43,6 @@ version.o: $(BASEDIR)/include/xen/compil
     2.4  
     2.5  ifeq ($(CONFIG_COMPAT),y)
     2.6  # extra dependencies
     2.7 -acm_ops.o: compat/acm_ops.c
     2.8  grant_table.o: compat/grant_table.c
     2.9  kexec.o: compat/kexec.c
    2.10  schedule.o: compat/schedule.c
     3.1 --- a/xen/common/acm_ops.c	Thu Apr 26 15:25:09 2007 +0100
     3.2 +++ b/xen/common/acm_ops.c	Thu Apr 26 15:36:09 2007 +0100
     3.3 @@ -12,10 +12,8 @@
     3.4   * License.
     3.5   *
     3.6   * Process acm command requests from guest OS.
     3.7 - *
     3.8   */
     3.9  
    3.10 -#ifndef COMPAT
    3.11  #include <xen/config.h>
    3.12  #include <xen/types.h>
    3.13  #include <xen/lib.h>
    3.14 @@ -29,38 +27,25 @@
    3.15  #include <xen/guest_access.h>
    3.16  #include <acm/acm_hooks.h>
    3.17  
    3.18 -typedef long ret_t;
    3.19 -
    3.20 -#endif /* !COMPAT */
    3.21 -
    3.22  #ifndef ACM_SECURITY
    3.23  
    3.24 -
    3.25  long do_acm_op(int cmd, XEN_GUEST_HANDLE(void) arg)
    3.26  {
    3.27      return -ENOSYS;
    3.28  }
    3.29  
    3.30 -
    3.31  #else
    3.32  
    3.33 -
    3.34 -#ifndef COMPAT
    3.35  int acm_authorize_acm_ops(struct domain *d)
    3.36  {
    3.37 -    /* currently, policy management functions are restricted to privileged domains */
    3.38 -    if (!IS_PRIV(d))
    3.39 -        return -EPERM;
    3.40 -    return 0;
    3.41 +    return (IS_PRIV(d) ? 0 : -EPERM);
    3.42  }
    3.43 -#endif
    3.44 -
    3.45  
    3.46 -ret_t do_acm_op(int cmd, XEN_GUEST_HANDLE(void) arg)
    3.47 +long do_acm_op(int cmd, XEN_GUEST_HANDLE(void) arg)
    3.48  {
    3.49 -    ret_t rc = -EFAULT;
    3.50 +    long rc = -EFAULT;
    3.51  
    3.52 -    if (acm_authorize_acm_ops(current->domain))
    3.53 +    if ( acm_authorize_acm_ops(current->domain) )
    3.54          return -EPERM;
    3.55  
    3.56      switch ( cmd )
    3.57 @@ -226,11 +211,9 @@ ret_t do_acm_op(int cmd, XEN_GUEST_HANDL
    3.58  
    3.59          rc = acm_change_policy(&chgpolicy);
    3.60  
    3.61 -        if (rc == 0) {
    3.62 -            if (copy_to_guest(arg, &chgpolicy, 1) != 0) {
    3.63 +        if (rc == 0)
    3.64 +            if (copy_to_guest(arg, &chgpolicy, 1) != 0)
    3.65                  rc = -EFAULT;
    3.66 -            }
    3.67 -        }
    3.68          break;
    3.69      }
    3.70  
    3.71 @@ -244,11 +227,9 @@ ret_t do_acm_op(int cmd, XEN_GUEST_HANDL
    3.72  
    3.73          rc = acm_relabel_domains(&relabeldoms);
    3.74  
    3.75 -        if (rc == 0) {
    3.76 -            if (copy_to_guest(arg, &relabeldoms, 1) != 0) {
    3.77 +        if (rc == 0)
    3.78 +            if (copy_to_guest(arg, &relabeldoms, 1) != 0)
    3.79                  rc = -EFAULT;
    3.80 -            }
    3.81 -        }
    3.82          break;
    3.83      }
    3.84  
    3.85 @@ -260,11 +241,7 @@ ret_t do_acm_op(int cmd, XEN_GUEST_HANDL
    3.86      return rc;
    3.87  }
    3.88  
    3.89 -#endif
    3.90 -
    3.91 -#if defined(CONFIG_COMPAT) && !defined(COMPAT)
    3.92 -#include "compat/acm_ops.c"
    3.93 -#endif
    3.94 +#endif /* defined(ACM_SECURITY) */
    3.95  
    3.96  /*
    3.97   * Local variables:
     4.1 --- a/xen/common/compat/acm_ops.c	Thu Apr 26 15:25:09 2007 +0100
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,47 +0,0 @@
     4.4 -/******************************************************************************
     4.5 - * compat/acm_ops.c
     4.6 - */
     4.7 -
     4.8 -#include <compat/acm.h>
     4.9 -#include <compat/acm_ops.h>
    4.10 -
    4.11 -#define COMPAT
    4.12 -#define ret_t int
    4.13 -
    4.14 -#define do_acm_op compat_acm_op
    4.15 -
    4.16 -static inline XEN_GUEST_HANDLE(void) acm_xlat_handle(COMPAT_HANDLE(void) cmp)
    4.17 -{
    4.18 -    XEN_GUEST_HANDLE(void) nat;
    4.19 -
    4.20 -    guest_from_compat_handle(nat, cmp);
    4.21 -    return nat;
    4.22 -}
    4.23 -
    4.24 -#define acm_setpolicy compat_acm_setpolicy
    4.25 -#define acm_set_policy(h, sz) acm_set_policy(acm_xlat_handle(h), sz)
    4.26 -
    4.27 -#define acm_getpolicy compat_acm_getpolicy
    4.28 -#define acm_get_policy(h, sz) acm_get_policy(acm_xlat_handle(h), sz)
    4.29 -
    4.30 -#define acm_dumpstats compat_acm_dumpstats
    4.31 -#define acm_dump_statistics(h, sz) acm_dump_statistics(acm_xlat_handle(h), sz)
    4.32 -
    4.33 -#define acm_getssid compat_acm_getssid
    4.34 -#define acm_get_ssid(r, h, sz) acm_get_ssid(r, acm_xlat_handle(h), sz)
    4.35 -
    4.36 -#define xen_acm_getdecision acm_getdecision
    4.37 -CHECK_acm_getdecision;
    4.38 -#undef xen_acm_getdecision
    4.39 -
    4.40 -#include "../acm_ops.c"
    4.41 -
    4.42 -/*
    4.43 - * Local variables:
    4.44 - * mode: C
    4.45 - * c-set-style: "BSD"
    4.46 - * c-basic-offset: 4
    4.47 - * tab-width: 4
    4.48 - * indent-tabs-mode: nil
    4.49 - * End:
    4.50 - */
     5.1 --- a/xen/include/Makefile	Thu Apr 26 15:25:09 2007 +0100
     5.2 +++ b/xen/include/Makefile	Thu Apr 26 15:36:09 2007 +0100
     5.3 @@ -3,8 +3,6 @@ ifneq ($(CONFIG_COMPAT),)
     5.4  compat-arch-$(CONFIG_X86) := x86_32
     5.5  
     5.6  headers-y := \
     5.7 -    compat/acm.h \
     5.8 -    compat/acm_ops.h \
     5.9      compat/callback.h \
    5.10      compat/elfnote.h \
    5.11      compat/event_channel.h \
     6.1 --- a/xen/include/xlat.lst	Thu Apr 26 15:25:09 2007 +0100
     6.2 +++ b/xen/include/xlat.lst	Thu Apr 26 15:36:09 2007 +0100
     6.3 @@ -9,7 +9,6 @@
     6.4  !	cpu_user_regs			arch-x86/xen-@arch@.h
     6.5  !	trap_info			arch-x86/xen.h
     6.6  !	vcpu_guest_context		arch-x86/xen.h
     6.7 -?	acm_getdecision			acm_ops.h
     6.8  ?	evtchn_alloc_unbound		event_channel.h
     6.9  ?	evtchn_bind_interdomain		event_channel.h
    6.10  ?	evtchn_bind_ipi			event_channel.h