WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [IA64][MINIOS] Fixed some big-endian bugs

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64][MINIOS] Fixed some big-endian bugs and add HYPERVISOR_suspend
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 23 Mar 2007 05:30:41 -0700
Delivery-date: Fri, 23 Mar 2007 06:21:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User awilliam@xxxxxxxxxxxx
# Date 1174405905 21600
# Node ID 0fadd0476e036e4439b08f2df740bcc1ca6bdb9d
# Parent  c07b1dc6dc6d3b8ee2836090510dcbdf3be4ad74
[IA64][MINIOS] Fixed some big-endian bugs and add HYPERVISOR_suspend

Signed-off-by: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxxxxxxxxxx>
---
 extras/mini-os/arch/ia64/arch.mk             |   13 +++++++++++++
 extras/mini-os/arch/ia64/common.c            |    8 ++++++--
 extras/mini-os/arch/ia64/fw.S                |   21 +++++++++++++++++++++
 extras/mini-os/arch/ia64/mm.c                |    2 +-
 extras/mini-os/arch/ia64/xencomm.c           |   20 +++++++++++++++++---
 extras/mini-os/include/ia64/hypercall-ia64.h |    2 +-
 6 files changed, 59 insertions(+), 7 deletions(-)

diff -r c07b1dc6dc6d -r 0fadd0476e03 extras/mini-os/arch/ia64/arch.mk
--- a/extras/mini-os/arch/ia64/arch.mk  Tue Mar 20 09:32:24 2007 -0600
+++ b/extras/mini-os/arch/ia64/arch.mk  Tue Mar 20 09:51:45 2007 -0600
@@ -1,3 +1,6 @@ ARCH_CFLAGS := -mfixed-range=f2-f5,f12-f
+# Build for Big Endian?
+BIGENDIAN := n
+
 ARCH_CFLAGS := -mfixed-range=f2-f5,f12-f15,f32-f127 -mconstant-gp
 ARCH_CFLAGS += -O2
 ARCH_ASFLAGS := -x assembler-with-cpp
@@ -5,3 +8,13 @@ ARCH_ASFLAGS += -fno-builtin -fno-common
 ARCH_ASFLAGS += -fno-builtin -fno-common -fno-strict-aliasing -mconstant-gp
 
 ARCH_LDFLAGS = -warn-common
+
+# Next lines are for big endian code !
+ifeq ($(BIGENDIAN),y)
+ARCH_CFLAGS += -mbig-endian -Wa,-mbe -Wa,-mlp64
+ARCH_CFLAGS += -DBIG_ENDIAN
+ARCH_ASFLAGS += -Wa,-mbe
+ARCH_ASFLAGS += -DBIG_ENDIAN
+ARCH_LDFLAGS = -EB -d
+endif
+
diff -r c07b1dc6dc6d -r 0fadd0476e03 extras/mini-os/arch/ia64/common.c
--- a/extras/mini-os/arch/ia64/common.c Tue Mar 20 09:32:24 2007 -0600
+++ b/extras/mini-os/arch/ia64/common.c Tue Mar 20 09:51:45 2007 -0600
@@ -225,6 +225,7 @@ arch_print_info(void)
        major = minor >> 16;
        minor &= ~0xffffffff;
        printk("Running on Xen version: %d.%d\n", major, minor);
+#if 0
        printk("machine addr of shared_info_t  : 0x%lx\n",
               start_info.shared_info);
        printk("machine page number of shared page: 0x%lx\n",
@@ -235,5 +236,8 @@ arch_print_info(void)
               start_info.console.domU.mfn);
        printk("evtchn for console messages    : %d\n",
               start_info.console.domU.evtchn);
-       printk("xen_guest_cmdline              : %s\n", boot_cmd_line);
-}
+#endif
+       if(strlen(boot_cmd_line) > 0)
+               printk("xen_guest_cmdline              : %s\n", boot_cmd_line);
+}
+
diff -r c07b1dc6dc6d -r 0fadd0476e03 extras/mini-os/arch/ia64/fw.S
--- a/extras/mini-os/arch/ia64/fw.S     Tue Mar 20 09:32:24 2007 -0600
+++ b/extras/mini-os/arch/ia64/fw.S     Tue Mar 20 09:51:45 2007 -0600
@@ -33,6 +33,7 @@
 #include "ia64_cpu.h"
 #include "ia64_fpu.h"
 #include "offsets.h"
+#include "xen/xen.h"
 
 
 /*
@@ -517,3 +518,23 @@ ENTRY(__hypercall)
        br.ret.sptk.many b0
        ;;
 END(__hypercall)
+
+/*
+ * Stub for suspend.
+ * Just force the stacked registers to be written in memory.
+ */
+ENTRY(xencomm_arch_hypercall_suspend)
+       ;;
+       alloc   r20=ar.pfs,0,0,6,0
+       mov     r2=__HYPERVISOR_sched_op
+       ;;
+       /* We don't want to deal with RSE.  */
+       flushrs
+       mov     r33=r32
+       mov     r32=2           // SCHEDOP_shutdown
+       ;;
+       break   0x1000
+       ;;
+       br.ret.sptk.many b0
+END(xencomm_arch_hypercall_suspend)
+
diff -r c07b1dc6dc6d -r 0fadd0476e03 extras/mini-os/arch/ia64/mm.c
--- a/extras/mini-os/arch/ia64/mm.c     Tue Mar 20 09:32:24 2007 -0600
+++ b/extras/mini-os/arch/ia64/mm.c     Tue Mar 20 09:51:45 2007 -0600
@@ -127,7 +127,7 @@ map_frames(unsigned long* frames, unsign
 map_frames(unsigned long* frames, unsigned long n)
 {
        n = n;
-       return (void*) __va(frames[0] << PAGE_SHIFT);
+       return (void*) __va(SWAP(frames[0]) << PAGE_SHIFT);
 }
 
 void arch_init_p2m(unsigned long max_pfn)
diff -r c07b1dc6dc6d -r 0fadd0476e03 extras/mini-os/arch/ia64/xencomm.c
--- a/extras/mini-os/arch/ia64/xencomm.c        Tue Mar 20 09:32:24 2007 -0600
+++ b/extras/mini-os/arch/ia64/xencomm.c        Tue Mar 20 09:51:45 2007 -0600
@@ -171,13 +171,15 @@ xencommize_mini_grant_table_op(struct xe
                        return -EINVAL;
                rc = xencomm_create_mini
                        (xc_area, nbr_area,
-                        xen_guest_handle(setup->frame_list),
-                        setup->nr_frames
+                        (void*)SWAP((uint64_t)
+                                    xen_guest_handle(setup->frame_list)),
+                        SWAP(setup->nr_frames)
                         * sizeof(*xen_guest_handle(setup->frame_list)),
                         &desc1);
                if (rc)
                        return rc;
-               set_xen_guest_handle(setup->frame_list, (void *)desc1);
+               set_xen_guest_handle(setup->frame_list,
+                                    (void *)SWAP((uint64_t)desc1));
                break;
        }
        case GNTTABOP_dump_table:
@@ -254,3 +256,15 @@ HYPERVISOR_grant_table_op(unsigned int c
        return xencomm_mini_hypercall_grant_table_op(cmd, uop, count);
 }
 
+       /* In fw.S */
+extern int xencomm_arch_hypercall_suspend(struct xencomm_handle *arg);
+int
+HYPERVISOR_suspend(unsigned long srec)
+{
+        struct sched_shutdown arg;
+
+        arg.reason = (uint32_t)SWAP((uint32_t)SHUTDOWN_suspend);
+
+        return xencomm_arch_hypercall_suspend(xencomm_create_inline(&arg));
+}
+
diff -r c07b1dc6dc6d -r 0fadd0476e03 
extras/mini-os/include/ia64/hypercall-ia64.h
--- a/extras/mini-os/include/ia64/hypercall-ia64.h      Tue Mar 20 09:32:24 
2007 -0600
+++ b/extras/mini-os/include/ia64/hypercall-ia64.h      Tue Mar 20 09:51:45 
2007 -0600
@@ -138,7 +138,7 @@ xencomm_arch_event_channel_op(int cmd, v
        if (unlikely(rc == -ENOSYS)) {
                struct evtchn_op op;
 
-               op.cmd = cmd;
+               op.cmd = SWAP(cmd);
                memcpy(&op.u, arg, sizeof(op.u));
                rc = _hypercall1(int, event_channel_op_compat, &op);
        }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64][MINIOS] Fixed some big-endian bugs and add HYPERVISOR_suspend, Xen patchbot-unstable <=