aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2008-10-16 22:18:03 -0400
committerTony Luck <tony.luck@intel.com>2008-10-17 13:05:08 -0400
commit5142ec4690943eefc86b01396addf70083a2b9fb (patch)
tree0db3ae9566b54be9bfc35fff973ae67f06b94c32
parent21820cce1701cf978310efb47d90e5e6a927f6ae (diff)
ia64/pv_ops/xen: paravirtualize ivt.S for xen.
paravirtualize ivt.S for xen by multi compile. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--arch/ia64/include/asm/xen/inst.h1
-rw-r--r--arch/ia64/xen/Makefile16
-rw-r--r--arch/ia64/xen/xenivt.S52
3 files changed, 68 insertions, 1 deletions
diff --git a/arch/ia64/include/asm/xen/inst.h b/arch/ia64/include/asm/xen/inst.h
index 1e92ed078379..e6a25c34c7a8 100644
--- a/arch/ia64/include/asm/xen/inst.h
+++ b/arch/ia64/include/asm/xen/inst.h
@@ -22,6 +22,7 @@
22 22
23#include <asm/xen/privop.h> 23#include <asm/xen/privop.h>
24 24
25#define ia64_ivt xen_ivt
25#define DO_SAVE_MIN XEN_DO_SAVE_MIN 26#define DO_SAVE_MIN XEN_DO_SAVE_MIN
26 27
27#define MOV_FROM_IFA(reg) \ 28#define MOV_FROM_IFA(reg) \
diff --git a/arch/ia64/xen/Makefile b/arch/ia64/xen/Makefile
index 7cb4247f90be..5c87e4a79d39 100644
--- a/arch/ia64/xen/Makefile
+++ b/arch/ia64/xen/Makefile
@@ -2,5 +2,19 @@
2# Makefile for Xen components 2# Makefile for Xen components
3# 3#
4 4
5obj-y := hypercall.o xensetup.o xen_pv_ops.o \ 5obj-y := hypercall.o xenivt.o xensetup.o xen_pv_ops.o \
6 hypervisor.o xencomm.o xcom_hcall.o grant-table.o 6 hypervisor.o xencomm.o xcom_hcall.o grant-table.o
7
8AFLAGS_xenivt.o += -D__IA64_ASM_PARAVIRTUALIZED_XEN
9
10# xen multi compile
11ASM_PARAVIRT_MULTI_COMPILE_SRCS = ivt.S
12ASM_PARAVIRT_OBJS = $(addprefix xen-,$(ASM_PARAVIRT_MULTI_COMPILE_SRCS:.S=.o))
13obj-y += $(ASM_PARAVIRT_OBJS)
14define paravirtualized_xen
15AFLAGS_$(1) += -D__IA64_ASM_PARAVIRTUALIZED_XEN
16endef
17$(foreach o,$(ASM_PARAVIRT_OBJS),$(eval $(call paravirtualized_xen,$(o))))
18
19$(obj)/xen-%.o: $(src)/../kernel/%.S FORCE
20 $(call if_changed_dep,as_o_S)
diff --git a/arch/ia64/xen/xenivt.S b/arch/ia64/xen/xenivt.S
new file mode 100644
index 000000000000..3e71d50584d9
--- /dev/null
+++ b/arch/ia64/xen/xenivt.S
@@ -0,0 +1,52 @@
1/*
2 * arch/ia64/xen/ivt.S
3 *
4 * Copyright (C) 2005 Hewlett-Packard Co
5 * Dan Magenheimer <dan.magenheimer@hp.com>
6 *
7 * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
8 * VA Linux Systems Japan K.K.
9 * pv_ops.
10 */
11
12#include <asm/asmmacro.h>
13#include <asm/kregs.h>
14#include <asm/pgtable.h>
15
16#include "../kernel/minstate.h"
17
18 .section .text,"ax"
19GLOBAL_ENTRY(xen_event_callback)
20 mov r31=pr // prepare to save predicates
21 ;;
22 SAVE_MIN_WITH_COVER // uses r31; defines r2 and r3
23 ;;
24 movl r3=XSI_PSR_IC
25 mov r14=1
26 ;;
27 st4 [r3]=r14
28 ;;
29 adds r3=8,r2 // set up second base pointer for SAVE_REST
30 srlz.i // ensure everybody knows psr.ic is back on
31 ;;
32 SAVE_REST
33 ;;
341:
35 alloc r14=ar.pfs,0,0,1,0 // must be first in an insn group
36 add out0=16,sp // pass pointer to pt_regs as first arg
37 ;;
38 br.call.sptk.many b0=xen_evtchn_do_upcall
39 ;;
40 movl r20=XSI_PSR_I_ADDR
41 ;;
42 ld8 r20=[r20]
43 ;;
44 adds r20=-1,r20 // vcpu_info->evtchn_upcall_pending
45 ;;
46 ld1 r20=[r20]
47 ;;
48 cmp.ne p6,p0=r20,r0 // if there are pending events,
49 (p6) br.spnt.few 1b // call evtchn_do_upcall again.
50 br.sptk.many xen_leave_kernel // we know ia64_leave_kernel is
51 // paravirtualized as xen_leave_kernel
52END(xen_event_callback)