ia64/xen-unstable

view linux-2.6-xen-sparse/arch/ia64/xen/xensetup.S @ 13372:c6b683ba68f5

[IA64] Fix save/restore

Using the new hypercall path, scratch registers are not saved/restored.

So after returning from hypercall, r20 may contain garbage data.
This triggered General Exception.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
author awilliam@xenbuild2.aw
date Sun Jan 14 22:18:38 2007 -0700 (2007-01-14)
parents c1b98df7386d
children e47738923a05
line source
1 /*
2 * Support routines for Xen
3 *
4 * Copyright (C) 2005 Dan Magenheimer <dan.magenheimer@hp.com>
5 */
7 #include <linux/config.h>
8 #include <asm/processor.h>
9 #include <asm/asmmacro.h>
11 #define isBP p3 // are we the Bootstrap Processor?
13 .text
14 GLOBAL_ENTRY(early_xen_setup)
15 mov r8=ar.rsc // Initialized in head.S
16 (isBP) movl r9=running_on_xen;;
17 extr.u r8=r8,2,2;; // Extract pl fields
18 cmp.eq p7,p0=r8,r0 // p7: !running on xen
19 mov r8=1 // booleanize.
20 (p7) br.ret.sptk.many rp;;
21 (isBP) st4 [r9]=r8
22 movl r10=xen_ivt;;
24 mov cr.iva=r10
26 /* Set xsi base. */
27 #define FW_HYPERCALL_SET_SHARED_INFO_VA 0x600
28 (isBP) mov r2=FW_HYPERCALL_SET_SHARED_INFO_VA
29 (isBP) movl r28=XSI_BASE;;
30 (isBP) break 0x1000;;
32 br.ret.sptk.many rp
33 ;;
34 END(early_xen_setup)
36 #include <xen/interface/xen.h>
38 /* Stub for suspend.
39 Just force the stacked registers to be written in memory. */
40 GLOBAL_ENTRY(xencomm_arch_hypercall_suspend)
41 ;;
42 alloc r20=ar.pfs,0,0,6,0
43 mov r2=__HYPERVISOR_sched_op
44 ;;
45 /* We don't want to deal with RSE. */
46 flushrs
47 mov r33=r32
48 mov r32=2 // SCHEDOP_shutdown
49 ;;
50 break 0x1000
51 ;;
52 br.ret.sptk.many b0
53 END(xencomm_arch_hypercall_suspend)