Skip to contentSkip to conversation

mini-os: big-endian mini-os on ia64

RFC PATCH In review Dietmar Hahn 5 participants 18 messages Feb 20, 2007 – Mar 15, 2007

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 mini-os: big-endian mini-os on ia64

Hi,

currently I'am porting the mini-os to ia64. A first version is already in the ia64xen-tree.
I would like to have a big-endian mini-os running on the ia64 little-endian hypervisor.
My target is to have only changes in the domU. This requires to swap all the domU data the hypervisor/dom0 see und use.
Attached is a patch with a first draft. I use the macro SWAP() to swap the right pieces (on x86 of course empty).
Currently netfront is not supported.
With this patch and small changes in the ia64xen hypervisor + loader I'am able to run a big andian mini-os on a ia64xen hypervisor.
The patch contains only changes in the common mini-os parts. The ia64 part in the tree is already fine with that.
The patches for the hypervisor will come with an extra patch. Please have a look and send comments or check in if there are no questions. Thanks.

Dietmar.

# HG changeset patch
# User [email protected]
# Date 1171978487 -3600
# Node ID 0e0869793af2f614fd020d2f7f893225dc6021be
# Parent b83cfb117bddc1f44be53bde49d86b5075bdaa2a
First step to have big endian mini-os an little endian hypervisor for ia64.

extras/mini-os/arch/x86/arch.mk +1 -0
diff -r b83cfb117bdd -r 0e0869793af2 extras/mini-os/arch/x86/arch.mk
@@ -3,6 +3,7 @@
 # (including x86_32, x86_32y and x86_64).
 #
 
+pae=y
 ifeq ($(TARGET_ARCH),x86_32)
 ARCH_CFLAGS  := -m32 -march=i686
 ARCH_LDFLAGS := -m elf_i386
extras/mini-os/console/xencons_ring.c +6 -6
diff -r b83cfb117bdd -r 0e0869793af2 extras/mini-os/console/xencons_ring.c
@@ -28,8 +28,8 @@ int xencons_ring_send_no_notify(const ch
     int sent = 0;
 	struct xencons_interface *intf = xencons_interface();
 	XENCONS_RING_IDX cons, prod;
-	cons = intf->out_cons;
-	prod = intf->out_prod;
+	cons = SWAP(intf->out_cons);
+	prod = SWAP(intf->out_prod);
 	mb();
 	BUG_ON((prod - cons) > sizeof(intf->out));
 
@@ -37,7 +37,7 @@ int xencons_ring_send_no_notify(const ch
 		intf->out[MASK_XENCONS_IDX(prod++, intf->out)] = data[sent++];
 
 	wmb();
-	intf->out_prod = prod;
+	intf->out_prod = SWAP(prod);
     
     return sent;
 }
@@ -58,8 +58,8 @@ static void handle_input(evtchn_port_t p
 	struct xencons_interface *intf = xencons_interface();
 	XENCONS_RING_IDX cons, prod;
 
-	cons = intf->in_cons;
-	prod = intf->in_prod;
+	cons = SWAP(intf->in_cons);
+	prod = SWAP(intf->in_prod);
 	mb();
 	BUG_ON((prod - cons) > sizeof(intf->in));
 
@@ -69,7 +69,7 @@ static void handle_input(evtchn_port_t p
 	}
 
 	mb();
-	intf->in_cons = cons;
+	intf->in_cons = SWAP(cons);
 
 	notify_daemon();
 
extras/mini-os/events.c +12 -12
diff -r b83cfb117bdd -r 0e0869793af2 extras/mini-os/events.c
@@ -46,7 +46,7 @@ void unbind_all_ports(void)
         {
             struct evtchn_close close;
             mask_evtchn(i);
-            close.port = i;
+            close.port = SWAP(i);
             HYPERVISOR_event_channel_op(EVTCHNOP_close, &close);
         }
     }
@@ -107,16 +107,16 @@ int bind_virq(uint32_t virq, evtchn_hand
 	evtchn_bind_virq_t op;
 
 	/* Try to bind the virq to a port */
-	op.virq = virq;
-	op.vcpu = smp_processor_id();
+	op.virq = SWAP(virq);
+	op.vcpu = SWAP((uint32_t)smp_processor_id());
 
 	if ( HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &op) != 0 )
 	{
 		printk("Failed to bind virtual IRQ %d\n", virq);
 		return 1;
     }
-    set_bit(op.port,bound_ports);
-    bind_evtchn(op.port, handler, data);
+    set_bit(SWAP(op.port),bound_ports);
+    bind_evtchn(SWAP(op.port), handler, data);
 	return 0;
 }
 
@@ -168,12 +168,12 @@ int evtchn_alloc_unbound(domid_t pal, ev
 						 void *data, evtchn_port_t *port)
 {
     evtchn_alloc_unbound_t op;
-    op.dom = DOMID_SELF;
-    op.remote_dom = pal;
+    op.dom = SWAP((domid_t)DOMID_SELF);
+    op.remote_dom = SWAP(pal);
     int err = HYPERVISOR_event_channel_op(EVTCHNOP_alloc_unbound, &op);
     if (err)
 		return err;
-    *port = bind_evtchn(op.port, handler, data);
+    *port = bind_evtchn(SWAP(op.port), handler, data);
     return err;
 }
 
@@ -185,13 +185,13 @@ int evtchn_bind_interdomain(domid_t pal,
 			    evtchn_port_t *local_port)
 {
     evtchn_bind_interdomain_t op;
-    op.remote_dom = pal;
-    op.remote_port = remote_port;
+    op.remote_dom = SWAP(pal);
+    op.remote_port = SWAP(remote_port);
     int err = HYPERVISOR_event_channel_op(EVTCHNOP_bind_interdomain, &op);
     if (err)
 		return err;
-    set_bit(op.local_port,bound_ports);
-	evtchn_port_t port = op.local_port;
+    set_bit(SWAP(op.local_port),bound_ports);
+	evtchn_port_t port = SWAP(op.local_port);
     clear_evtchn(port);	      /* Without, handler gets invoked now! */
     *local_port = bind_evtchn(port, handler, data);
     return err;
extras/mini-os/gnttab.c +18 -16
diff -r b83cfb117bdd -r 0e0869793af2 extras/mini-os/gnttab.c
@@ -54,11 +54,12 @@ gnttab_grant_access(domid_t domid, unsig
     grant_ref_t ref;
 
     ref = get_free_entry();
-    gnttab_table[ref].frame = frame;
-    gnttab_table[ref].domid = domid;
+    gnttab_table[ref].frame = SWAP((uint32_t)frame);
+    gnttab_table[ref].domid = SWAP(domid);
     wmb();
     readonly *= GTF_readonly;
-    gnttab_table[ref].flags = GTF_permit_access | readonly;
+    uint16_t flags = (uint16_t) GTF_permit_access | (uint16_t) readonly;
+    gnttab_table[ref].flags = SWAP(flags);
 
     return ref;
 }
@@ -69,10 +70,10 @@ gnttab_grant_transfer(domid_t domid, uns
     grant_ref_t ref;
 
     ref = get_free_entry();
-    gnttab_table[ref].frame = pfn;
-    gnttab_table[ref].domid = domid;
+    gnttab_table[ref].frame = SWAP((uint32_t)pfn);
+    gnttab_table[ref].domid = SWAP(domid);
     wmb();
-    gnttab_table[ref].flags = GTF_accept_transfer;
+    gnttab_table[ref].flags = SWAP((uint16_t)GTF_accept_transfer);
 
     return ref;
 }
@@ -82,14 +83,14 @@ gnttab_end_access(grant_ref_t ref)
 {
     u16 flags, nflags;
 
-    nflags = gnttab_table[ref].flags;
+    nflags = SWAP(gnttab_table[ref].flags);
     do {
         if ((flags = nflags) & (GTF_reading|GTF_writing)) {
             printk("WARNING: g.e. still in use!\n");
             return 0;
         }
-    } while ((nflags = synch_cmpxchg(&gnttab_table[ref].flags, flags, 0)) !=
-            flags);
+    } while ((nflags = SWAP(synch_cmpxchg(&gnttab_table[ref].flags,
+                                                SWAP(flags), 0))) != flags);
 
     put_free_entry(ref);
     return 1;
@@ -101,8 +102,9 @@ gnttab_end_transfer(grant_ref_t ref)
     unsigned long frame;
     u16 flags;
 
-    while (!((flags = gnttab_table[ref].flags) & GTF_transfer_committed)) {
-        if (synch_cmpxchg(&gnttab_table[ref].flags, flags, 0) == flags) {
+    while (!((flags = SWAP(gnttab_table[ref].flags)) & GTF_transfer_committed)) {
+        if (SWAP(synch_cmpxchg(&gnttab_table[ref].flags, SWAP(flags), 0)) ==
+                                                                      flags) {
             printk("Release unused transfer grant.\n");
             put_free_entry(ref);
             return 0;
@@ -111,12 +113,12 @@ gnttab_end_transfer(grant_ref_t ref)
 
     /* If a transfer is in progress then wait until it is completed. */
     while (!(flags & GTF_transfer_completed)) {
-        flags = gnttab_table[ref].flags;
+        flags = SWAP(gnttab_table[ref].flags);
     }
 
     /* Read the frame number /after/ reading completion status. */
     rmb();
-    frame = gnttab_table[ref].frame;
+    frame = SWAP(gnttab_table[ref].frame);
 
     put_free_entry(ref);
 
@@ -157,9 +159,9 @@ init_gnttab(void)
     for (i = NR_RESERVED_ENTRIES; i < NR_GRANT_ENTRIES; i++)
         put_free_entry(i);
 
-    setup.dom = DOMID_SELF;
-    setup.nr_frames = NR_GRANT_FRAMES;
-    set_xen_guest_handle(setup.frame_list, frames);
+    setup.dom = SWAP((domid_t)DOMID_SELF);
+    setup.nr_frames = SWAP((uint32_t)NR_GRANT_FRAMES);
+    set_xen_guest_handle(setup.frame_list, (void*)SWAP((unsigned long)frames));
 
     HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1);
     gnttab_table = map_frames(frames, NR_GRANT_FRAMES);
extras/mini-os/hypervisor.c +4 -4
diff -r b83cfb117bdd -r 0e0869793af2 extras/mini-os/hypervisor.c
@@ -30,8 +30,8 @@
 #include <events.h>
 
 #define active_evtchns(cpu,sh,idx)              \
-    ((sh)->evtchn_pending[idx] &                \
-     ~(sh)->evtchn_mask[idx])
+    (SWAP((sh)->evtchn_pending[idx]) &                \
+     SWAP(~(sh)->evtchn_mask[idx]))
 
 void do_hypervisor_callback(struct pt_regs *regs)
 {
@@ -44,7 +44,7 @@ void do_hypervisor_callback(struct pt_re
    
     vcpu_info->evtchn_upcall_pending = 0;
     /* NB. No need for a barrier here -- XCHG is a barrier on x86. */
-    l1 = xchg(&vcpu_info->evtchn_pending_sel, 0);
+    l1 = SWAP(xchg(&vcpu_info->evtchn_pending_sel, 0));
     while ( l1 != 0 )
     {
         l1i = __ffs(l1);
@@ -82,7 +82,7 @@ inline void unmask_evtchn(u32 port)
     if (  synch_test_bit        (port,    &s->evtchn_pending[0]) && 
          !synch_test_and_set_bit(port>>5, &vcpu_info->evtchn_pending_sel) )
     {
-        vcpu_info->evtchn_upcall_pending = 1;
+        vcpu_info->evtchn_upcall_pending = SWAP((uint8_t)1);
         if ( !vcpu_info->evtchn_upcall_mask )
             force_evtchn_callback();
     }
extras/mini-os/include/events.h +1 -1
diff -r b83cfb117bdd -r 0e0869793af2 extras/mini-os/include/events.h
@@ -41,7 +41,7 @@ static inline int notify_remote_via_evtc
 static inline int notify_remote_via_evtchn(evtchn_port_t port)
 {
     evtchn_send_t op;
-    op.port = port;
+    op.port = SWAP(port);
     return HYPERVISOR_event_channel_op(EVTCHNOP_send, &op);
 }
 
extras/mini-os/include/x86/os.h +3 -0
diff -r b83cfb117bdd -r 0e0869793af2 extras/mini-os/include/x86/os.h
@@ -13,6 +13,9 @@
 #define unlikely(x)  __builtin_expect((x),0)
 
 #define smp_processor_id() 0
+
+/* Used in ia64 mini-os to run big endian on little endian hypervisor. */
+#define SWAP(x) (x)
 
 
 #ifndef __ASSEMBLY__
extras/mini-os/xenbus/xenbus.c +37 -27

147 lines not on this page · raw message

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

#1 lore raw
Quoted 2 lines · Dietmar Hahn

I would like to have a big-endian mini-os running on the ia64 little-endian hypervisor.

What's the motivation for wanting to do this?

-- Keir

#2 lore raw

Hi Keir,

Am Dienstag, 20. Februar 2007 15:36 schrieb Keir Fraser:

Quoted 7 lines · Dietmar Hahn
Quoted 2 lines

I would like to have a big-endian mini-os running on the ia64 little-endian hypervisor.

What's the motivation for wanting to do this?

-- Keir

I do some conceptual studies to get our mainframe OS running with xen and ia64. This OS is running big endian, so ...
My thoughts were to publish the results - maybe another one can use it. Thanks.

Dietmar.

#3 lore raw

Would you like to have this applied to mainstream? Personally, I don't think it's too useful there. But I'm open to convincing.

Thanks
Gregor

Quoted 15 lines · Dietmar Hahn

Hi Keir,

Am Dienstag, 20. Februar 2007 15:36 schrieb Keir Fraser:

Quoted 6 lines · Dietmar Hahn
Quoted 2 lines

I would like to have a big-endian mini-os running on the ia64 little-endian hypervisor.

What's the motivation for wanting to do this?

-- Keir

I do some conceptual studies to get our mainframe OS running with xen and ia64. This OS is running big endian, so ... My thoughts were to publish the results - maybe another one can use it.
Thanks.

Dietmar.

#4 lore raw

Am Dienstag, 20. Februar 2007 20:03 schrieb Grzegorz Milos:

Quoted 2 lines

Would you like to have this applied to mainstream? Personally, I don't think it's too useful there. But I'm open to convincing.

Sure, I would like to have this in mainstream.
Then I can download the xen-source, set big-endian flag in ia64 makerules, try make and can test the big endian domU ;-) Ok, this was a joke! Why not have it in the mainstream? Xen is developing very fast. After x86 now we have ia64 and ppc. ia64 is able to run big and little endian (and this is used in reality - HP-UX for ia64 is big -endian).
And with Gerd Hoffmann's great new domain builder it's an easiness to start a big-endian domU on little-endian dom0.
We did some changes to mini-os. Maybe one of the ppc people may port the mini-os - more changes may be needed.
I think the SWAP()'s are not that much. Maybe I can reduce this by moving some into the ia64-hypercall interface. What remain are the accesses to the ring buffers (not that simple in netfront because of the xen-macros). Perhaps some other guys contribute their opinion.
Thanks.

Dietmar.

Quoted 9 lines

Thanks
Gregor

Quoted 4 lines · Dietmar Hahn

Hi Keir,

Am Dienstag, 20. Februar 2007 15:36 schrieb Keir Fraser:

Quoted 1 line

On 20/2/07 14:00, "Dietmar Hahn" <[email protected]>

Quoted 13 lines · wrote:
Quoted 13 lines
Quoted 6 lines
Quoted 2 lines

I would like to have a big-endian mini-os running on the ia64 little-endian hypervisor.

What's the motivation for wanting to do this?

-- Keir

I do some conceptual studies to get our mainframe OS running with xen and ia64. This OS is running big endian, so ...
My thoughts were to publish the results - maybe another one can use it. Thanks.

Dietmar.

#5 lore raw
Quoted 4 lines · Dietmar Hahn

I think the SWAP()'s are not that much. Maybe I can reduce this by moving some into the ia64-hypercall interface. What remain are the accesses to the ring buffers (not that simple in netfront because of the xen-macros). Perhaps some other guys contribute their opinion.

I would actually argue that they're scattered all over the place and it will be hard to be sure that we have all the SWAPs we need and only the SWAPs we need. Particularly to continue ensuring that given that most development will be with minios having same endianness as Xen.

In short: it's ugly and unless someone really cares it will rot.

-- Keir

#6 lore raw

Am Mittwoch, 21. Februar 2007 14:51 schrieb Keir Fraser:

Quoted 6 lines · Dietmar Hahn
Quoted 4 lines

I think the SWAP()'s are not that much. Maybe I can reduce this by moving some into the ia64-hypercall interface. What remain are the accesses to the ring buffers (not that simple in netfront because of the xen-macros). Perhaps some other guys contribute their opinion.

Quoted 8 lines

I would actually argue that they're scattered all over the place and it will be hard to be sure that we have all the SWAPs we need and only the SWAPs we need. Particularly to continue ensuring that given that most development will be with minios having same endianness as Xen.

In short: it's ugly and unless someone really cares it will rot.

-- Keir

Now that the environment (libxc, xen-ia64) is ready to start a simple BE domU, I want to start a new discussion about BE able mini-os.
What I want to have is a mini-os, where everybody whith ia64 hardware can build and run a BE mini-os beside LE mini-os (or other domU's) on xen-ia64 hypervisor. If you say at this point: no interrest for such a thing, than we can stop this discussion here.
On the other side we should discuss how this can be realized.
My target with the first patch was to minimize the impact on common mini-os source as small as possible and that the hypervisor shouldn't be touched by BE/LE problematic. Therewidth I did only the SWAPs at the right place in the mini-os. Maybe that SWAPs are ugly but the SWAPs have to be done somewhere and the best place in my opinion is in the domU at the lowest level functions on top of the hypervisor interface - in gnttab, xenbus, xencons, event. The other way would be building wrappers around all the accesses to domU/hypervisor interfaces and hide the SWAPs there. But this seems a little bit overkill at this stage.
Oh and yes I will care about this in the mini-os!
Thanks.

Dietmar

#7 lore raw
Quoted 4 lines · Dietmar Hahn

What I want to have is a mini-os, where everybody whith ia64 hardware can build and run a BE mini-os beside LE mini-os (or other domU's) on xen-ia64 hypervisor. If you say at this point: no interrest for such a thing, than we can stop this discussion here.

I don;t think we'd have a problem with incorportaing support for ia64-be if there's a good reason for it (a better reason than "because it's possible").

Quoted 3 lines

The other way would be building wrappers around all the accesses to domU/hypervisor interfaces and hide the SWAPs there. But this seems a little bit overkill at this stage.

It would be less ugly and I think less prone to missing some open-coded accesses. Open-coding the SWAP()s is pretty grim.

-- Keir

#8 lore raw
Quoted 4 lines
Quoted 4 lines

What I want to have is a mini-os, where everybody whith ia64 hardware can build and run a BE mini-os beside LE mini-os (or other domU's) on xen-ia64 hypervisor. If you say at this point: no interrest for such a thing, than we can stop this discussion here.

Is there going to be a port of a full-featured BE OS to Xen/IA64? Would existing OSes be able to be paravirtualised, or would it need to be HVM?

Cheers,
Mark

Signature · 4 lines
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!
#9 lore raw

Am Dienstag, 27. Februar 2007 13:07 schrieb Mark Williamson:

Quoted 2 lines

Is there going to be a port of a full-featured BE OS to Xen/IA64? Would existing OSes be able to be paravirtualised, or would it need to be HVM?

Currently we have a prototype of our OS (BS2000 - S/390 like mainframe os) running in big-endian mode on ia64 hardware. We have built a virtual environment within linux to let the OS running. Linux is used as the IO-system. Therewidth we have some experiences with the SWAP stuff. The target is to substitute linux with dom0 and to full paravirtualise the OS. At the moment I do some groundwork in preparation for the port. Thanks.

Dietmar.

#10 lore raw
Quoted 2 lines · Dietmar Hahn

Currently we have a prototype of our OS (BS2000 - S/390 like mainframe os) running in big-endian mode on ia64 hardware.

Couldn't you run BS2000 in little-endian mode? How hardcoded is the endianness assumption (e.g., all over your ia64-specific additions)?

-- Keir

#11 lore raw

Am Mittwoch, 28. Februar 2007 09:42 schrieb Keir Fraser:

Quoted 6 lines · Dietmar Hahn
Quoted 2 lines

Currently we have a prototype of our OS (BS2000 - S/390 like mainframe os) running in big-endian mode on ia64 hardware.

Couldn't you run BS2000 in little-endian mode? How hardcoded is the endianness assumption (e.g., all over your ia64-specific additions)?

No, BS2000 in little-endian mode is not possible. We talk about millions of lines of code and billions of dollars customer application software. It's much better to prepare the base for big-endian.
Thanks.

Dietmar.

#12 lore raw
In reply to Keir Fraser

Am Dienstag, 27. Februar 2007 11:51 schrieb Keir Fraser:

Quoted 3 lines

I don;t think we'd have a problem with incorportaing support for ia64-be if there's a good reason for it (a better reason than "because it's possible").

I understand this.

Quoted 6 lines
Quoted 3 lines

The other way would be building wrappers around all the accesses to domU/hypervisor interfaces and hide the SWAPs there. But this seems a little bit overkill at this stage.

It would be less ugly and I think less prone to missing some open-coded accesses. Open-coding the SWAP()s is pretty grim.

Yes I see this. It's simply more work and more code is touched but from the design view it's a lot better.
If this is OK for you, I will try this and send a new patch as a proposal. Thanks.

Dietmar.

#13 lore raw
Quoted 4 lines · Dietmar Hahn
Quoted 3 lines

I don;t think we'd have a problem with incorportaing support for ia64-be if there's a good reason for it (a better reason than "because it's possible").

I understand this.

Doing this for an OS that has pre-existing dependencies on being big-endian (like your BS2000, presumably) I can understand. But I don't see why adding contrary-endianness support to minios is part of your roadmap when your end goal is the porting of a completely different OS? If it's part of a work-scoping exercise then maybe that's understandable, but I don't see why we'd necessarily take the resulting minios modifications upstream.

Quoted 5 lines
Quoted 2 lines

It would be less ugly and I think less prone to missing some open-coded accesses. Open-coding the SWAP()s is pretty grim.

Yes I see this. It's simply more work and more code is touched but from the design view it's a lot better.
If this is OK for you, I will try this and send a new patch as a proposal.

*If* we decide that this is a worthwhile exercise at all for minios, then I think this has to be the way to go.

-- Keir

#14 lore raw

Am Mittwoch, 28. Februar 2007 09:37 schrieb Keir Fraser:

Quoted 5 lines · Dietmar Hahn
Quoted 4 lines
Quoted 3 lines

I don;t think we'd have a problem with incorportaing support for ia64-be if there's a good reason for it (a better reason than "because it's possible").

Quoted 8 lines
Quoted 1 line

I understand this.

Doing this for an OS that has pre-existing dependencies on being big-endian (like your BS2000, presumably) I can understand. But I don't see why adding contrary-endianness support to minios is part of your roadmap when your end goal is the porting of a completely different OS? If it's part of a work-scoping exercise then maybe that's understandable, but I don't see why we'd necessarily take the resulting minios modifications upstream.

I did the mini-os port to ia64 as a starting point to get familiar with the internals of xen. The big-endian stuff in mini-os was a "work-scoping exercise" for me, but after getting big-endianess extensions into ia64-xen this was an offer to all developers interested in testing/developing the big-endian feature in xen-ia64.

Quoted 10 lines
Quoted 7 lines
Quoted 2 lines

It would be less ugly and I think less prone to missing some open-coded accesses. Open-coding the SWAP()s is pretty grim.

Yes I see this. It's simply more work and more code is touched but from the design view it's a lot better.
If this is OK for you, I will try this and send a new patch as a proposal.

*If* we decide that this is a worthwhile exercise at all for minios, then I think this has to be the way to go.

I understand this.
Thanks.

Dietmar.

#15 lore raw
In reply to Keir Fraser
Quoted 8 lines
Quoted 4 lines

What I want to have is a mini-os, where everybody whith ia64 hardware can build and run a BE mini-os beside LE mini-os (or other domU's) on xen-ia64 hypervisor. If you say at this point: no interrest for such a thing, than we can stop this discussion here.

I don;t think we'd have a problem with incorportaing support for ia64-be if there's a good reason for it (a better reason than "because it's possible").

Quoted 7 lines
Quoted 3 lines

The other way would be building wrappers around all the accesses to domU/hypervisor interfaces and hide the SWAPs there. But this seems a little bit overkill at this stage.

It would be less ugly and I think less prone to missing some open-coded accesses. Open-coding the SWAP()s is pretty grim.

One solution to the rotting problem would be write regression tests. High level tests (like for example netfront test) would be quite good at picking missing SWAPs, since they exercise a fair amount of Xen/Dom0 interfaces. Still it's quite hard to check the coverage (anybody happens to be an expert on coverage testing?).

I too dislike scattering SWAPs all over the code, but I guess having a nice set of wrappers would at least confine the problem. Still ... not that fond of it.

Cheers
Gregor

#16 lore raw

Hi Gregor,

Am Donnerstag, 1. März 2007 23:08 schrieb Grzegorz Milos:

Quoted 6 lines

One solution to the rotting problem would be write regression tests. High level tests (like for example netfront test) would be quite good at picking missing SWAPs, since they exercise a fair amount of Xen/Dom0 interfaces. Still it's quite hard to check the coverage (anybody happens to be an expert on coverage testing?).

Quoted 6 lines

I too dislike scattering SWAPs all over the code, but I guess having a nice set of wrappers would at least confine the problem. Still ... not that fond of it.

Cheers
Gregor

I send this as a private mail to you.
First thanks for opening a possible door to the SWAP stuff.
I don't full understand your rotting problem.
With recent binutils (see
http://sources.redhat.com/ml/binutils/2004-07/msg00110.html) everybody on ia64 hardware can build big-endian images on a little-endian linux machine. Only some special make flags in mini-os/arch/ia64/arch.mk (and the SWAPs) are needed to build a big-endian mini-os on ia64-linux. So a running big-endian mini-os on xen-ia64 is already a regression test itself I think. So the most currently used interfaces are checked with a running mini-os. Maybe for some more interface regression tests are possible/needed. What do you think? Where is my mistake in thinking about this? Thanks.

Dietmar

#17 lore raw

Sorry, this should only go to
Grzegorz Milos <[email protected]>
Thanks.

Dietmar.

Am Donnerstag, 15. März 2007 11:55 schrieb Dietmar Hahn:

Quoted 36 lines

Hi Gregor,

Am Donnerstag, 1. März 2007 23:08 schrieb Grzegorz Milos:

Quoted 6 lines

One solution to the rotting problem would be write regression tests. High level tests (like for example netfront test) would be quite good at picking missing SWAPs, since they exercise a fair amount of Xen/Dom0 interfaces. Still it's quite hard to check the coverage (anybody happens to be an expert on coverage testing?).

Quoted 6 lines

I too dislike scattering SWAPs all over the code, but I guess having a nice set of wrappers would at least confine the problem. Still ... not that fond of it.

Cheers
Gregor

I send this as a private mail to you.
First thanks for opening a possible door to the SWAP stuff.
I don't full understand your rotting problem.
With recent binutils (see
http://sources.redhat.com/ml/binutils/2004-07/msg00110.html) everybody on ia64 hardware can build big-endian images on a little-endian linux machine. Only some special make flags in mini-os/arch/ia64/arch.mk (and the SWAPs) are needed to build a big-endian mini-os on ia64-linux. So a running big-endian mini-os on xen-ia64 is already a regression test itself I think. So the most currently used interfaces are checked with a running mini-os. Maybe for some more interface regression tests are possible/needed. What do you think? Where is my mistake in thinking about this? Thanks.

Dietmar

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