Annotation of /trunk/kernel26-xen/patches-2.6.25-r1/1012-2.6.25-xen-auto-arch-x86.patch
Parent Directory | Revision Log
Revision 609 -
(hide annotations)
(download)
Fri May 23 17:35:37 2008 UTC (16 years, 4 months ago) by niro
File size: 11458 byte(s)
Fri May 23 17:35:37 2008 UTC (16 years, 4 months ago) by niro
File size: 11458 byte(s)
-using opensuse xen patchset, updated kernel configs
1 | niro | 609 | Subject: xen3 arch-x86 |
2 | From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 517:d71965a78c20) | ||
3 | Patch-mainline: obsolete | ||
4 | Acked-by: jbeulich@novell.com | ||
5 | |||
6 | Index: head-2008-04-15/arch/x86/Makefile | ||
7 | =================================================================== | ||
8 | --- head-2008-04-15.orig/arch/x86/Makefile 2008-04-15 09:41:09.000000000 +0200 | ||
9 | +++ head-2008-04-15/arch/x86/Makefile 2008-04-15 09:59:26.000000000 +0200 | ||
10 | @@ -131,6 +131,10 @@ mcore-$(CONFIG_X86_BIGSMP) := arch/x86/m | ||
11 | mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-x86/mach-summit | ||
12 | mcore-$(CONFIG_X86_SUMMIT) := arch/x86/mach-default/ | ||
13 | |||
14 | +# Xen subarch support | ||
15 | +mflags-$(CONFIG_X86_XEN) := -Iinclude/asm-x86/mach-xen | ||
16 | +mcore-$(CONFIG_X86_XEN) := arch/x86/mach-xen/ | ||
17 | + | ||
18 | # generic subarchitecture | ||
19 | mflags-$(CONFIG_X86_GENERICARCH):= -Iinclude/asm-x86/mach-generic | ||
20 | fcore-$(CONFIG_X86_GENERICARCH) += arch/x86/mach-generic/ | ||
21 | @@ -208,9 +212,26 @@ drivers-$(CONFIG_KDB) += arch/x86/kdb/ | ||
22 | |||
23 | boot := arch/x86/boot | ||
24 | |||
25 | -PHONY += zImage bzImage compressed zlilo bzlilo \ | ||
26 | +PHONY += zImage bzImage vmlinuz compressed zlilo bzlilo \ | ||
27 | zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install | ||
28 | |||
29 | +ifdef CONFIG_XEN | ||
30 | +CPPFLAGS := -D__XEN_INTERFACE_VERSION__=$(CONFIG_XEN_INTERFACE_VERSION) \ | ||
31 | + -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(CPPFLAGS) | ||
32 | + | ||
33 | +ifdef CONFIG_X86_64 | ||
34 | +LDFLAGS_vmlinux := -e startup_64 | ||
35 | +endif | ||
36 | + | ||
37 | +# Default kernel to build | ||
38 | +all: vmlinuz | ||
39 | + | ||
40 | +# KBUILD_IMAGE specifies the target image being built | ||
41 | +KBUILD_IMAGE := $(boot)/vmlinuz | ||
42 | + | ||
43 | +vmlinuz: vmlinux | ||
44 | + $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) | ||
45 | +else | ||
46 | # Default kernel to build | ||
47 | all: bzImage | ||
48 | |||
49 | @@ -233,6 +254,7 @@ zdisk bzdisk: vmlinux | ||
50 | |||
51 | fdimage fdimage144 fdimage288 isoimage: vmlinux | ||
52 | $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ | ||
53 | +endif | ||
54 | |||
55 | install: | ||
56 | $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install | ||
57 | Index: head-2008-04-15/arch/x86/boot/Makefile | ||
58 | =================================================================== | ||
59 | --- head-2008-04-15.orig/arch/x86/boot/Makefile 2008-04-15 09:41:09.000000000 +0200 | ||
60 | +++ head-2008-04-15/arch/x86/boot/Makefile 2008-04-15 09:59:26.000000000 +0200 | ||
61 | @@ -25,7 +25,7 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA | ||
62 | |||
63 | #RAMDISK := -DRAMDISK=512 | ||
64 | |||
65 | -targets := vmlinux.bin setup.bin setup.elf zImage bzImage | ||
66 | +targets := vmlinux.bin setup.bin setup.elf zImage bzImage vmlinuz vmlinux-stripped | ||
67 | subdir- := compressed | ||
68 | |||
69 | setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o | ||
70 | @@ -176,5 +176,13 @@ zlilo: $(BOOTIMAGE) | ||
71 | cp System.map $(INSTALL_PATH)/ | ||
72 | if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi | ||
73 | |||
74 | +$(obj)/vmlinuz: $(obj)/vmlinux-stripped FORCE | ||
75 | + $(call if_changed,gzip) | ||
76 | + @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' | ||
77 | + | ||
78 | +$(obj)/vmlinux-stripped: OBJCOPYFLAGS := -g --strip-unneeded | ||
79 | +$(obj)/vmlinux-stripped: vmlinux FORCE | ||
80 | + $(call if_changed,objcopy) | ||
81 | + | ||
82 | install: | ||
83 | sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" | ||
84 | Index: head-2008-04-15/arch/x86/kernel/acpi/boot.c | ||
85 | =================================================================== | ||
86 | --- head-2008-04-15.orig/arch/x86/kernel/acpi/boot.c 2008-04-15 09:41:09.000000000 +0200 | ||
87 | +++ head-2008-04-15/arch/x86/kernel/acpi/boot.c 2008-04-15 09:59:26.000000000 +0200 | ||
88 | @@ -103,7 +103,7 @@ static u64 acpi_lapic_addr __initdata = | ||
89 | */ | ||
90 | enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC; | ||
91 | |||
92 | -#ifdef CONFIG_X86_64 | ||
93 | +#if defined(CONFIG_X86_64) && !defined(CONFIG_XEN) | ||
94 | |||
95 | /* rely on all ACPI tables being in the direct mapping */ | ||
96 | char *__init __acpi_map_table(unsigned long phys_addr, unsigned long size) | ||
97 | @@ -136,8 +136,10 @@ char *__init __acpi_map_table(unsigned l | ||
98 | unsigned long base, offset, mapped_size; | ||
99 | int idx; | ||
100 | |||
101 | +#ifndef CONFIG_XEN | ||
102 | if (phys + size < 8 * 1024 * 1024) | ||
103 | return __va(phys); | ||
104 | +#endif | ||
105 | |||
106 | offset = phys & (PAGE_SIZE - 1); | ||
107 | mapped_size = PAGE_SIZE - offset; | ||
108 | Index: head-2008-04-15/arch/x86/kernel/Makefile | ||
109 | =================================================================== | ||
110 | --- head-2008-04-15.orig/arch/x86/kernel/Makefile 2008-04-15 09:41:09.000000000 +0200 | ||
111 | +++ head-2008-04-15/arch/x86/kernel/Makefile 2008-04-15 09:59:26.000000000 +0200 | ||
112 | @@ -86,14 +86,23 @@ endif | ||
113 | obj-$(CONFIG_SCx200) += scx200.o | ||
114 | scx200-y += scx200_32.o | ||
115 | |||
116 | +obj-$(CONFIG_X86_XEN) += fixup.o | ||
117 | + | ||
118 | ### | ||
119 | # 64 bit specific files | ||
120 | ifeq ($(CONFIG_X86_64),y) | ||
121 | obj-y += genapic_64.o genapic_flat_64.o | ||
122 | + obj-$(CONFIG_X86_XEN_GENAPIC) += genapic_64.o genapic_xen_64.o | ||
123 | obj-$(CONFIG_X86_PM_TIMER) += pmtimer_64.o | ||
124 | obj-$(CONFIG_AUDIT) += audit_64.o | ||
125 | |||
126 | obj-$(CONFIG_GART_IOMMU) += pci-gart_64.o aperture_64.o | ||
127 | obj-$(CONFIG_CALGARY_IOMMU) += pci-calgary_64.o tce_64.o | ||
128 | obj-$(CONFIG_SWIOTLB) += pci-swiotlb_64.o | ||
129 | + | ||
130 | + time_64-$(CONFIG_XEN) += time_32.o | ||
131 | + pci-dma_64-$(CONFIG_XEN) += pci-dma_32.o | ||
132 | endif | ||
133 | + | ||
134 | +disabled-obj-$(CONFIG_XEN) := i8259_$(BITS).o reboot.o smpboot_$(BITS).o | ||
135 | +%/head_$(BITS).o %/head_$(BITS).s: $(if $(CONFIG_XEN),EXTRA_AFLAGS,dummy) := | ||
136 | Index: head-2008-04-15/arch/x86/kernel/acpi/Makefile | ||
137 | =================================================================== | ||
138 | --- head-2008-04-15.orig/arch/x86/kernel/acpi/Makefile 2008-04-15 09:41:09.000000000 +0200 | ||
139 | +++ head-2008-04-15/arch/x86/kernel/acpi/Makefile 2008-04-15 09:59:26.000000000 +0200 | ||
140 | @@ -5,3 +5,4 @@ ifneq ($(CONFIG_ACPI_PROCESSOR),) | ||
141 | obj-y += cstate.o processor.o | ||
142 | endif | ||
143 | |||
144 | +disabled-obj-$(CONFIG_XEN) := cstate.o wakeup_$(BITS).o | ||
145 | Index: head-2008-04-15/arch/x86/kernel/cpu/mtrr/Makefile | ||
146 | =================================================================== | ||
147 | --- head-2008-04-15.orig/arch/x86/kernel/cpu/mtrr/Makefile 2008-04-15 09:41:09.000000000 +0200 | ||
148 | +++ head-2008-04-15/arch/x86/kernel/cpu/mtrr/Makefile 2008-04-15 09:59:26.000000000 +0200 | ||
149 | @@ -1,3 +1,4 @@ | ||
150 | obj-y := main.o if.o generic.o state.o | ||
151 | obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o | ||
152 | |||
153 | +obj-$(CONFIG_XEN) := main.o if.o | ||
154 | Index: head-2008-04-15/arch/x86/kernel/crash.c | ||
155 | =================================================================== | ||
156 | --- head-2008-04-15.orig/arch/x86/kernel/crash.c 2008-04-15 09:41:09.000000000 +0200 | ||
157 | +++ head-2008-04-15/arch/x86/kernel/crash.c 2008-04-15 09:59:26.000000000 +0200 | ||
158 | @@ -35,6 +35,7 @@ | ||
159 | /* This keeps a track of which one is crashing cpu. */ | ||
160 | static int crashing_cpu; | ||
161 | |||
162 | +#ifndef CONFIG_XEN | ||
163 | #if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC) | ||
164 | static atomic_t waiting_for_crash_ipi; | ||
165 | |||
166 | @@ -120,6 +121,7 @@ static void nmi_shootdown_cpus(void) | ||
167 | /* There are no cpus to shootdown */ | ||
168 | } | ||
169 | #endif | ||
170 | +#endif /* CONFIG_XEN */ | ||
171 | |||
172 | void machine_crash_shutdown(struct pt_regs *regs) | ||
173 | { | ||
174 | @@ -136,11 +138,13 @@ void machine_crash_shutdown(struct pt_re | ||
175 | |||
176 | /* Make a note of crashing cpu. Will be used in NMI callback.*/ | ||
177 | crashing_cpu = safe_smp_processor_id(); | ||
178 | +#ifndef CONFIG_XEN | ||
179 | nmi_shootdown_cpus(); | ||
180 | lapic_shutdown(); | ||
181 | #if defined(CONFIG_X86_IO_APIC) | ||
182 | disable_IO_APIC(); | ||
183 | #endif | ||
184 | +#endif /* CONFIG_XEN */ | ||
185 | #ifdef CONFIG_HPET_TIMER | ||
186 | hpet_disable(); | ||
187 | #endif | ||
188 | Index: head-2008-04-15/arch/x86/lib/Makefile | ||
189 | =================================================================== | ||
190 | --- head-2008-04-15.orig/arch/x86/lib/Makefile 2008-04-15 09:41:09.000000000 +0200 | ||
191 | +++ head-2008-04-15/arch/x86/lib/Makefile 2008-04-15 09:59:26.000000000 +0200 | ||
192 | @@ -25,3 +25,5 @@ else | ||
193 | lib-y += memmove_64.o memset_64.o | ||
194 | lib-y += copy_user_64.o rwlock_64.o copy_user_nocache_64.o | ||
195 | endif | ||
196 | + | ||
197 | +lib-$(CONFIG_XEN_SCRUB_PAGES) += scrub.o | ||
198 | Index: head-2008-04-15/arch/x86/mm/Makefile | ||
199 | =================================================================== | ||
200 | --- head-2008-04-15.orig/arch/x86/mm/Makefile 2008-04-15 09:41:09.000000000 +0200 | ||
201 | +++ head-2008-04-15/arch/x86/mm/Makefile 2008-04-15 09:59:26.000000000 +0200 | ||
202 | @@ -3,3 +3,5 @@ include ${srctree}/arch/x86/mm/Makefile_ | ||
203 | else | ||
204 | include ${srctree}/arch/x86/mm/Makefile_64 | ||
205 | endif | ||
206 | + | ||
207 | +obj-$(CONFIG_XEN) += hypervisor.o | ||
208 | Index: head-2008-04-15/arch/x86/oprofile/Makefile | ||
209 | =================================================================== | ||
210 | --- head-2008-04-15.orig/arch/x86/oprofile/Makefile 2008-04-15 09:41:09.000000000 +0200 | ||
211 | +++ head-2008-04-15/arch/x86/oprofile/Makefile 2008-04-15 09:59:26.000000000 +0200 | ||
212 | @@ -6,7 +6,14 @@ DRIVER_OBJS = $(addprefix ../../../drive | ||
213 | oprofilefs.o oprofile_stats.o \ | ||
214 | timer_int.o ) | ||
215 | |||
216 | +ifdef CONFIG_XEN | ||
217 | +XENOPROF_COMMON_OBJS = $(addprefix ../../../drivers/xen/xenoprof/, \ | ||
218 | + xenoprofile.o) | ||
219 | +oprofile-y := $(DRIVER_OBJS) \ | ||
220 | + $(XENOPROF_COMMON_OBJS) xenoprof.o | ||
221 | +else | ||
222 | oprofile-y := $(DRIVER_OBJS) init.o backtrace.o | ||
223 | oprofile-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_athlon.o \ | ||
224 | op_model_ppro.o op_model_p4.o | ||
225 | oprofile-$(CONFIG_X86_IO_APIC) += nmi_timer_int.o | ||
226 | +endif | ||
227 | Index: head-2008-04-15/include/asm-x86/acpi.h | ||
228 | =================================================================== | ||
229 | --- head-2008-04-15.orig/include/asm-x86/acpi.h 2008-04-15 09:41:09.000000000 +0200 | ||
230 | +++ head-2008-04-15/include/asm-x86/acpi.h 2008-04-15 10:24:13.000000000 +0200 | ||
231 | @@ -29,6 +29,10 @@ | ||
232 | #include <asm/processor.h> | ||
233 | #include <asm/mmu.h> | ||
234 | |||
235 | +#ifdef CONFIG_XEN | ||
236 | +#include <xen/interface/platform.h> | ||
237 | +#endif | ||
238 | + | ||
239 | #define COMPILER_DEPENDENT_INT64 long long | ||
240 | #define COMPILER_DEPENDENT_UINT64 unsigned long long | ||
241 | |||
242 | @@ -123,6 +127,27 @@ extern unsigned long acpi_wakeup_address | ||
243 | /* early initialization routine */ | ||
244 | extern void acpi_reserve_bootmem(void); | ||
245 | |||
246 | +#ifdef CONFIG_XEN | ||
247 | +static inline int acpi_notify_hypervisor_state(u8 sleep_state, | ||
248 | + u32 pm1a_cnt_val, | ||
249 | + u32 pm1b_cnt_val) | ||
250 | +{ | ||
251 | + struct xen_platform_op op = { | ||
252 | + .cmd = XENPF_enter_acpi_sleep, | ||
253 | + .interface_version = XENPF_INTERFACE_VERSION, | ||
254 | + .u = { | ||
255 | + .enter_acpi_sleep = { | ||
256 | + .pm1a_cnt_val = pm1a_cnt_val, | ||
257 | + .pm1b_cnt_val = pm1b_cnt_val, | ||
258 | + .sleep_state = sleep_state, | ||
259 | + }, | ||
260 | + }, | ||
261 | + }; | ||
262 | + | ||
263 | + return HYPERVISOR_platform_op(&op); | ||
264 | +} | ||
265 | +#endif /* CONFIG_XEN */ | ||
266 | + | ||
267 | /* | ||
268 | * Check if the CPU can handle C2 and deeper | ||
269 | */ | ||
270 | @@ -153,7 +178,9 @@ static inline void disable_acpi(void) { | ||
271 | |||
272 | #endif /* !CONFIG_ACPI */ | ||
273 | |||
274 | +#ifndef CONFIG_XEN | ||
275 | #define ARCH_HAS_POWER_INIT 1 | ||
276 | +#endif | ||
277 | |||
278 | struct bootnode; | ||
279 | |||
280 | Index: head-2008-04-15/include/asm-x86/apic.h | ||
281 | =================================================================== | ||
282 | --- head-2008-04-15.orig/include/asm-x86/apic.h 2008-04-15 09:41:09.000000000 +0200 | ||
283 | +++ head-2008-04-15/include/asm-x86/apic.h 2008-04-15 09:59:26.000000000 +0200 | ||
284 | @@ -8,7 +8,9 @@ | ||
285 | #include <asm/processor.h> | ||
286 | #include <asm/system.h> | ||
287 | |||
288 | +#ifndef CONFIG_XEN | ||
289 | #define ARCH_APICTIMER_STOPS_ON_C3 1 | ||
290 | +#endif | ||
291 | |||
292 | #define Dprintk(x...) | ||
293 | |||
294 | Index: head-2008-04-15/include/asm-x86/kexec.h | ||
295 | =================================================================== | ||
296 | --- head-2008-04-15.orig/include/asm-x86/kexec.h 2008-04-15 09:41:09.000000000 +0200 | ||
297 | +++ head-2008-04-15/include/asm-x86/kexec.h 2008-04-15 09:59:26.000000000 +0200 | ||
298 | @@ -165,6 +165,19 @@ relocate_kernel(unsigned long indirectio | ||
299 | unsigned long start_address) ATTRIB_NORET; | ||
300 | #endif | ||
301 | |||
302 | +/* Under Xen we need to work with machine addresses. These macros give the | ||
303 | + * machine address of a certain page to the generic kexec code instead of | ||
304 | + * the pseudo physical address which would be given by the default macros. | ||
305 | + */ | ||
306 | + | ||
307 | +#ifdef CONFIG_XEN | ||
308 | +#define KEXEC_ARCH_HAS_PAGE_MACROS | ||
309 | +#define kexec_page_to_pfn(page) pfn_to_mfn(page_to_pfn(page)) | ||
310 | +#define kexec_pfn_to_page(pfn) pfn_to_page(mfn_to_pfn(pfn)) | ||
311 | +#define kexec_virt_to_phys(addr) virt_to_machine(addr) | ||
312 | +#define kexec_phys_to_virt(addr) phys_to_virt(machine_to_phys(addr)) | ||
313 | +#endif | ||
314 | + | ||
315 | #endif /* __ASSEMBLY__ */ | ||
316 | |||
317 | #endif /* _KEXEC_H */ |