Skip to contentSkip to conversation

enable port accesses with (almost) full register context

PATCH Superseded Jan Beulich 2 participants 15 messages Sep 11, 2006 – Sep 18, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 enable port accesses with (almost) full register context

This helped HP getting certain system management software going (in dom0) that triggers SMIs and depends upon other than port number and data register values being visible to the SMI handler.

From: Jan Beulich
Bugzilla #192150

xen/arch/x86/domain.c +8 -1
Index: 2006-09-11/xen/arch/x86/domain.c
===================================================================
@@ -210,10 +210,17 @@ int arch_domain_create(struct domain *d)
     if ( !is_idle_domain(d) )
     {
         d->arch.ioport_caps = 
-            rangeset_new(d, "I/O Ports", RANGESETF_prettyprint_hex);
+            rangeset_new(d, "I/O Ports access control", RANGESETF_prettyprint_hex);
         if ( d->arch.ioport_caps == NULL )
             goto fail_nomem;
 
+        d->arch.ioport_normal = 
+            rangeset_new(d, "I/O Ports access mechanism", RANGESETF_prettyprint_hex);
+        if ( d->arch.ioport_normal == NULL )
+            goto fail_nomem;
+        if (ioports_set_normal(d, 0, 0xFFFF))
+            goto fail_nomem;
+
         if ( (d->shared_info = alloc_xenheap_page()) == NULL )
             goto fail_nomem;
 
xen/arch/x86/domain_build.c +48 -8

118 lines not on this page · raw message

xen/arch/x86/domctl.c +20 -3
Index: 2006-09-11/xen/arch/x86/domctl.c
===================================================================
@@ -62,10 +62,27 @@ long arch_do_domctl(
 
         if ( np == 0 )
             ret = 0;
-        else if ( domctl->u.ioport_permission.allow_access )
-            ret = ioports_permit_access(d, fp, fp + np - 1);
-        else
+        else switch ( domctl->u.ioport_permission.allow_access )
+        {
+        case IOPORT_ALLOW_ACCESS:
+            if ( ioports_any_access_permitted(fp, fp + np - 1) )
+                ret = ioports_permit_access(d, fp, fp + np - 1);
+            else
+                ret = -EPERM;
+            break;
+        case IOPORT_DENY_ACCESS:
             ret = ioports_deny_access(d, fp, fp + np - 1);
+            break;
+        case IOPORT_SET_NORMAL:
+            ret = ioports_set_normal(d, fp, fp + np - 1);
+            break;
+        case IOPORT_SET_SPECIAL:
+            ret = ioports_set_special(d, fp, fp + np - 1);
+            break;
+        default:
+            ret = -EINVAL;
+            break;
+        }
 
         put_domain(d);
     }
xen/arch/x86/traps.c +81 -21

150 lines not on this page · raw message

xen/arch/x86/x86_32/Makefile +1 -0
Index: 2006-09-11/xen/arch/x86/x86_32/Makefile
===================================================================
@@ -1,5 +1,6 @@
 obj-y += domain_page.o
 obj-y += entry.o
+obj-y += io.o
 obj-y += mm.o
 obj-y += seg_fixup.o
 obj-y += traps.o
xen/arch/x86/x86_32/io.S new file +163 -0

163 lines not on this page · raw message

xen/arch/x86/x86_64/Makefile +1 -0
Index: 2006-09-11/xen/arch/x86/x86_64/Makefile
===================================================================
@@ -1,3 +1,4 @@
 obj-y += entry.o
+obj-y += io.o
 obj-y += mm.o
 obj-y += traps.o
xen/arch/x86/x86_64/io.S new file +210 -0

210 lines not on this page · raw message

xen/include/asm-x86/domain.h +3 -0
Index: 2006-09-11/xen/include/asm-x86/domain.h
===================================================================
@@ -101,6 +101,9 @@ struct arch_domain
     /* I/O-port admin-specified access capabilities. */
     struct rangeset *ioport_caps;
 
+    /* I/O-port admin-specified non-special access requirements. */
+    struct rangeset *ioport_normal;
+
     /* HVM stuff */
     struct hvm_domain   hvm_domain;
 
xen/include/asm-x86/io.h +28 -24

66 lines not on this page · raw message

xen/include/asm-x86/iocap.h +16 -0
Index: 2006-09-11/xen/include/asm-x86/iocap.h
===================================================================
@@ -7,6 +7,15 @@
 #ifndef __X86_IOCAP_H__
 #define __X86_IOCAP_H__
 
+extern struct rangeset *global_ioport_caps;
+
+#define ioports_permit_access_all(s, e)                 \
+    rangeset_add_range(global_ioport_caps, s, e)
+#define ioports_deny_access_all(s, e)                   \
+    rangeset_remove_range(global_ioport_caps, s, e)
+#define ioports_any_access_permitted(s, e)              \
+    rangeset_contains_range(global_ioport_caps, s, e)
+
 #define ioports_permit_access(d, s, e)                  \
     rangeset_add_range((d)->arch.ioport_caps, s, e)
 #define ioports_deny_access(d, s, e)                    \
@@ -14,6 +23,13 @@
 #define ioports_access_permitted(d, s, e)               \
     rangeset_contains_range((d)->arch.ioport_caps, s, e)
 
+#define ioports_set_normal(d, s, e)                     \
+    rangeset_add_range((d)->arch.ioport_normal, s, e)
+#define ioports_set_special(d, s, e)                    \
+    rangeset_remove_range((d)->arch.ioport_normal, s, e)
+#define ioports_normal_access(d, s, e)                  \
+    rangeset_contains_range((d)->arch.ioport_normal, s, e)
+
 #define cache_flush_permitted(d)                       \
     (!rangeset_is_empty((d)->iomem_caps))
 
xen/include/public/domctl.h +4 -0
Index: 2006-09-11/xen/include/public/domctl.h
===================================================================
@@ -310,6 +310,10 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_iomem
 
 
 #define XEN_DOMCTL_ioport_permission 21
+#define IOPORT_DENY_ACCESS 0
+#define IOPORT_ALLOW_ACCESS 1
+#define IOPORT_SET_NORMAL 2
+#define IOPORT_SET_SPECIAL 3
 struct xen_domctl_ioport_permission {
     uint32_t first_port;              /* first port int range */
     uint32_t nr_ports;                /* size of port range */

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 3 lines · Jan Beulich

This helped HP getting certain system management software going (in dom0) that triggers SMIs and depends upon other than port number and data register values being visible to the SMI handler.

That's quite rough. The 'special' handlers do more than just register restore/save: what's all the locking and other assorted bits and pieces doing in there? The 'special/normal' distinction at the interface is (I suppose to some extent unavoidably) ugly and non-obvious.

Would it be cleaner to allow dom0 to have really direct access to some I/O ports by allowing it to set a real I/O bitmap? I implemented I/O bitmaps via emulation mainly because it makes context switching faster and it is less of a pain to keep admin and guest bitmasks in sync if they are checked synchronously. But a direct dom0-only bitmap would be a bit easier: quick to turn on/off and no need to sync with admin bitmaps. Main downside is that it'll slow down context-switch paths a little bit.

-- Keir

#2 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line

Keir Fraser <[email protected]> 11.09.06 18:19 >>>

Quoted 3 lines · Jan Beulich

This helped HP getting certain system management software going (in dom0) that triggers SMIs and depends upon other than port number and data register values being visible to the SMI handler.

That's quite rough. The 'special' handlers do more than just register restore/save: what's all the locking and other assorted bits and pieces doing in there? The 'special/normal' distinction at the interface is (I suppose to some extent unavoidably) ugly and non-obvious.

That is because of the self modifying code that needs proper MP synchronization. I know it's looking ugly, but I considered this the most reasonable approach.
I'm not sure I understand what ugliness you find in the special/normal distinction logic; one thing I'm thinking of is the additional meaning added to the hypercall interface - I simply didn't want to introduce a new sub-function there, especially since the existing one provided ample room for the needed addition. But certainly, if you want that changed, should be easily doable (even without significantly affecting HP's code already utilizing the interface as we added it to our 3.0.2).

Quoted 7 lines

Would it be cleaner to allow dom0 to have really direct access to some I/O ports by allowing it to set a real I/O bitmap? I implemented I/O bitmaps via emulation mainly because it makes context switching faster and it is less of a pain to keep admin and guest bitmasks in sync if they are checked synchronously. But a direct dom0-only bitmap would be a bit easier: quick to turn on/off and no need to sync with admin bitmaps. Main downside is that it'll slow down context-switch paths a little bit.

I considered that too, but rejected it because of opening these ports to vm86 mode then, too (as I/O instructions are *not* susceptible to iopl there, they only depend on the bitmap).

Jan

#3 lore raw
Quoted 3 lines · Jan Beulich

That is because of the self modifying code that needs proper MP synchronization. I know it's looking ugly, but I considered this the most reasonable approach.

Why is more synchonisation needed for emulation of these SMI port accesses than you'd have for direct execution? I.e., if the accesses were executed natively on an SMP system there'd be none of the extra synchronisation you added happening. The instructions would be directly executed.

Quoted 3 lines

I considered that too, but rejected it because of opening these ports to vm86 mode then, too (as I/O instructions are *not* susceptible to iopl there, they only depend on the bitmap).

I/O bitmap always overrides IOPL, in every execution mode. Why is vm86 mode a particular concern? I was thinking that dom0 would switch on the direct bitmap access only for the process(es) that requested it. We wouldn't want direct access to be available to every process in dom0.

Not that I'm certain direct access is better than 'special emulation'. But I'm not applying the existing patch unless I understand exactly why it needs to do everything that it does. I'm in no rush -- supporting some piece of HP closed-source management software isn't top priority for us, I'd say.

-- Keir

#4 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line

Keir Fraser <[email protected]> 12.09.06 09:53 >>>

Quoted 3 lines · Jan Beulich

That is because of the self modifying code that needs proper MP synchronization. I know it's looking ugly, but I considered this the most reasonable approach.

Why is more synchonisation needed for emulation of these SMI port accesses than you'd have for direct execution? I.e., if the accesses were executed natively on an SMP system there'd be none of the extra synchronisation you added happening. The instructions would be directly executed.

Again, I'm using self-modifying code there (to store the port number, as I can't reliably use %dx for it if the original instruction happened to be one with immediate operand, and %edx/%rdx happens to carry relevant data for the SMI handler), which is what needs synchronization.

Quoted 6 lines
Quoted 3 lines

I considered that too, but rejected it because of opening these ports to vm86 mode then, too (as I/O instructions are *not* susceptible to iopl there, they only depend on the bitmap).

I/O bitmap always overrides IOPL, in every execution mode. Why is vm86 mode a particular concern? I was thinking that dom0 would switch on the direct

You're right, of course - all modes are relevant here.

Quoted 2 lines

bitmap access only for the process(es) that requested it. We wouldn't want direct access to be available to every process in dom0.

True. With that I agree installing the bitmap in the TSS would allow solving the problem, too. Still I think the necessary overhead (you'd need to copy the bitmap and keep it sync-ed, or make it read-only, for the direct access to not be abusable) would be larger than using the special access method.

Quoted 4 lines

Not that I'm certain direct access is better than 'special emulation'. But I'm not applying the existing patch unless I understand exactly why it needs to do everything that it does. I'm in no rush -- supporting some piece of HP closed-source management software isn't top priority for us, I'd say.

Which I can easily understand; nevertheless I seem to recall that we had talked about the issue when it was first brought up (at least 3 months back), and you seemed in agreement that the nature of the problem warrants a fix.

Jan

#5 lore raw
Quoted 4 lines · Jan Beulich

Again, I'm using self-modifying code there (to store the port number, as I can't reliably use %dx for it if the original instruction happened to be one with immediate operand, and %edx/%rdx happens to carry relevant data for the SMI handler), which is what needs synchronization.

Ok, I see. I think it would be neater to build the code on the stack, or some other per-cpu area, and avoid the synchronisation. We have no plans to use the PAGE_NX flag in Xen itself, and x86/64 already has stack trampolines. Perhaps the register save/restore code could be tidied too, since it's not performance critical. It's not at all uniform like I'd expect, with those interleaved push/pop/mov instructions. How about something more like:
pushad; call restore_guest_regs; <I/o port access>; popad
Where restore_guest_regs takes a regparm, and (obviously) restores the regparm register last. I'd only do it as a call because it'd be ugly to dynamically build that amount of code.

I'm not sure about the full extent of the interface changes either. How about we add a new sysctl for specifying ports which need 'direct execution'. It makes sense to make it a sysctl because this is a property of the I/O port (or assumptions about it encoded in the platform firmware) rather than a per-domain issue, or something that I think should be visible at the physdev_op interface.

We'd test the per-port direct-execution flag for any port access by any domain. After all, the only reason we don't use the new code for *all* port accesses is concern about performance. I think calling this 'direct execution' versus 'emulation' at the interface is fair -- even though we emulate in all cases, in the former case it will be Xen's responsibility to do all that is necessary to make it appear to the BIOS that the instruction was executed directly, as when running natively.

-- Keir

#6 lore raw
Quoted 8 lines
Quoted 1 line
Quoted 1 line

Keir Fraser <[email protected]> 12.09.06 11:50 >>>

Quoted 4 lines · Jan Beulich

Again, I'm using self-modifying code there (to store the port number, as I can't reliably use %dx for it if the original instruction happened to be one with immediate operand, and %edx/%rdx happens to carry relevant data for the SMI handler), which is what needs synchronization.

Quoted 11 lines

Ok, I see. I think it would be neater to build the code on the stack, or some other per-cpu area, and avoid the synchronisation. We have no plans to use the PAGE_NX flag in Xen itself, and x86/64 already has stack trampolines. Perhaps the register save/restore code could be tidied too, since it's not performance critical. It's not at all uniform like I'd expect, with those interleaved push/pop/mov instructions. How about something more like:
pushad; call restore_guest_regs; <I/o port access>; popad
Where restore_guest_regs takes a regparm, and (obviously) restores the regparm register last. I'd only do it as a call because it'd be ugly to dynamically build that amount of code.

Hm, I don't like this on-the-fly building of code very much, and I also don't like writing assembly code that can obviously written to perform better. Also, on 64-bits the code wouldn't look so much nicer since there's no {push,pop}ad. But certainly, if you refuse to take the patch without changing that...

Quoted 7 lines

I'm not sure about the full extent of the interface changes either. How about we add a new sysctl for specifying ports which need 'direct execution'. It makes sense to make it a sysctl because this is a property of the I/O port (or assumptions about it encoded in the platform firmware) rather than a per-domain issue, or something that I think should be visible at the physdev_op interface.

Quoted 7 lines

We'd test the per-port direct-execution flag for any port access by any domain. After all, the only reason we don't use the new code for *all* port accesses is concern about performance. I think calling this 'direct execution' versus 'emulation' at the interface is fair -- even though we emulate in all cases, in the former case it will be Xen's responsibility to do all that is necessary to make it appear to the BIOS that the instruction was executed directly, as when running natively.

That sounds right (and better than the current way). I'll do that change, though I guess I'd still not call it direct execution.

Jan

#7 lore raw
Quoted 4 lines · Jan Beulich

Hm, I don't like this on-the-fly building of code very much, and I also don't like writing assembly code that can obviously written to perform better. Also, on 64-bits the code wouldn't look so much nicer since there's no {push,pop}ad. But certainly, if you refuse to take the patch without changing that...

IMO you're doing code building anyway, but just of one instruction. You get rid of the locking by doing it to a per-CPU buffer, and the stack is the obvious place, calling out to register save/restore code. I don't really care about the performance of the save/restore code -- it's obviously going to be trivial compared with the unavoidable trap-and-emulate cost. Also, do you need separate save/restore code for IN vs. OUT instructions?

Something like:
call save_host_restore_guest
<IN or OUT>
call save_guest_restore_host
ret

Would that be reasonable?

Quoted 2 lines

That sounds right (and better than the current way). I'll do that change, though I guess I'd still not call it direct execution.

'Special' is a crappy description because it's so non-specific. How about 'BIOS' ports? I can't think of any reason that emulating these accesses could be a problem, except that BIOS/firmware is trapping them and expecting more context than the hardware instruction defines as being required.

Alternatively, perhaps we could get rid of the distinction and emulate all port accesses in this way? I suspect that the cost of state save/restore and building the trampoline is dwarfed by the cost of the GPF and even the cost of the I/O port access itself (they don't tend to be super fast). Could you do a few quick measurements to determine this? If the extra cost is less than, say, 10%, I'd be inclined to take the hit to avoid interface changes.

-- Keir

#8 lore raw
Quoted 6 lines

IMO you're doing code building anyway, but just of one instruction. You get rid of the locking by doing it to a per-CPU buffer, and the stack is the obvious place, calling out to register save/restore code. I don't really care about the performance of the save/restore code -- it's obviously going to be trivial compared with the unavoidable trap-and-emulate cost. Also, do you need separate save/restore code for IN vs. OUT instructions?

Actually, in the code I currently have I do. This is because for out-s I need to merge the value output with the user-specified rAX, under the assumption that output value and register contents are not always identical (i.e. if particular bits within a port would need to be special treated by Xen, which I can easily imagine to be required at some point).

Quoted 7 lines

Something like:
call save_host_restore_guest
<IN or OUT>
call save_guest_restore_host
ret

Would that be reasonable?

It would, provided the above assumption about the need to modify the output value would never become true. Additionally, for 64-bits, I'm concerned about the potential need for using indirect calls here (as well as in the syscall trampolines): there's nothing keeping a user from making the Xen heap 2Gb or more in size. These would further slow things down, but depending on the nature of allocations made from the Xen heap it may also be possible to simply place an upper limit on the heap size, as it currently is assumed adjacent to the Xen image (but taking memory holes at rather low addresses into account a user may even be required to bump the heap size significantly - what if only a few Mb of memory below 4Gb existed? - since, after all, the heap size is the size of address space consumed, not the amount of memory used).

Quoted 6 lines

Alternatively, perhaps we could get rid of the distinction and emulate all port accesses in this way? I suspect that the cost of state save/restore and building the trampoline is dwarfed by the cost of the GPF and even the cost of the I/O port access itself (they don't tend to be super fast). Could you do a few quick measurements to determine this? If the extra cost is less than, say, 10%, I'd be inclined to take the hit to avoid interface changes.

Percentages of full-context relative to simply emulated i/o, without having changed the assembly file approach to the stub building one, yet (as per above issues):

PentiumIII (32-bit) with locking 67%
PentiumIII (32-bit) without locking 84%
Pentium4 (64-bit) with locking 86%
Pentium4 (64-bit) without locking 89%

Revised patch (domctl->sysctl, naming) attached.

Jan

From: Jan Beulich
Bugzilla #192150

xen/arch/x86/domain_build.c +56 -8
Index: 2006-09-11/xen/arch/x86/domain_build.c
===================================================================
@@ -33,6 +33,11 @@
 extern unsigned long initial_images_nrpages(void);
 extern void discard_initial_images(void);
 
+/* I/O-port Xen-enforced or admin-specified access control. */
+struct rangeset *ioport_caps = NULL;
+/* I/O-port admin-specified non-special access requirements. */
+struct rangeset *ioport_emul = NULL;
+
 static long dom0_nrpages;
 
 /*
@@ -64,6 +69,12 @@ integer_param("dom0_max_vcpus", opt_dom0
 static unsigned int opt_dom0_shadow;
 boolean_param("dom0_shadow", opt_dom0_shadow);
 
+static char opt_ioports_noemul[200] = "";
+string_param("ioports_noemul", opt_ioports_noemul);
+
+static char opt_ioports_disable[200] = "";
+string_param("ioports_disable", opt_ioports_disable);
+
 static char opt_dom0_ioports_disable[200] = "";
 string_param("dom0_ioports_disable", opt_dom0_ioports_disable);
 
@@ -102,10 +113,10 @@ static struct page_info *alloc_chunk(str
     return page;
 }
 
-static void process_dom0_ioports_disable(void)
+static void process_ioports(char *opt)
 {
     unsigned long io_from, io_to;
-    char *t, *u, *s = opt_dom0_ioports_disable;
+    char *t, *u, *s = opt;
 
     if ( *s == '\0' )
         return;
@@ -117,7 +128,9 @@ static void process_dom0_ioports_disable
         {
         parse_error:
             printk("Invalid ioport range <%s> "
-                   "in dom0_ioports_disable, skipping\n", t);
+                   "in %sioports_%s, skipping\n", t,
+                   opt == opt_dom0_ioports_disable ? "dom0_" : "",
+                   opt != opt_ioports_noemul ? "disable" : "noemul");
             continue;
         }
 
@@ -131,11 +144,26 @@ static void process_dom0_ioports_disable
         if ( (*u != '\0') || (io_to < io_from) || (io_to >= 65536) )
             goto parse_error;
 
-        printk("Disabling dom0 access to ioport range %04lx-%04lx\n",
-            io_from, io_to);
+        if ( opt != opt_ioports_noemul )
+        {
+            printk("Disabling %saccess to ioport range %04lx-%04lx\n",
+                opt != opt_ioports_disable ? "dom0 " : "",
+                io_from, io_to);
 
-        if ( ioports_deny_access(dom0, io_from, io_to) != 0 )
-            BUG();
+            if ( opt == opt_ioports_disable
+                 && ioports_deny_access_all(io_from, io_to) != 0 )
+                BUG();
+            if ( ioports_deny_access(dom0, io_from, io_to) != 0 )
+                BUG();
+        }
+        else
+        {
+            printk("Setting non-emulated access for ioport range %04lx-%04lx\n",
+                io_from, io_to);
+
+            if ( ioports_set_noemul(io_from, io_to) != 0 )
+                BUG();
+        }
     }
 }
 
@@ -815,6 +843,13 @@ int construct_dom0(struct domain *d,
 
     rc = 0;
 
+    /* Command-line I/O ranges. */
+    ioport_caps = rangeset_new(NULL,
+                               "global I/O Port access control",
+                               RANGESETF_prettyprint_hex);
+    BUG_ON(!ioport_caps);
+    rc |= ioports_permit_access_all(0, 0xFFFF);
+
     /* DOM0 is permitted full I/O capabilities. */
     rc |= ioports_permit_access(dom0, 0, 0xFFFF);
     rc |= iomem_permit_access(dom0, 0UL, ~0UL);
@@ -824,15 +859,20 @@ int construct_dom0(struct domain *d,
      * Modify I/O port access permissions.
      */
     /* Master Interrupt Controller (PIC). */
+    rc |= ioports_deny_access_all(0x20, 0x21);
     rc |= ioports_deny_access(dom0, 0x20, 0x21);
     /* Slave Interrupt Controller (PIC). */
+    rc |= ioports_deny_access_all(0xA0, 0xA1);
     rc |= ioports_deny_access(dom0, 0xA0, 0xA1);
     /* Interval Timer (PIT). */
+    rc |= ioports_deny_access_all(0x40, 0x43);
     rc |= ioports_deny_access(dom0, 0x40, 0x43);
     /* PIT Channel 2 / PC Speaker Control. */
+    rc |= ioports_deny_access_all(0x61, 0x61);
     rc |= ioports_deny_access(dom0, 0x61, 0x61);
     /* Command-line I/O ranges. */
-    process_dom0_ioports_disable();
+    process_ioports(opt_ioports_disable);
+    process_ioports(opt_dom0_ioports_disable);
 
     /*
      * Modify I/O memory access permissions.
@@ -851,6 +891,14 @@ int construct_dom0(struct domain *d,
             rc |= iomem_deny_access(dom0, mfn, mfn);
     }
 
+    /* Command-line I/O ranges requiring full register context access. */
+    ioport_emul = rangeset_new(NULL,
+                               "I/O Port emulation control",
+                               RANGESETF_prettyprint_hex);
+    BUG_ON(!ioport_emul);
+    rc |= ioports_set_emul(0, 0xFFFF);
+    process_ioports(opt_ioports_noemul);
+
     BUG_ON(rc != 0);
 
     return 0;
xen/arch/x86/sysctl.c +17 -0
Index: 2006-09-11/xen/arch/x86/sysctl.c
===================================================================
@@ -57,6 +57,23 @@ long arch_do_sysctl(
     }
     break;
     
+    case XEN_SYSCTL_ioport_emulation:
+    {
+        unsigned int fp = sysctl->u.ioport_emulation.first_port;
+        unsigned int np = sysctl->u.ioport_emulation.nr_ports;
+
+        ret = -EINVAL;
+        if ( (fp + np) > 65536 )
+            break;
+
+        if ( np == 0 )
+            ret = 0;
+        else if ( sysctl->u.ioport_emulation.emulate )
+            ret = ioports_set_emul(fp, fp + np - 1);
+        else
+            ret = ioports_set_noemul(fp, fp + np - 1);
+    }
+    break;
 
     default:
         ret = -ENOSYS;
xen/arch/x86/traps.c +81 -21

150 lines not on this page · raw message

xen/arch/x86/x86_32/Makefile +1 -0
Index: 2006-09-11/xen/arch/x86/x86_32/Makefile
===================================================================
@@ -1,5 +1,6 @@
 obj-y += domain_page.o
 obj-y += entry.o
+obj-y += io.o
 obj-y += mm.o
 obj-y += seg_fixup.o
 obj-y += traps.o
xen/arch/x86/x86_32/io.S new file +155 -0

155 lines not on this page · raw message

xen/arch/x86/x86_64/Makefile +1 -0
Index: 2006-09-11/xen/arch/x86/x86_64/Makefile
===================================================================
@@ -1,3 +1,4 @@
 obj-y += entry.o
+obj-y += io.o
 obj-y += mm.o
 obj-y += traps.o
xen/arch/x86/x86_64/io.S new file +202 -0

202 lines not on this page · raw message

xen/include/asm-x86/io.h +28 -24

66 lines not on this page · raw message

xen/include/asm-x86/iocap.h +16 -0
Index: 2006-09-11/xen/include/asm-x86/iocap.h
===================================================================
@@ -7,6 +7,15 @@
 #ifndef __X86_IOCAP_H__
 #define __X86_IOCAP_H__
 
+extern struct rangeset *ioport_caps, *ioport_emul;
+
+#define ioports_permit_access_all(s, e)                 \
+    rangeset_add_range(ioport_caps, s, e)
+#define ioports_deny_access_all(s, e)                   \
+    rangeset_remove_range(ioport_caps, s, e)
+#define ioports_any_access_permitted(s, e)              \
+    rangeset_contains_range(ioport_caps, s, e)
+
 #define ioports_permit_access(d, s, e)                  \
     rangeset_add_range((d)->arch.ioport_caps, s, e)
 #define ioports_deny_access(d, s, e)                    \
@@ -14,6 +23,13 @@
 #define ioports_access_permitted(d, s, e)               \
     rangeset_contains_range((d)->arch.ioport_caps, s, e)
 
+#define ioports_set_emul(s, e)                          \
+    rangeset_add_range(ioport_emul, s, e)
+#define ioports_set_noemul(s, e)                        \
+    rangeset_remove_range(ioport_emul, s, e)
+#define ioports_emul(s, e)                              \
+    rangeset_contains_range(ioport_emul, s, e)
+
 #define cache_flush_permitted(d)                       \
     (!rangeset_is_empty((d)->iomem_caps))
 
xen/include/public/sysctl.h +10 -0
Index: 2006-09-11/xen/include/public/sysctl.h
===================================================================
@@ -122,6 +122,15 @@ struct xen_sysctl_getdomaininfolist {
 typedef struct xen_sysctl_getdomaininfolist xen_sysctl_getdomaininfolist_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getdomaininfolist_t);
 
+#define XEN_SYSCTL_ioport_emulation 7
+struct xen_sysctl_ioport_emulation {
+    uint32_t first_port;              /* first port int range */
+    uint32_t nr_ports;                /* size of port range */
+    uint8_t  emulate;                 /* emulate access to range? */
+};
+typedef struct xen_sysctl_ioport_emulation xen_sysctl_ioport_emulation_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_ioport_emulation_t);
+
 struct xen_sysctl {
     uint32_t cmd;
     uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
@@ -132,6 +141,7 @@ struct xen_sysctl {
         struct xen_sysctl_sched_id          sched_id;
         struct xen_sysctl_perfc_op          perfc_op;
         struct xen_sysctl_getdomaininfolist getdomaininfolist;
+        struct xen_sysctl_ioport_emulation  ioport_emulation;
         uint8_t                             pad[128];
     } u;
 };

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#9 lore raw
Quoted 2 lines · Jan Beulich

It would, provided the above assumption about the need to modify the output value would never become true.

I hope it doesn't. :-) We'll cross this bridge if we come to it.

Quoted 4 lines

Additionally, for 64-bits, I'm
concerned about the potential need for using indirect calls here (as well as in the syscall trampolines): there's nothing keeping a user from making the Xen heap 2Gb or more in size.

Not much of a concern. Perhaps we should clamp the heap_size parameter to 2GB as a short-term fix for this issue. As you say, it can also affect the syscall trampolines so users would soon notice if this was broken!

When we merge Xen and domain heaps on x86/64, we'll probably require Xen allocations to come from a zone <= 2GB. Xen doesn't allocate much memory, so that's not going to be a particularly serious constraint.

Quoted 8 lines

Percentages of full-context relative to simply emulated i/o, without having changed the assembly file approach to the stub building one, yet (as per above issues):

PentiumIII (32-bit) with locking 67%
PentiumIII (32-bit) without locking 84%
Pentium4 (64-bit) with locking 86%
Pentium4 (64-bit) without locking 89%

A little bit higher overhead than I'd hoped, but not terrible. Let's see how it looks with the stub-building method, and then decide whether to bother with the sysctl interface. Perhaps highly-optimised assembly code save/restore routines will be required after all. :-)

Cheers,
Keir

Quoted 1 line

Revised patch (domctl->sysctl, naming) attached.

#10 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line

Keir Fraser <[email protected]> 13.09.06 14:10 >>>

Quoted 2 lines · Jan Beulich

It would, provided the above assumption about the need to modify the output value would never become true.

I hope it doesn't. :-) We'll cross this bridge if we come to it.

It'll be immediately needed if string I/O instructions are to also go that path, unless you'd want them to access the original user buffer (and trap the eventual page fault).

Also, I might need a little more clarification on the stack (ab)use for creating stubs: As I understand it, the double-fault and NMI stacks on x86-64 are currently simply overlaid on top of the normal stack, basically assuming you'd never use this much space (the one-page non-present separator is inserted only in debug builds). (Side note:
While for normal operations this is fine, I question the value of a double fault backtrace that might be created due to a stack overflow on a non-debug build. The obvious question is why the separator hole isn't always being created - after all this is a one time operation that happens as CPUs get brought up, so there shouldn't be any performance overhead.)

Anyway, the relationship to the stubs is that I would favor moving the stubs onto the double fault stack itself (rather than adjacent to the NMI stack, which in turn is adjacent to the double fault one), because
(a) the stubs won't be needed anymore once the double fault stack is needed and
(b) the stubs are this way farther away from the normal stack, making it less likely for difficult to debug problems to crop in. I would then similarly put the 32-bit I/O stubs onto the (top of the) (would-be double fault) stack (which should be per CPU as much as on 64-bits, but I realize that would imply per-CPU double fault TSSes and hence per-CPU GDTs).

Jan

#11 lore raw
Quoted 3 lines · Jan Beulich

It'll be immediately needed if string I/O instructions are to also go that path, unless you'd want them to access the original user buffer (and trap the eventual page fault).

We emulate INS/OUTS as a sequence of IN/OUT plus copy_to/from_guest. Unless the SMM code depends on us not having 'clobbered' %eax (which we would need to do to emulate OUTS with OUT) then we should be okay there. I guess how complicated the save/restore code needs to be depends on just how accurately we need to set up the register state for this HP SMM code -- for example, I guess we get away with SS:ESP being incorrect; can we get away with EAX as well? Hmm... I guess you have made your point that there are devils in the detail of doing this emulation. ;-)

Quoted 2 lines

Also, I might need a little more clarification on the stack (ab)use for creating stubs.

Just declare a char-array automatic variable, fill it with machine code, and call it.

-- Keir

#12 lore raw
Quoted 5 lines
Quoted 2 lines

Also, I might need a little more clarification on the stack (ab)use for creating stubs.

Just declare a char-array automatic variable, fill it with machine code, and call it.

Actually, I rather wanted to do static setup as much as possible and hence leave only the filling of the actual opcode to be done dynamically (at the price of inserting one or two nops).

Jan

#13 lore raw
Quoted 6 lines · Jan Beulich
Quoted 2 lines

Just declare a char-array automatic variable, fill it with machine code, and call it.

Actually, I rather wanted to do static setup as much as possible and hence leave only the filling of the actual opcode to be done dynamically (at the price of inserting one or two nops).

I think putting the static code in assembly functions and calling out to them from a dynamically-generated stub of machine code would be neatest.

It doesn't take much C code to generate:
call prologue; in/out; jmp epilogue

That's only about 12 bytes of generated code (assuming call/jmp rel32). Static calls/jumps are very cheap.

You can define the prologue/epilogue functions within the same .c file inside globally-defined asm() blocks.

-- Keir

#14 lore raw
In reply to Keir Fraser
Quoted 15 lines
Quoted 1 line
Quoted 1 line

Keir Fraser <[email protected]> 12.09.06 13:28 >>>

Quoted 4 lines · Jan Beulich

Hm, I don't like this on-the-fly building of code very much, and I also don't like writing assembly code that can obviously written to perform better. Also, on 64-bits the code wouldn't look so much nicer since there's no {push,pop}ad. But certainly, if you refuse to take the patch without changing that...

IMO you're doing code building anyway, but just of one instruction. You get rid of the locking by doing it to a per-CPU buffer, and the stack is the obvious place, calling out to register save/restore code. I don't really care about the performance of the save/restore code -- it's obviously going to be trivial compared with the unavoidable trap-and-emulate cost. Also, do you need separate save/restore code for IN vs. OUT instructions?

Quoted 7 lines

Something like:
call save_host_restore_guest
<IN or OUT>
call save_guest_restore_host
ret

Would that be reasonable?

Attaching the revised patch.

Quoted 8 lines
Quoted 2 lines

That sounds right (and better than the current way). I'll do that change, though I guess I'd still not call it direct execution.

'Special' is a crappy description because it's so non-specific. How about 'BIOS' ports? I can't think of any reason that emulating these accesses could be a problem, except that BIOS/firmware is trapping them and expecting more context than the hardware instruction defines as being required.

Quoted 6 lines

Alternatively, perhaps we could get rid of the distinction and emulate all port accesses in this way? I suspect that the cost of state save/restore and building the trampoline is dwarfed by the cost of the GPF and even the cost of the I/O port access itself (they don't tend to be super fast). Could you do a few quick measurements to determine this? If the extra cost is less than, say, 10%, I'd be inclined to take the hit to avoid interface changes.

The new measurement results (full context compared to normal emulation):

PentiumIII (32-bit) 88%
Pentium4 (64-bit) 90%

Jan

From: Jan Beulich
Bugzilla #192150

xen/arch/x86/domain_build.c +56 -8
Index: 2006-09-11/xen/arch/x86/domain_build.c
===================================================================
@@ -33,6 +33,11 @@
 extern unsigned long initial_images_nrpages(void);
 extern void discard_initial_images(void);
 
+/* I/O-port Xen-enforced or admin-specified access control. */
+struct rangeset *ioport_caps = NULL;
+/* I/O-port admin-specified non-special access requirements. */
+struct rangeset *ioport_emul = NULL;
+
 static long dom0_nrpages;
 
 /*
@@ -64,6 +69,12 @@ integer_param("dom0_max_vcpus", opt_dom0
 static unsigned int opt_dom0_shadow;
 boolean_param("dom0_shadow", opt_dom0_shadow);
 
+static char opt_ioports_noemul[200] = "";
+string_param("ioports_noemul", opt_ioports_noemul);
+
+static char opt_ioports_disable[200] = "";
+string_param("ioports_disable", opt_ioports_disable);
+
 static char opt_dom0_ioports_disable[200] = "";
 string_param("dom0_ioports_disable", opt_dom0_ioports_disable);
 
@@ -102,10 +113,10 @@ static struct page_info *alloc_chunk(str
     return page;
 }
 
-static void process_dom0_ioports_disable(void)
+static void process_ioports(char *opt)
 {
     unsigned long io_from, io_to;
-    char *t, *u, *s = opt_dom0_ioports_disable;
+    char *t, *u, *s = opt;
 
     if ( *s == '\0' )
         return;
@@ -117,7 +128,9 @@ static void process_dom0_ioports_disable
         {
         parse_error:
             printk("Invalid ioport range <%s> "
-                   "in dom0_ioports_disable, skipping\n", t);
+                   "in %sioports_%s, skipping\n", t,
+                   opt == opt_dom0_ioports_disable ? "dom0_" : "",
+                   opt != opt_ioports_noemul ? "disable" : "noemul");
             continue;
         }
 
@@ -131,11 +144,26 @@ static void process_dom0_ioports_disable
         if ( (*u != '\0') || (io_to < io_from) || (io_to >= 65536) )
             goto parse_error;
 
-        printk("Disabling dom0 access to ioport range %04lx-%04lx\n",
-            io_from, io_to);
+        if ( opt != opt_ioports_noemul )
+        {
+            printk("Disabling %saccess to ioport range %04lx-%04lx\n",
+                opt != opt_ioports_disable ? "dom0 " : "",
+                io_from, io_to);
 
-        if ( ioports_deny_access(dom0, io_from, io_to) != 0 )
-            BUG();
+            if ( opt == opt_ioports_disable
+                 && ioports_deny_access_all(io_from, io_to) != 0 )
+                BUG();
+            if ( ioports_deny_access(dom0, io_from, io_to) != 0 )
+                BUG();
+        }
+        else
+        {
+            printk("Setting non-emulated access for ioport range %04lx-%04lx\n",
+                io_from, io_to);
+
+            if ( ioports_set_noemul(io_from, io_to) != 0 )
+                BUG();
+        }
     }
 }
 
@@ -815,6 +843,13 @@ int construct_dom0(struct domain *d,
 
     rc = 0;
 
+    /* Command-line I/O ranges. */
+    ioport_caps = rangeset_new(NULL,
+                               "global I/O Port access control",
+                               RANGESETF_prettyprint_hex);
+    BUG_ON(!ioport_caps);
+    rc |= ioports_permit_access_all(0, 0xFFFF);
+
     /* DOM0 is permitted full I/O capabilities. */
     rc |= ioports_permit_access(dom0, 0, 0xFFFF);
     rc |= iomem_permit_access(dom0, 0UL, ~0UL);
@@ -824,15 +859,20 @@ int construct_dom0(struct domain *d,
      * Modify I/O port access permissions.
      */
     /* Master Interrupt Controller (PIC). */
+    rc |= ioports_deny_access_all(0x20, 0x21);
     rc |= ioports_deny_access(dom0, 0x20, 0x21);
     /* Slave Interrupt Controller (PIC). */
+    rc |= ioports_deny_access_all(0xA0, 0xA1);
     rc |= ioports_deny_access(dom0, 0xA0, 0xA1);
     /* Interval Timer (PIT). */
+    rc |= ioports_deny_access_all(0x40, 0x43);
     rc |= ioports_deny_access(dom0, 0x40, 0x43);
     /* PIT Channel 2 / PC Speaker Control. */
+    rc |= ioports_deny_access_all(0x61, 0x61);
     rc |= ioports_deny_access(dom0, 0x61, 0x61);
     /* Command-line I/O ranges. */
-    process_dom0_ioports_disable();
+    process_ioports(opt_ioports_disable);
+    process_ioports(opt_dom0_ioports_disable);
 
     /*
      * Modify I/O memory access permissions.
@@ -851,6 +891,14 @@ int construct_dom0(struct domain *d,
             rc |= iomem_deny_access(dom0, mfn, mfn);
     }
 
+    /* Command-line I/O ranges requiring full register context access. */
+    ioport_emul = rangeset_new(NULL,
+                               "I/O Port emulation control",
+                               RANGESETF_prettyprint_hex);
+    BUG_ON(!ioport_emul);
+    rc |= ioports_set_emul(0, 0xFFFF);
+    process_ioports(opt_ioports_noemul);
+
     BUG_ON(rc != 0);
 
     return 0;
xen/arch/x86/sysctl.c +17 -0
Index: 2006-09-11/xen/arch/x86/sysctl.c
===================================================================
@@ -57,6 +57,23 @@ long arch_do_sysctl(
     }
     break;
     
+    case XEN_SYSCTL_ioport_emulation:
+    {
+        unsigned int fp = sysctl->u.ioport_emulation.first_port;
+        unsigned int np = sysctl->u.ioport_emulation.nr_ports;
+
+        ret = -EINVAL;
+        if ( (fp + np) > 65536 )
+            break;
+
+        if ( np == 0 )
+            ret = 0;
+        else if ( sysctl->u.ioport_emulation.emulate )
+            ret = ioports_set_emul(fp, fp + np - 1);
+        else
+            ret = ioports_set_noemul(fp, fp + np - 1);
+    }
+    break;
 
     default:
         ret = -ENOSYS;
xen/arch/x86/traps.c +83 -25

200 lines not on this page · raw message

xen/arch/x86/x86_32/Makefile +1 -0
Index: 2006-09-11/xen/arch/x86/x86_32/Makefile
===================================================================
@@ -1,5 +1,6 @@
 obj-y += domain_page.o
 obj-y += entry.o
+obj-y += io.o
 obj-y += mm.o
 obj-y += seg_fixup.o
 obj-y += traps.o
xen/arch/x86/x86_32/io.S new file +42 -0

42 lines not on this page · raw message

xen/arch/x86/x86_32/traps.c +24 -0
Index: 2006-09-11/xen/arch/x86/x86_32/traps.c
===================================================================
@@ -13,6 +13,7 @@
 #include <xen/nmi.h>
 #include <asm/current.h>
 #include <asm/flushtlb.h>
+#include <asm/io.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/support.h>
 
@@ -250,6 +251,7 @@ fastcall void smp_deferred_nmi(struct cp
 void __init percpu_traps_init(void)
 {
     struct tss_struct *tss = &doublefault_tss;
+    char *stack_bottom, *stack;
     asmlinkage int hypercall(void);
 
     if ( smp_processor_id() != 0 )
@@ -283,6 +285,28 @@ void __init percpu_traps_init(void)
         (unsigned long)tss, 235, 9);
 
     set_task_gate(TRAP_double_fault, __DOUBLEFAULT_TSS_ENTRY<<3);
+
+    /*
+     * Stub for full-context I/O emulation.
+     */
+    stack_bottom = (char *)get_stack_bottom();
+    stack        = (char *)((unsigned long)stack_bottom & ~(STACK_SIZE - 1));
+    if (!io_emul_stub_offset)
+        io_emul_stub_offset = stack - stack_bottom;
+    else
+        BUG_ON(io_emul_stub_offset != stack - stack_bottom);
+    /* call save_host_restore_guest */
+    stack[0] = 0xe8;
+    *(s32*)&stack[1] = (char *)save_host_restore_guest - &stack[5];
+    stack += 5;
+    if (!io_emul_insn_offset)
+        io_emul_insn_offset = stack - stack_bottom;
+    else
+        BUG_ON(io_emul_insn_offset != stack - stack_bottom);
+    stack += 3; /* operand size prefix, opcode, immediate */
+    /* jmp save_guest_restore_host */
+    stack[0] = 0xe9;
+    *(s32*)&stack[1] = (char *)save_guest_restore_host - &stack[5];
 }
 
 void init_int80_direct_trap(struct vcpu *v)
xen/arch/x86/x86_64/Makefile +1 -0
Index: 2006-09-11/xen/arch/x86/x86_64/Makefile
===================================================================
@@ -1,3 +1,4 @@
 obj-y += entry.o
+obj-y += io.o
 obj-y += mm.o
 obj-y += traps.o
xen/arch/x86/x86_64/io.S new file +62 -0

62 lines not on this page · raw message

xen/arch/x86/x86_64/traps.c +24 -0
Index: 2006-09-11/xen/arch/x86/x86_64/traps.c
===================================================================
@@ -14,6 +14,7 @@
 #include <xen/nmi.h>
 #include <asm/current.h>
 #include <asm/flushtlb.h>
+#include <asm/io.h>
 #include <asm/msr.h>
 #include <asm/shadow.h>
 #include <asm/hvm/hvm.h>
@@ -331,6 +332,29 @@ void __init percpu_traps_init(void)
 
     wrmsr(MSR_STAR, 0, (FLAT_RING3_CS32<<16) | __HYPERVISOR_CS);
     wrmsr(MSR_SYSCALL_MASK, EF_VM|EF_RF|EF_NT|EF_DF|EF_IE|EF_TF, 0U);
+
+    /*
+     * Stub for full-context I/O emulation.
+     */
+
+    /* Skip the compatibility-mode entry trampoline. */
+    stack += 26;
+    if (!io_emul_stub_offset)
+        io_emul_stub_offset = stack - stack_bottom;
+    else
+        BUG_ON(io_emul_stub_offset != stack - stack_bottom);
+    /* call save_host_restore_guest */
+    stack[0] = 0xe8;
+    *(s32*)&stack[1] = (char *)save_host_restore_guest - &stack[5];
+    stack += 5;
+    if (!io_emul_insn_offset)
+        io_emul_insn_offset = stack - stack_bottom;
+    else
+        BUG_ON(io_emul_insn_offset != stack - stack_bottom);
+    stack += 3; /* operand size prefix, opcode, immediate */
+    /* jmp save_guest_restore_host */
+    stack[0] = 0xe9;
+    *(s32*)&stack[1] = (char *)save_guest_restore_host - &stack[5];
 }
 
 static long register_guest_callback(struct callback_register *reg)
xen/include/asm-x86/io.h +6 -0
Index: 2006-09-11/xen/include/asm-x86/io.h
===================================================================
@@ -50,4 +50,10 @@ __OUT(b,"b",char)
 __OUT(w,"w",short)
 __OUT(l,,int)
 
+struct cpu_user_regs;
+void save_host_restore_guest(struct cpu_user_regs *) __attribute__((__regparm__(1)));
+unsigned long save_guest_restore_host(unsigned long) __attribute__((__regparm__(1)));
+
+extern long io_emul_stub_offset, io_emul_insn_offset;
+
 #endif
xen/include/asm-x86/iocap.h +16 -0
Index: 2006-09-11/xen/include/asm-x86/iocap.h
===================================================================
@@ -7,6 +7,15 @@
 #ifndef __X86_IOCAP_H__
 #define __X86_IOCAP_H__
 
+extern struct rangeset *ioport_caps, *ioport_emul;
+
+#define ioports_permit_access_all(s, e)                 \
+    rangeset_add_range(ioport_caps, s, e)
+#define ioports_deny_access_all(s, e)                   \
+    rangeset_remove_range(ioport_caps, s, e)
+#define ioports_any_access_permitted(s, e)              \
+    rangeset_contains_range(ioport_caps, s, e)
+
 #define ioports_permit_access(d, s, e)                  \
     rangeset_add_range((d)->arch.ioport_caps, s, e)
 #define ioports_deny_access(d, s, e)                    \
@@ -14,6 +23,13 @@
 #define ioports_access_permitted(d, s, e)               \
     rangeset_contains_range((d)->arch.ioport_caps, s, e)
 
+#define ioports_set_emul(s, e)                          \
+    rangeset_add_range(ioport_emul, s, e)
+#define ioports_set_noemul(s, e)                        \
+    rangeset_remove_range(ioport_emul, s, e)
+#define ioports_emul(s, e)                              \
+    rangeset_contains_range(ioport_emul, s, e)
+
 #define cache_flush_permitted(d)                       \
     (!rangeset_is_empty((d)->iomem_caps))
 
xen/include/public/sysctl.h +10 -0
Index: 2006-09-11/xen/include/public/sysctl.h
===================================================================
@@ -122,6 +122,15 @@ struct xen_sysctl_getdomaininfolist {
 typedef struct xen_sysctl_getdomaininfolist xen_sysctl_getdomaininfolist_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getdomaininfolist_t);
 
+#define XEN_SYSCTL_ioport_emulation 7
+struct xen_sysctl_ioport_emulation {
+    uint32_t first_port;              /* first port int range */
+    uint32_t nr_ports;                /* size of port range */
+    uint8_t  emulate;                 /* emulate access to range? */
+};
+typedef struct xen_sysctl_ioport_emulation xen_sysctl_ioport_emulation_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_ioport_emulation_t);
+
 struct xen_sysctl {
     uint32_t cmd;
     uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
@@ -132,6 +141,7 @@ struct xen_sysctl {
         struct xen_sysctl_sched_id          sched_id;
         struct xen_sysctl_perfc_op          perfc_op;
         struct xen_sysctl_getdomaininfolist getdomaininfolist;
+        struct xen_sysctl_ioport_emulation  ioport_emulation;
         uint8_t                             pad[128];
     } u;
 };

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel