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

[Xen-changelog] Remove DOM0_IOPL_PERMISSION since it doesn't make much sense.



ChangeSet 1.1356, 2005/03/23 18:18:19+00:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        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@xxxxxxxxxxxxx>



 arch/x86/dom0_ops.c       |   20 --------------------
 arch/x86/traps.c          |    3 ---
 common/physdev.c          |   21 +++++++++++----------
 include/asm-x86/domain.h  |    1 -
 include/public/dom0_ops.h |    9 +--------
 5 files changed, 12 insertions(+), 42 deletions(-)


diff -Nru a/xen/arch/x86/dom0_ops.c b/xen/arch/x86/dom0_ops.c
--- a/xen/arch/x86/dom0_ops.c   2005-03-23 14:03:10 -05:00
+++ b/xen/arch/x86/dom0_ops.c   2005-03-23 14:03:10 -05:00
@@ -136,26 +136,6 @@
     }
     break;
 
-    case DOM0_IOPL_PERMISSION:
-    {
-        struct domain *d;
-
-        ret = -EINVAL;
-        if ( op->u.iopl_permission.max_iopl > 3 )
-            break;
-
-        ret = -ESRCH;
-        if ( unlikely((d = find_domain_by_id(
-            op->u.iopl_permission.domain)) == NULL) )
-            break;
-
-        ret = 0;
-        d->arch.max_iopl = op->u.iopl_permission.max_iopl;
-
-        put_domain(d);
-    }
-    break;
-
     case DOM0_IOPORT_PERMISSION:
     {
         struct domain *d;
diff -Nru a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      2005-03-23 14:03:10 -05:00
+++ b/xen/arch/x86/traps.c      2005-03-23 14:03:10 -05:00
@@ -417,9 +417,6 @@
     struct domain *d = ed->domain;
     u16 x;
 
-    if ( IS_PRIV(d) || (d->arch.max_iopl >= (KERNEL_MODE(ed, regs) ? 1 : 3)) )
-        return 1;
-
     if ( d->arch.iobmp_mask != NULL )
     {
         x = *(u16 *)(d->arch.iobmp_mask + (port >> 3));
diff -Nru a/xen/common/physdev.c b/xen/common/physdev.c
--- a/xen/common/physdev.c      2005-03-23 14:03:10 -05:00
+++ b/xen/common/physdev.c      2005-03-23 14:03:10 -05:00
@@ -744,13 +744,17 @@
 
 
 /* Domain 0 has read access to all devices. */
-void physdev_init_dom0(struct domain *p)
+void physdev_init_dom0(struct domain *d)
 {
     struct pci_dev *dev;
     phys_dev_t *pdev;
 
-    INFO("Give DOM0 read access to all PCI devices\n");
+    /* Access to all I/O ports. */
+    d->arch.iobmp_mask = xmalloc_array(u8, IOBMP_BYTES);
+    BUG_ON(d->arch.iobmp_mask == NULL);
+    memset(d->arch.iobmp_mask, 0, IOBMP_BYTES);
 
+    /* Access to all PCI devices. */
     pci_for_each_dev(dev)
     {
         if ( pcidev_dom0_hidden(dev) )
@@ -759,20 +763,17 @@
             continue;
         }
 
-
-        if ( (pdev = xmalloc(phys_dev_t)) == NULL ) {
-            INFO("failed to allocate physical device structure!\n");
-            break;
-        }
+        pdev = xmalloc(phys_dev_t);
+        BUG_ON(pdev == NULL);
 
         pdev->dev = dev;
         pdev->flags = ACC_WRITE;
         pdev->state = 0;
-        pdev->owner = p;
-        list_add(&pdev->node, &p->pcidev_list);
+        pdev->owner = d;
+        list_add(&pdev->node, &d->pcidev_list);
     }
 
-    set_bit(DF_PHYSDEV, &p->d_flags);
+    set_bit(DF_PHYSDEV, &d->d_flags);
 }
 
 
diff -Nru a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h      2005-03-23 14:03:10 -05:00
+++ b/xen/include/asm-x86/domain.h      2005-03-23 14:03:10 -05:00
@@ -20,7 +20,6 @@
 
     /* I/O-port access bitmap mask. */
     u8 *iobmp_mask;       /* Address of IO bitmap mask, or NULL.      */
-    int max_iopl;         /* Maximum achievable IOPL. */
 
     /* shadow mode status and controls */
     unsigned int shadow_mode;  /* flags to control shadow table operation */
diff -Nru a/xen/include/public/dom0_ops.h b/xen/include/public/dom0_ops.h
--- a/xen/include/public/dom0_ops.h     2005-03-23 14:03:10 -05:00
+++ b/xen/include/public/dom0_ops.h     2005-03-23 14:03:10 -05:00
@@ -407,13 +407,7 @@
     u32     _pad0;
 } PACKED dom0_microcode_t; /* 16 bytes */
 
-#define DOM0_IOPL_PERMISSION     36
-typedef struct {
-    domid_t domain;                   /* 0: domain to be affected */
-    u16     max_iopl;                 /* 2: new effective IOPL limit */
-} PACKED dom0_iopl_permission_t; /* 4 bytes */
-
-#define DOM0_IOPORT_PERMISSION   37
+#define DOM0_IOPORT_PERMISSION   36
 typedef struct {
     domid_t domain;                   /* 0: domain to be affected */
     u16     first_port;               /* 2: first port int range */
@@ -455,7 +449,6 @@
         dom0_read_memtype_t      read_memtype;
         dom0_perfccontrol_t      perfccontrol;
         dom0_microcode_t         microcode;
-        dom0_iopl_permission_t   iopl_permission;
         dom0_ioport_permission_t ioport_permission;
     } PACKED u;
 } PACKED dom0_op_t; /* 80 bytes */


-------------------------------------------------------
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-changelog


 


Rackspace

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