]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.xen/xen3-auto-arch-x86.diff
Add a patch to fix Intel E100 wake-on-lan problems.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.xen / xen3-auto-arch-x86.diff
1 Subject: xen3 arch-x86
2 From: http://xenbits.xensource.com/linux-2.6.18-xen.hg (tip 728:832aac894efd)
3 Patch-mainline: obsolete
4 Acked-by: jbeulich@novell.com
5
6 List of files that don't require modification anymore (and hence
7 removed from this patch), for reference and in case upstream wants to
8 take the forward porting patches:
9 2.6.26/arch/x86/kernel/crash.c
10
11 Index: head-2008-12-01/arch/x86/Makefile
12 ===================================================================
13 --- head-2008-12-01.orig/arch/x86/Makefile 2008-12-01 10:53:14.000000000 +0100
14 +++ head-2008-12-01/arch/x86/Makefile 2008-12-01 11:11:08.000000000 +0100
15 @@ -115,6 +115,10 @@ mcore-y := arch/x86/mach-default/
16 mflags-$(CONFIG_X86_VOYAGER) := -Iinclude/asm-x86/mach-voyager
17 mcore-$(CONFIG_X86_VOYAGER) := arch/x86/mach-voyager/
18
19 +# Xen subarch support
20 +mflags-$(CONFIG_X86_XEN) := -Iinclude/asm-x86/mach-xen
21 +mcore-$(CONFIG_X86_XEN) := arch/x86/mach-xen/
22 +
23 # generic subarchitecture
24 mflags-$(CONFIG_X86_GENERICARCH):= -Iinclude/asm-x86/mach-generic
25 fcore-$(CONFIG_X86_GENERICARCH) += arch/x86/mach-generic/
26 @@ -183,9 +187,26 @@ drivers-$(CONFIG_KDB) += arch/x86/kdb/
27
28 boot := arch/x86/boot
29
30 -PHONY += zImage bzImage compressed zlilo bzlilo \
31 +PHONY += zImage bzImage vmlinuz compressed zlilo bzlilo \
32 zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install
33
34 +ifdef CONFIG_XEN
35 +CPPFLAGS := -D__XEN_INTERFACE_VERSION__=$(CONFIG_XEN_INTERFACE_VERSION) \
36 + -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(CPPFLAGS)
37 +
38 +ifdef CONFIG_X86_64
39 +LDFLAGS_vmlinux := -e startup_64
40 +endif
41 +
42 +# Default kernel to build
43 +all: vmlinuz
44 +
45 +# KBUILD_IMAGE specifies the target image being built
46 +KBUILD_IMAGE := $(boot)/vmlinuz
47 +
48 +vmlinuz: vmlinux
49 + $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
50 +else
51 # Default kernel to build
52 all: bzImage
53
54 @@ -208,6 +229,7 @@ zdisk bzdisk: vmlinux
55
56 fdimage fdimage144 fdimage288 isoimage: vmlinux
57 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
58 +endif
59
60 install:
61 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
62 Index: head-2008-12-01/arch/x86/boot/Makefile
63 ===================================================================
64 --- head-2008-12-01.orig/arch/x86/boot/Makefile 2008-12-01 10:53:14.000000000 +0100
65 +++ head-2008-12-01/arch/x86/boot/Makefile 2008-12-01 11:11:08.000000000 +0100
66 @@ -25,7 +25,7 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
67
68 #RAMDISK := -DRAMDISK=512
69
70 -targets := vmlinux.bin setup.bin setup.elf zImage bzImage
71 +targets := vmlinux.bin setup.bin setup.elf zImage bzImage vmlinuz vmlinux-stripped
72 subdir- := compressed
73
74 setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o
75 @@ -190,5 +190,13 @@ zlilo: $(BOOTIMAGE)
76 cp System.map $(INSTALL_PATH)/
77 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
78
79 +$(obj)/vmlinuz: $(obj)/vmlinux-stripped FORCE
80 + $(call if_changed,gzip)
81 + @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
82 +
83 +$(obj)/vmlinux-stripped: OBJCOPYFLAGS := -g --strip-unneeded
84 +$(obj)/vmlinux-stripped: vmlinux FORCE
85 + $(call if_changed,objcopy)
86 +
87 install:
88 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
89 Index: head-2008-12-01/arch/x86/kernel/Makefile
90 ===================================================================
91 --- head-2008-12-01.orig/arch/x86/kernel/Makefile 2008-12-01 10:53:14.000000000 +0100
92 +++ head-2008-12-01/arch/x86/kernel/Makefile 2008-12-01 11:14:33.000000000 +0100
93 @@ -99,10 +99,13 @@ scx200-y += scx200_32.o
94
95 obj-$(CONFIG_OLPC) += olpc.o
96
97 +obj-$(CONFIG_X86_XEN) += fixup.o
98 +
99 ###
100 # 64 bit specific files
101 ifeq ($(CONFIG_X86_64),y)
102 obj-y += genapic_64.o genapic_flat_64.o genx2apic_uv_x.o tlb_uv.o
103 + obj-$(CONFIG_X86_XEN_GENAPIC) += genapic_xen_64.o
104 obj-y += uv_sysfs.o
105 obj-y += genx2apic_cluster.o
106 obj-y += genx2apic_phys.o
107 @@ -116,4 +119,10 @@ ifeq ($(CONFIG_X86_64),y)
108 obj-$(CONFIG_SWIOTLB) += pci-swiotlb_64.o
109
110 obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o
111 +
112 + time_64-$(CONFIG_XEN) += time_32.o
113 + pci-dma_64-$(CONFIG_XEN) += pci-dma_32.o
114 endif
115 +
116 +disabled-obj-$(CONFIG_XEN) := i8259_$(BITS).o reboot.o smpboot_$(BITS).o
117 +%/head_$(BITS).o %/head_$(BITS).s: $(if $(CONFIG_XEN),EXTRA_AFLAGS,dummy) :=
118 Index: head-2008-12-01/arch/x86/kernel/acpi/Makefile
119 ===================================================================
120 --- head-2008-12-01.orig/arch/x86/kernel/acpi/Makefile 2008-12-01 10:53:14.000000000 +0100
121 +++ head-2008-12-01/arch/x86/kernel/acpi/Makefile 2008-12-01 11:11:08.000000000 +0100
122 @@ -5,6 +5,9 @@ obj-$(CONFIG_ACPI_SLEEP) += sleep.o wake
123
124 ifneq ($(CONFIG_ACPI_PROCESSOR),)
125 obj-y += cstate.o processor.o
126 +ifneq ($(CONFIG_PROCESSOR_EXTERNAL_CONTROL),)
127 +obj-$(CONFIG_XEN) += processor_extcntl_xen.o
128 +endif
129 endif
130
131 $(obj)/wakeup_rm.o: $(obj)/realmode/wakeup.bin
132 @@ -12,3 +15,4 @@ $(obj)/wakeup_rm.o: $(obj)/realmode/w
133 $(obj)/realmode/wakeup.bin: FORCE
134 $(Q)$(MAKE) $(build)=$(obj)/realmode
135
136 +disabled-obj-$(CONFIG_XEN) := cstate.o wakeup_$(BITS).o
137 Index: head-2008-12-01/arch/x86/kernel/acpi/boot.c
138 ===================================================================
139 --- head-2008-12-01.orig/arch/x86/kernel/acpi/boot.c 2008-12-01 10:53:14.000000000 +0100
140 +++ head-2008-12-01/arch/x86/kernel/acpi/boot.c 2008-12-01 11:11:08.000000000 +0100
141 @@ -130,8 +130,10 @@ char *__init __acpi_map_table(unsigned l
142 if (!phys || !size)
143 return NULL;
144
145 +#ifndef CONFIG_XEN
146 if (phys+size <= (max_low_pfn_mapped << PAGE_SHIFT))
147 return __va(phys);
148 +#endif
149
150 offset = phys & (PAGE_SIZE - 1);
151 mapped_size = PAGE_SIZE - offset;
152 Index: head-2008-12-01/arch/x86/kernel/acpi/processor.c
153 ===================================================================
154 --- head-2008-12-01.orig/arch/x86/kernel/acpi/processor.c 2008-12-01 10:53:14.000000000 +0100
155 +++ head-2008-12-01/arch/x86/kernel/acpi/processor.c 2008-12-01 11:11:08.000000000 +0100
156 @@ -75,7 +75,18 @@ static void init_intel_pdc(struct acpi_p
157 /* Initialize _PDC data based on the CPU vendor */
158 void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
159 {
160 +#ifdef CONFIG_XEN
161 + /*
162 + * As a work-around, just use cpu0's cpuinfo for all processors.
163 + * Further work is required to expose xen hypervisor interface of
164 + * getting physical cpuinfo to dom0 kernel and then
165 + * arch_acpi_processor_init_pdc can set _PDC parameters according
166 + * to Xen's phys information.
167 + */
168 + struct cpuinfo_x86 *c = &boot_cpu_data;
169 +#else
170 struct cpuinfo_x86 *c = &cpu_data(pr->id);
171 +#endif
172
173 pr->pdc = NULL;
174 if (c->x86_vendor == X86_VENDOR_INTEL)
175 Index: head-2008-12-01/arch/x86/kernel/cpu/mtrr/Makefile
176 ===================================================================
177 --- head-2008-12-01.orig/arch/x86/kernel/cpu/mtrr/Makefile 2008-12-01 10:53:14.000000000 +0100
178 +++ head-2008-12-01/arch/x86/kernel/cpu/mtrr/Makefile 2008-12-01 11:11:08.000000000 +0100
179 @@ -1,3 +1,4 @@
180 obj-y := main.o if.o generic.o state.o
181 obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o
182
183 +obj-$(CONFIG_XEN) := main.o if.o
184 Index: head-2008-12-01/arch/x86/lib/Makefile
185 ===================================================================
186 --- head-2008-12-01.orig/arch/x86/lib/Makefile 2008-12-01 10:53:14.000000000 +0100
187 +++ head-2008-12-01/arch/x86/lib/Makefile 2008-12-01 11:11:08.000000000 +0100
188 @@ -25,3 +25,5 @@ else
189 lib-y += memmove_64.o memset_64.o
190 lib-y += copy_user_64.o rwlock_64.o copy_user_nocache_64.o
191 endif
192 +
193 +lib-$(CONFIG_XEN_SCRUB_PAGES) += scrub.o
194 Index: head-2008-12-01/arch/x86/mm/Makefile
195 ===================================================================
196 --- head-2008-12-01.orig/arch/x86/mm/Makefile 2008-12-01 10:53:14.000000000 +0100
197 +++ head-2008-12-01/arch/x86/mm/Makefile 2008-12-01 11:11:08.000000000 +0100
198 @@ -21,4 +21,6 @@ obj-$(CONFIG_K8_NUMA) += k8topology_64.
199 endif
200 obj-$(CONFIG_ACPI_NUMA) += srat_$(BITS).o
201
202 +obj-$(CONFIG_XEN) += hypervisor.o
203 +
204 obj-$(CONFIG_MEMTEST) += memtest.o
205 Index: head-2008-12-01/arch/x86/oprofile/Makefile
206 ===================================================================
207 --- head-2008-12-01.orig/arch/x86/oprofile/Makefile 2008-12-01 10:53:14.000000000 +0100
208 +++ head-2008-12-01/arch/x86/oprofile/Makefile 2008-12-01 11:11:08.000000000 +0100
209 @@ -6,7 +6,14 @@ DRIVER_OBJS = $(addprefix ../../../drive
210 oprofilefs.o oprofile_stats.o \
211 timer_int.o )
212
213 +ifdef CONFIG_XEN
214 +XENOPROF_COMMON_OBJS = $(addprefix ../../../drivers/xen/xenoprof/, \
215 + xenoprofile.o)
216 +oprofile-y := $(DRIVER_OBJS) \
217 + $(XENOPROF_COMMON_OBJS) xenoprof.o
218 +else
219 oprofile-y := $(DRIVER_OBJS) init.o backtrace.o
220 oprofile-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_athlon.o \
221 op_model_ppro.o op_model_p4.o
222 oprofile-$(CONFIG_X86_IO_APIC) += nmi_timer_int.o
223 +endif
224 Index: head-2008-12-01/arch/x86/pci/Makefile
225 ===================================================================
226 --- head-2008-12-01.orig/arch/x86/pci/Makefile 2008-12-01 10:53:14.000000000 +0100
227 +++ head-2008-12-01/arch/x86/pci/Makefile 2008-12-01 11:11:08.000000000 +0100
228 @@ -4,6 +4,9 @@ obj-$(CONFIG_PCI_BIOS) += pcbios.o
229 obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_$(BITS).o direct.o mmconfig-shared.o
230 obj-$(CONFIG_PCI_DIRECT) += direct.o
231 obj-$(CONFIG_PCI_OLPC) += olpc.o
232 +# pcifront should be after mmconfig.o and direct.o as it should only
233 +# take over if direct access to the PCI bus is unavailable
234 +obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += pcifront.o
235
236 obj-y += fixup.o
237 obj-$(CONFIG_ACPI) += acpi.o
238 Index: head-2008-12-01/include/asm-x86/acpi.h
239 ===================================================================
240 --- head-2008-12-01.orig/include/asm-x86/acpi.h 2008-12-01 10:53:14.000000000 +0100
241 +++ head-2008-12-01/include/asm-x86/acpi.h 2008-12-01 11:11:08.000000000 +0100
242 @@ -30,6 +30,10 @@
243 #include <asm/mmu.h>
244 #include <asm/mpspec.h>
245
246 +#ifdef CONFIG_XEN
247 +#include <xen/interface/platform.h>
248 +#endif
249 +
250 #define COMPILER_DEPENDENT_INT64 long long
251 #define COMPILER_DEPENDENT_UINT64 unsigned long long
252
253 @@ -124,6 +128,27 @@ extern unsigned long acpi_wakeup_address
254 /* early initialization routine */
255 extern void acpi_reserve_bootmem(void);
256
257 +#ifdef CONFIG_XEN
258 +static inline int acpi_notify_hypervisor_state(u8 sleep_state,
259 + u32 pm1a_cnt_val,
260 + u32 pm1b_cnt_val)
261 +{
262 + struct xen_platform_op op = {
263 + .cmd = XENPF_enter_acpi_sleep,
264 + .interface_version = XENPF_INTERFACE_VERSION,
265 + .u = {
266 + .enter_acpi_sleep = {
267 + .pm1a_cnt_val = pm1a_cnt_val,
268 + .pm1b_cnt_val = pm1b_cnt_val,
269 + .sleep_state = sleep_state,
270 + },
271 + },
272 + };
273 +
274 + return HYPERVISOR_platform_op(&op);
275 +}
276 +#endif /* CONFIG_XEN */
277 +
278 /*
279 * Check if the CPU can handle C2 and deeper
280 */
281 @@ -156,7 +181,9 @@ static inline void disable_acpi(void) {
282
283 #endif /* !CONFIG_ACPI */
284
285 +#ifndef CONFIG_XEN
286 #define ARCH_HAS_POWER_INIT 1
287 +#endif
288
289 struct bootnode;
290
291 Index: head-2008-12-01/include/asm-x86/apic.h
292 ===================================================================
293 --- head-2008-12-01.orig/include/asm-x86/apic.h 2008-12-01 10:53:14.000000000 +0100
294 +++ head-2008-12-01/include/asm-x86/apic.h 2008-12-01 11:11:08.000000000 +0100
295 @@ -12,7 +12,9 @@
296 #include <asm/cpufeature.h>
297 #include <asm/msr.h>
298
299 +#ifndef CONFIG_XEN
300 #define ARCH_APICTIMER_STOPS_ON_C3 1
301 +#endif
302
303 /*
304 * Debugging macros
305 Index: head-2008-12-01/include/asm-x86/kexec.h
306 ===================================================================
307 --- head-2008-12-01.orig/include/asm-x86/kexec.h 2008-12-01 10:53:14.000000000 +0100
308 +++ head-2008-12-01/include/asm-x86/kexec.h 2008-12-01 11:11:08.000000000 +0100
309 @@ -170,6 +170,19 @@ relocate_kernel(unsigned long indirectio
310 unsigned long start_address) ATTRIB_NORET;
311 #endif
312
313 +/* Under Xen we need to work with machine addresses. These macros give the
314 + * machine address of a certain page to the generic kexec code instead of
315 + * the pseudo physical address which would be given by the default macros.
316 + */
317 +
318 +#ifdef CONFIG_XEN
319 +#define KEXEC_ARCH_HAS_PAGE_MACROS
320 +#define kexec_page_to_pfn(page) pfn_to_mfn(page_to_pfn(page))
321 +#define kexec_pfn_to_page(pfn) pfn_to_page(mfn_to_pfn(pfn))
322 +#define kexec_virt_to_phys(addr) virt_to_machine(addr)
323 +#define kexec_phys_to_virt(addr) phys_to_virt(machine_to_phys(addr))
324 +#endif
325 +
326 #endif /* __ASSEMBLY__ */
327
328 #endif /* _KEXEC_H */