Skip to content

Commit 22ca532

Browse files
committed
Pull pv_ops-xen into release branch
2 parents 9224652 + f8d1f99 commit 22ca532

50 files changed

Lines changed: 4631 additions & 11 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/ia64/xen.txt‎

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
Recipe for getting/building/running Xen/ia64 with pv_ops
2+
--------------------------------------------------------
3+
4+
This recipe describes how to get xen-ia64 source and build it,
5+
and run domU with pv_ops.
6+
7+
============
8+
Requirements
9+
============
10+
11+
- python
12+
- mercurial
13+
it (aka "hg") is an open-source source code
14+
management software. See the below.
15+
http://www.selenic.com/mercurial/wiki/
16+
- git
17+
- bridge-utils
18+
19+
=================================
20+
Getting and Building Xen and Dom0
21+
=================================
22+
23+
My environment is;
24+
Machine : Tiger4
25+
Domain0 OS : RHEL5
26+
DomainU OS : RHEL5
27+
28+
1. Download source
29+
# hg clone http://xenbits.xensource.com/ext/ia64/xen-unstable.hg
30+
# cd xen-unstable.hg
31+
# hg clone http://xenbits.xensource.com/ext/ia64/linux-2.6.18-xen.hg
32+
33+
2. # make world
34+
35+
3. # make install-tools
36+
37+
4. copy kernels and xen
38+
# cp xen/xen.gz /boot/efi/efi/redhat/
39+
# cp build-linux-2.6.18-xen_ia64/vmlinux.gz \
40+
/boot/efi/efi/redhat/vmlinuz-2.6.18.8-xen
41+
42+
5. make initrd for Dom0/DomU
43+
# make -C linux-2.6.18-xen.hg ARCH=ia64 modules_install \
44+
O=$(/bin/pwd)/build-linux-2.6.18-xen_ia64
45+
# mkinitrd -f /boot/efi/efi/redhat/initrd-2.6.18.8-xen.img \
46+
2.6.18.8-xen --builtin mptspi --builtin mptbase \
47+
--builtin mptscsih --builtin uhci-hcd --builtin ohci-hcd \
48+
--builtin ehci-hcd
49+
50+
================================
51+
Making a disk image for guest OS
52+
================================
53+
54+
1. make file
55+
# dd if=/dev/zero of=/root/rhel5.img bs=1M seek=4096 count=0
56+
# mke2fs -F -j /root/rhel5.img
57+
# mount -o loop /root/rhel5.img /mnt
58+
# cp -ax /{dev,var,etc,usr,bin,sbin,lib} /mnt
59+
# mkdir /mnt/{root,proc,sys,home,tmp}
60+
61+
Note: You may miss some device files. If so, please create them
62+
with mknod. Or you can use tar instead of cp.
63+
64+
2. modify DomU's fstab
65+
# vi /mnt/etc/fstab
66+
/dev/xvda1 / ext3 defaults 1 1
67+
none /dev/pts devpts gid=5,mode=620 0 0
68+
none /dev/shm tmpfs defaults 0 0
69+
none /proc proc defaults 0 0
70+
none /sys sysfs defaults 0 0
71+
72+
3. modify inittab
73+
set runlevel to 3 to avoid X trying to start
74+
# vi /mnt/etc/inittab
75+
id:3:initdefault:
76+
Start a getty on the hvc0 console
77+
X0:2345:respawn:/sbin/mingetty hvc0
78+
tty1-6 mingetty can be commented out
79+
80+
4. add hvc0 into /etc/securetty
81+
# vi /mnt/etc/securetty (add hvc0)
82+
83+
5. umount
84+
# umount /mnt
85+
86+
FYI, virt-manager can also make a disk image for guest OS.
87+
It's GUI tools and easy to make it.
88+
89+
==================
90+
Boot Xen & Domain0
91+
==================
92+
93+
1. replace elilo
94+
elilo of RHEL5 can boot Xen and Dom0.
95+
If you use old elilo (e.g RHEL4), please download from the below
96+
http://elilo.sourceforge.net/cgi-bin/blosxom
97+
and copy into /boot/efi/efi/redhat/
98+
# cp elilo-3.6-ia64.efi /boot/efi/efi/redhat/elilo.efi
99+
100+
2. modify elilo.conf (like the below)
101+
# vi /boot/efi/efi/redhat/elilo.conf
102+
prompt
103+
timeout=20
104+
default=xen
105+
relocatable
106+
107+
image=vmlinuz-2.6.18.8-xen
108+
label=xen
109+
vmm=xen.gz
110+
initrd=initrd-2.6.18.8-xen.img
111+
read-only
112+
append=" -- rhgb root=/dev/sda2"
113+
114+
The append options before "--" are for xen hypervisor,
115+
the options after "--" are for dom0.
116+
117+
FYI, your machine may need console options like
118+
"com1=19200,8n1 console=vga,com1". For example,
119+
append="com1=19200,8n1 console=vga,com1 -- rhgb console=tty0 \
120+
console=ttyS0 root=/dev/sda2"
121+
122+
=====================================
123+
Getting and Building domU with pv_ops
124+
=====================================
125+
126+
1. get pv_ops tree
127+
# git clone http://people.valinux.co.jp/~yamahata/xen-ia64/linux-2.6-xen-ia64.git/
128+
129+
2. git branch (if necessary)
130+
# cd linux-2.6-xen-ia64/
131+
# git checkout -b your_branch origin/xen-ia64-domu-minimal-2008may19
132+
(Note: The current branch is xen-ia64-domu-minimal-2008may19.
133+
But you would find the new branch. You can see with
134+
"git branch -r" to get the branch lists.
135+
http://people.valinux.co.jp/~yamahata/xen-ia64/for_eagl/linux-2.6-ia64-pv-ops.git/
136+
is also available. The tree is based on
137+
git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 test)
138+
139+
140+
3. copy .config for pv_ops of domU
141+
# cp arch/ia64/configs/xen_domu_wip_defconfig .config
142+
143+
4. make kernel with pv_ops
144+
# make oldconfig
145+
# make
146+
147+
5. install the kernel and initrd
148+
# cp vmlinux.gz /boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU
149+
# make modules_install
150+
# mkinitrd -f /boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img \
151+
2.6.26-rc3xen-ia64-08941-g1b12161 --builtin mptspi \
152+
--builtin mptbase --builtin mptscsih --builtin uhci-hcd \
153+
--builtin ohci-hcd --builtin ehci-hcd
154+
155+
========================
156+
Boot DomainU with pv_ops
157+
========================
158+
159+
1. make config of DomU
160+
# vi /etc/xen/rhel5
161+
kernel = "/boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU"
162+
ramdisk = "/boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img"
163+
vcpus = 1
164+
memory = 512
165+
name = "rhel5"
166+
disk = [ 'file:/root/rhel5.img,xvda1,w' ]
167+
root = "/dev/xvda1 ro"
168+
extra= "rhgb console=hvc0"
169+
170+
2. After boot xen and dom0, start xend
171+
# /etc/init.d/xend start
172+
( In the debugging case, # XEND_DEBUG=1 xend trace_start )
173+
174+
3. start domU
175+
# xm create -c rhel5
176+
177+
=========
178+
Reference
179+
=========
180+
- Wiki of Xen/IA64 upstream merge
181+
http://wiki.xensource.com/xenwiki/XenIA64/UpstreamMerge
182+
183+
Written by Akio Takebe <takebe_akio@jp.fujitsu.com> on 28 May 2008

‎arch/ia64/Kconfig‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,33 @@ config AUDIT_ARCH
109109
bool
110110
default y
111111

112+
menuconfig PARAVIRT_GUEST
113+
bool "Paravirtualized guest support"
114+
help
115+
Say Y here to get to see options related to running Linux under
116+
various hypervisors. This option alone does not add any kernel code.
117+
118+
If you say N, all options in this submenu will be skipped and disabled.
119+
120+
if PARAVIRT_GUEST
121+
122+
config PARAVIRT
123+
bool "Enable paravirtualization code"
124+
depends on PARAVIRT_GUEST
125+
default y
126+
bool
127+
default y
128+
help
129+
This changes the kernel so it can modify itself when it is run
130+
under a hypervisor, potentially improving performance significantly
131+
over full virtualization. However, when run without a hypervisor
132+
the kernel is theoretically slower and slightly larger.
133+
134+
135+
source "arch/ia64/xen/Kconfig"
136+
137+
endif
138+
112139
choice
113140
prompt "System type"
114141
default IA64_GENERIC
@@ -130,6 +157,7 @@ config IA64_GENERIC
130157
SGI-SN2 For SGI Altix systems
131158
SGI-UV For SGI UV systems
132159
Ski-simulator For the HP simulator <http://www.hpl.hp.com/research/linux/ski/>
160+
Xen-domU For xen domU system
133161

134162
If you don't know what to do, choose "generic".
135163

@@ -180,6 +208,10 @@ config IA64_HP_SIM
180208
bool "Ski-simulator"
181209
select SWIOTLB
182210

211+
config IA64_XEN_GUEST
212+
bool "Xen guest"
213+
depends on XEN
214+
183215
endchoice
184216

185217
choice

‎arch/ia64/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ core-$(CONFIG_IA64_DIG) += arch/ia64/dig/
5656
core-$(CONFIG_IA64_GENERIC) += arch/ia64/dig/
5757
core-$(CONFIG_IA64_HP_ZX1) += arch/ia64/dig/
5858
core-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += arch/ia64/dig/
59+
core-$(CONFIG_IA64_XEN_GUEST) += arch/ia64/dig/
5960
core-$(CONFIG_IA64_SGI_SN2) += arch/ia64/sn/
6061
core-$(CONFIG_IA64_SGI_UV) += arch/ia64/uv/
6162
core-$(CONFIG_KVM) += arch/ia64/kvm/
63+
core-$(CONFIG_XEN) += arch/ia64/xen/
6264

6365
drivers-$(CONFIG_PCI) += arch/ia64/pci/
6466
drivers-$(CONFIG_IA64_HP_SIM) += arch/ia64/hp/sim/

‎arch/ia64/include/asm/break.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,13 @@
2020
*/
2121
#define __IA64_BREAK_SYSCALL 0x100000
2222

23+
/*
24+
* Xen specific break numbers:
25+
*/
26+
#define __IA64_XEN_HYPERCALL 0x1000
27+
/* [__IA64_XEN_HYPERPRIVOP_START, __IA64_XEN_HYPERPRIVOP_MAX] is used
28+
for xen hyperprivops */
29+
#define __IA64_XEN_HYPERPRIVOP_START 0x1
30+
#define __IA64_XEN_HYPERPRIVOP_MAX 0x1a
31+
2332
#endif /* _ASM_IA64_BREAK_H */

‎arch/ia64/include/asm/machvec.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *);
128128
# include <asm/machvec_sn2.h>
129129
# elif defined (CONFIG_IA64_SGI_UV)
130130
# include <asm/machvec_uv.h>
131+
# elif defined (CONFIG_IA64_XEN_GUEST)
132+
# include <asm/machvec_xen.h>
131133
# elif defined (CONFIG_IA64_GENERIC)
132134

133135
# ifdef MACHVEC_PLATFORM_HEADER
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef _ASM_IA64_MACHVEC_XEN_h
2+
#define _ASM_IA64_MACHVEC_XEN_h
3+
4+
extern ia64_mv_setup_t dig_setup;
5+
extern ia64_mv_cpu_init_t xen_cpu_init;
6+
extern ia64_mv_irq_init_t xen_irq_init;
7+
extern ia64_mv_send_ipi_t xen_platform_send_ipi;
8+
9+
/*
10+
* This stuff has dual use!
11+
*
12+
* For a generic kernel, the macros are used to initialize the
13+
* platform's machvec structure. When compiling a non-generic kernel,
14+
* the macros are used directly.
15+
*/
16+
#define platform_name "xen"
17+
#define platform_setup dig_setup
18+
#define platform_cpu_init xen_cpu_init
19+
#define platform_irq_init xen_irq_init
20+
#define platform_send_ipi xen_platform_send_ipi
21+
22+
#endif /* _ASM_IA64_MACHVEC_XEN_h */

‎arch/ia64/include/asm/meminit.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
* - crash dumping code reserved region
1919
* - Kernel memory map built from EFI memory map
2020
* - ELF core header
21+
* - xen start info if CONFIG_XEN
2122
*
2223
* More could be added if necessary
2324
*/
24-
#define IA64_MAX_RSVD_REGIONS 8
25+
#define IA64_MAX_RSVD_REGIONS 9
2526

2627
struct rsvd_region {
2728
unsigned long start; /* virtual address of beginning of element */

‎arch/ia64/include/asm/native/inst.h‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@
3636
;; \
3737
movl clob = PARAVIRT_POISON; \
3838
;;
39+
# define CLOBBER_PRED(pred_clob) \
40+
;; \
41+
cmp.eq pred_clob, p0 = r0, r0 \
42+
;;
3943
#else
40-
# define CLOBBER(clob) /* nothing */
44+
# define CLOBBER(clob) /* nothing */
45+
# define CLOBBER_PRED(pred_clob) /* nothing */
4146
#endif
4247

4348
#define MOV_FROM_IFA(reg) \
@@ -136,7 +141,8 @@
136141

137142
#define SSM_PSR_I(pred, pred_clob, clob) \
138143
(pred) ssm psr.i \
139-
CLOBBER(clob)
144+
CLOBBER(clob) \
145+
CLOBBER_PRED(pred_clob)
140146

141147
#define RSM_PSR_I(pred, clob0, clob1) \
142148
(pred) rsm psr.i \

0 commit comments

Comments
 (0)