ia64/xen-unstable

changeset 4280:467573b27a0e

bitkeeper revision 1.1236.1.120 (4241b2ebBzxqlRsKYsrNIy3_dpl_oA)

Remove DOM0_IOPL_PERMISSION since it doesn't make much sense.
All admin checks go throu the bitmap mask. Even privileged domains
(inc. domain0) must have a mask.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Mar 23 18:18:19 2005 +0000 (2005-03-23)
parents 9f302fdb83a9
children 4e75e4b2a644
files xen/arch/x86/dom0_ops.c xen/arch/x86/traps.c xen/common/physdev.c xen/include/asm-x86/domain.h xen/include/public/dom0_ops.h
line diff
     1.1 --- a/xen/arch/x86/dom0_ops.c	Wed Mar 23 16:16:02 2005 +0000
     1.2 +++ b/xen/arch/x86/dom0_ops.c	Wed Mar 23 18:18:19 2005 +0000
     1.3 @@ -136,26 +136,6 @@ long arch_do_dom0_op(dom0_op_t *op, dom0
     1.4      }
     1.5      break;
     1.6  
     1.7 -    case DOM0_IOPL_PERMISSION:
     1.8 -    {
     1.9 -        struct domain *d;
    1.10 -
    1.11 -        ret = -EINVAL;
    1.12 -        if ( op->u.iopl_permission.max_iopl > 3 )
    1.13 -            break;
    1.14 -
    1.15 -        ret = -ESRCH;
    1.16 -        if ( unlikely((d = find_domain_by_id(
    1.17 -            op->u.iopl_permission.domain)) == NULL) )
    1.18 -            break;
    1.19 -
    1.20 -        ret = 0;
    1.21 -        d->arch.max_iopl = op->u.iopl_permission.max_iopl;
    1.22 -
    1.23 -        put_domain(d);
    1.24 -    }
    1.25 -    break;
    1.26 -
    1.27      case DOM0_IOPORT_PERMISSION:
    1.28      {
    1.29          struct domain *d;
     2.1 --- a/xen/arch/x86/traps.c	Wed Mar 23 16:16:02 2005 +0000
     2.2 +++ b/xen/arch/x86/traps.c	Wed Mar 23 18:18:19 2005 +0000
     2.3 @@ -417,9 +417,6 @@ static inline int admin_io_okay(
     2.4      struct domain *d = ed->domain;
     2.5      u16 x;
     2.6  
     2.7 -    if ( IS_PRIV(d) || (d->arch.max_iopl >= (KERNEL_MODE(ed, regs) ? 1 : 3)) )
     2.8 -        return 1;
     2.9 -
    2.10      if ( d->arch.iobmp_mask != NULL )
    2.11      {
    2.12          x = *(u16 *)(d->arch.iobmp_mask + (port >> 3));
     3.1 --- a/xen/common/physdev.c	Wed Mar 23 16:16:02 2005 +0000
     3.2 +++ b/xen/common/physdev.c	Wed Mar 23 18:18:19 2005 +0000
     3.3 @@ -744,13 +744,17 @@ static int pcidev_dom0_hidden(struct pci
     3.4  
     3.5  
     3.6  /* Domain 0 has read access to all devices. */
     3.7 -void physdev_init_dom0(struct domain *p)
     3.8 +void physdev_init_dom0(struct domain *d)
     3.9  {
    3.10      struct pci_dev *dev;
    3.11      phys_dev_t *pdev;
    3.12  
    3.13 -    INFO("Give DOM0 read access to all PCI devices\n");
    3.14 +    /* Access to all I/O ports. */
    3.15 +    d->arch.iobmp_mask = xmalloc_array(u8, IOBMP_BYTES);
    3.16 +    BUG_ON(d->arch.iobmp_mask == NULL);
    3.17 +    memset(d->arch.iobmp_mask, 0, IOBMP_BYTES);
    3.18  
    3.19 +    /* Access to all PCI devices. */
    3.20      pci_for_each_dev(dev)
    3.21      {
    3.22          if ( pcidev_dom0_hidden(dev) )
    3.23 @@ -759,20 +763,17 @@ void physdev_init_dom0(struct domain *p)
    3.24              continue;
    3.25          }
    3.26  
    3.27 -
    3.28 -        if ( (pdev = xmalloc(phys_dev_t)) == NULL ) {
    3.29 -            INFO("failed to allocate physical device structure!\n");
    3.30 -            break;
    3.31 -        }
    3.32 +        pdev = xmalloc(phys_dev_t);
    3.33 +        BUG_ON(pdev == NULL);
    3.34  
    3.35          pdev->dev = dev;
    3.36          pdev->flags = ACC_WRITE;
    3.37          pdev->state = 0;
    3.38 -        pdev->owner = p;
    3.39 -        list_add(&pdev->node, &p->pcidev_list);
    3.40 +        pdev->owner = d;
    3.41 +        list_add(&pdev->node, &d->pcidev_list);
    3.42      }
    3.43  
    3.44 -    set_bit(DF_PHYSDEV, &p->d_flags);
    3.45 +    set_bit(DF_PHYSDEV, &d->d_flags);
    3.46  }
    3.47  
    3.48  
     4.1 --- a/xen/include/asm-x86/domain.h	Wed Mar 23 16:16:02 2005 +0000
     4.2 +++ b/xen/include/asm-x86/domain.h	Wed Mar 23 18:18:19 2005 +0000
     4.3 @@ -20,7 +20,6 @@ struct arch_domain
     4.4  
     4.5      /* I/O-port access bitmap mask. */
     4.6      u8 *iobmp_mask;       /* Address of IO bitmap mask, or NULL.      */
     4.7 -    int max_iopl;         /* Maximum achievable IOPL. */
     4.8  
     4.9      /* shadow mode status and controls */
    4.10      unsigned int shadow_mode;  /* flags to control shadow table operation */
     5.1 --- a/xen/include/public/dom0_ops.h	Wed Mar 23 16:16:02 2005 +0000
     5.2 +++ b/xen/include/public/dom0_ops.h	Wed Mar 23 18:18:19 2005 +0000
     5.3 @@ -407,13 +407,7 @@ typedef struct {
     5.4      u32     _pad0;
     5.5  } PACKED dom0_microcode_t; /* 16 bytes */
     5.6  
     5.7 -#define DOM0_IOPL_PERMISSION     36
     5.8 -typedef struct {
     5.9 -    domid_t domain;                   /* 0: domain to be affected */
    5.10 -    u16     max_iopl;                 /* 2: new effective IOPL limit */
    5.11 -} PACKED dom0_iopl_permission_t; /* 4 bytes */
    5.12 -
    5.13 -#define DOM0_IOPORT_PERMISSION   37
    5.14 +#define DOM0_IOPORT_PERMISSION   36
    5.15  typedef struct {
    5.16      domid_t domain;                   /* 0: domain to be affected */
    5.17      u16     first_port;               /* 2: first port int range */
    5.18 @@ -455,7 +449,6 @@ typedef struct {
    5.19          dom0_read_memtype_t      read_memtype;
    5.20          dom0_perfccontrol_t      perfccontrol;
    5.21          dom0_microcode_t         microcode;
    5.22 -        dom0_iopl_permission_t   iopl_permission;
    5.23          dom0_ioport_permission_t ioport_permission;
    5.24      } PACKED u;
    5.25  } PACKED dom0_op_t; /* 80 bytes */