- Update Xen patches to c/s 1011.
[opensuse:kernel-source.git] / 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 1011:11175e60d393)
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 2.6.30/arch/x86/kernel/acpi/boot.c
11
12 --- sle11sp1-2010-03-29.orig/arch/x86/Makefile  2010-03-29 09:00:35.000000000 +0200
13 +++ sle11sp1-2010-03-29/arch/x86/Makefile       2009-12-04 10:44:45.000000000 +0100
14 @@ -111,6 +111,10 @@ endif
15  # prevent gcc from generating any FP code by mistake
16  KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
17  
18 +# Xen subarch support
19 +mflags-$(CONFIG_X86_XEN)       := -Iinclude/asm-x86/mach-xen
20 +mcore-$(CONFIG_X86_XEN)                := arch/x86/mach-xen/
21 +
22  KBUILD_CFLAGS += $(mflags-y)
23  KBUILD_AFLAGS += $(mflags-y)
24  
25 @@ -151,9 +155,26 @@ boot := arch/x86/boot
26  
27  BOOT_TARGETS = bzlilo bzdisk fdimage fdimage144 fdimage288 isoimage
28  
29 -PHONY += bzImage $(BOOT_TARGETS)
30 +PHONY += bzImage vmlinuz $(BOOT_TARGETS)
31 +
32 +ifdef CONFIG_XEN
33 +CPPFLAGS := -D__XEN_INTERFACE_VERSION__=$(CONFIG_XEN_INTERFACE_VERSION) \
34 +       -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(CPPFLAGS)
35 +
36 +ifdef CONFIG_X86_64
37 +LDFLAGS_vmlinux := -e startup_64
38 +endif
39  
40  # Default kernel to build
41 +all: vmlinuz
42 +
43 +# KBUILD_IMAGE specifies the target image being built
44 +KBUILD_IMAGE := $(boot)/vmlinuz
45 +
46 +vmlinuz: vmlinux
47 +       $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
48 +else
49 +# Default kernel to build
50  all: bzImage
51  
52  # KBUILD_IMAGE specify target image being built
53 @@ -166,6 +187,7 @@ bzImage: vmlinux
54  
55  $(BOOT_TARGETS): vmlinux
56         $(Q)$(MAKE) $(build)=$(boot) $@
57 +endif
58  
59  PHONY += install
60  install:
61 --- sle11sp1-2010-03-29.orig/arch/x86/boot/Makefile     2010-03-29 09:00:35.000000000 +0200
62 +++ sle11sp1-2010-03-29/arch/x86/boot/Makefile  2009-12-04 10:44:45.000000000 +0100
63 @@ -23,6 +23,7 @@ ROOT_DEV      := CURRENT
64  SVGA_MODE      := -DSVGA_MODE=NORMAL_VGA
65  
66  targets                := vmlinux.bin setup.bin setup.elf bzImage
67 +targets                += vmlinuz vmlinux-stripped
68  targets                += fdimage fdimage144 fdimage288 image.iso mtools.conf
69  subdir-                := compressed
70  
71 @@ -195,6 +196,14 @@ bzlilo: $(obj)/bzImage
72         cp System.map $(INSTALL_PATH)/
73         if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
74  
75 +$(obj)/vmlinuz: $(obj)/vmlinux-stripped FORCE
76 +       $(call if_changed,gzip)
77 +       @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
78 +
79 +$(obj)/vmlinux-stripped: OBJCOPYFLAGS := -g --strip-unneeded
80 +$(obj)/vmlinux-stripped: vmlinux FORCE
81 +       $(call if_changed,objcopy)
82 +
83  install:
84         sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
85                 System.map "$(INSTALL_PATH)"
86 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/Makefile   2010-03-29 09:00:35.000000000 +0200
87 +++ sle11sp1-2010-03-29/arch/x86/kernel/Makefile        2009-12-04 10:44:45.000000000 +0100
88 @@ -117,9 +117,12 @@ obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) 
89  
90  obj-$(CONFIG_SWIOTLB)                  += pci-swiotlb.o
91  
92 +obj-$(CONFIG_X86_XEN)          += fixup.o
93 +
94  ###
95  # 64 bit specific files
96  ifeq ($(CONFIG_X86_64),y)
97 +       obj-$(CONFIG_X86_XEN_GENAPIC)   += genapic_xen_64.o
98         obj-$(CONFIG_X86_UV)            += tlb_uv.o bios_uv.o uv_irq.o uv_sysfs.o uv_time.o
99         obj-$(CONFIG_X86_PM_TIMER)      += pmtimer_64.o
100         obj-$(CONFIG_AUDIT)             += audit_64.o
101 @@ -130,4 +133,10 @@ ifeq ($(CONFIG_X86_64),y)
102  
103         obj-$(CONFIG_PCI_MMCONFIG)      += mmconf-fam10h_64.o
104         obj-y                           += vsmp_64.o
105 +
106 +       time_64-$(CONFIG_XEN)           += time_32.o
107 +       pci-dma_64-$(CONFIG_XEN)        += pci-dma_32.o
108  endif
109 +
110 +disabled-obj-$(CONFIG_XEN) := i8259_$(BITS).o reboot.o smpboot_$(BITS).o
111 +%/head_$(BITS).o %/head_$(BITS).s: $(if $(CONFIG_XEN),EXTRA_AFLAGS,dummy) :=
112 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/acpi/Makefile      2010-03-29 09:00:35.000000000 +0200
113 +++ sle11sp1-2010-03-29/arch/x86/kernel/acpi/Makefile   2009-12-04 10:44:45.000000000 +0100
114 @@ -5,6 +5,9 @@ obj-$(CONFIG_ACPI_SLEEP)        += sleep.o wake
115  
116  ifneq ($(CONFIG_ACPI_PROCESSOR),)
117  obj-y                          += cstate.o processor.o
118 +ifneq ($(CONFIG_PROCESSOR_EXTERNAL_CONTROL),)
119 +obj-$(CONFIG_XEN)              += processor_extcntl_xen.o
120 +endif
121  endif
122  
123  $(obj)/wakeup_rm.o:    $(obj)/realmode/wakeup.bin
124 @@ -12,3 +15,4 @@ $(obj)/wakeup_rm.o:    $(obj)/realmode/w
125  $(obj)/realmode/wakeup.bin: FORCE
126         $(Q)$(MAKE) $(build)=$(obj)/realmode
127  
128 +disabled-obj-$(CONFIG_XEN)     := cstate.o wakeup_$(BITS).o
129 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/acpi/processor.c   2010-03-29 09:00:35.000000000 +0200
130 +++ sle11sp1-2010-03-29/arch/x86/kernel/acpi/processor.c        2009-12-04 10:44:45.000000000 +0100
131 @@ -76,7 +76,18 @@ static void init_intel_pdc(struct acpi_p
132  /* Initialize _PDC data based on the CPU vendor */
133  void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
134  {
135 +#ifdef CONFIG_XEN
136 +       /*
137 +        * As a work-around, just use cpu0's cpuinfo for all processors.
138 +        * Further work is required to expose xen hypervisor interface of
139 +        * getting physical cpuinfo to dom0 kernel and then
140 +        * arch_acpi_processor_init_pdc can set _PDC parameters according
141 +        * to Xen's phys information.
142 +        */
143 +       struct cpuinfo_x86 *c = &boot_cpu_data;
144 +#else
145         struct cpuinfo_x86 *c = &cpu_data(pr->id);
146 +#endif
147  
148         pr->pdc = NULL;
149         if (c->x86_vendor == X86_VENDOR_INTEL ||
150 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/cpu/mcheck/Makefile        2010-03-29 09:00:35.000000000 +0200
151 +++ sle11sp1-2010-03-29/arch/x86/kernel/cpu/mcheck/Makefile     2010-01-27 14:28:25.000000000 +0100
152 @@ -4,6 +4,7 @@ obj-$(CONFIG_X86_ANCIENT_MCE)   += winchip
153  obj-$(CONFIG_X86_MCE_INTEL)    += mce_intel.o
154  obj-$(CONFIG_X86_MCE_XEON75XX) += mce-xeon75xx.o
155  obj-$(CONFIG_X86_MCE_AMD)      += mce_amd.o
156 +obj-$(CONFIG_X86_XEN_MCE)      += mce_dom0.o
157  obj-$(CONFIG_X86_MCE_THRESHOLD) += threshold.o
158  obj-$(CONFIG_X86_MCE_INJECT)   += mce-inject.o
159  
160 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/cpu/mcheck/mce.c   2010-03-29 09:00:35.000000000 +0200
161 +++ sle11sp1-2010-03-29/arch/x86/kernel/cpu/mcheck/mce.c        2010-01-27 14:28:39.000000000 +0100
162 @@ -1127,8 +1127,15 @@ void mce_log_therm_throt_event(__u64 sta
163   * Periodic polling timer for "silent" machine check errors.  If the
164   * poller finds an MCE, poll 2x faster.  When the poller finds no more
165   * errors, poll 2x slower (up to check_interval seconds).
166 + *
167 + * We will disable polling in DOM0 since all CMCI/Polling
168 + * mechanism will be done in XEN for Intel CPUs
169   */
170 +#if defined (CONFIG_X86_XEN_MCE)
171 +static int check_interval = 0; /* disable polling */
172 +#else
173  static int check_interval = 5 * 60; /* 5 minutes */
174 +#endif
175  
176  static DEFINE_PER_CPU(int, mce_next_interval); /* in jiffies */
177  static DEFINE_PER_CPU(struct timer_list, mce_timer);
178 @@ -1293,6 +1300,7 @@ static int __cpuinit mce_cpu_quirks(stru
179  
180         /* This should be disabled by the BIOS, but isn't always */
181         if (c->x86_vendor == X86_VENDOR_AMD) {
182 +#ifndef CONFIG_XEN
183                 if (c->x86 == 15 && banks > 4) {
184                         /*
185                          * disable GART TBL walk error reporting, which
186 @@ -1301,6 +1309,7 @@ static int __cpuinit mce_cpu_quirks(stru
187                          */
188                         clear_bit(10, (unsigned long *)&mce_banks[4].ctl);
189                 }
190 +#endif
191                 if (c->x86 <= 17 && mce_bootlog < 0) {
192                         /*
193                          * Lots of broken BIOS around that don't clear them
194 @@ -1368,6 +1377,7 @@ static void __cpuinit mce_ancient_init(s
195  
196  static void mce_cpu_features(struct cpuinfo_x86 *c)
197  {
198 +#ifndef CONFIG_X86_64_XEN
199         switch (c->x86_vendor) {
200         case X86_VENDOR_INTEL:
201                 mce_intel_feature_init(c);
202 @@ -1378,6 +1388,7 @@ static void mce_cpu_features(struct cpui
203         default:
204                 break;
205         }
206 +#endif
207  }
208  
209  static void mce_init_timer(void)
210 @@ -2064,6 +2075,16 @@ static __init int mce_init_device(void)
211         register_hotcpu_notifier(&mce_cpu_notifier);
212         misc_register(&mce_log_device);
213  
214 +#ifdef CONFIG_X86_XEN_MCE
215 +       if (is_initial_xendomain()) {
216 +               /* Register vIRQ handler for MCE LOG processing */
217 +               extern void bind_virq_for_mce(void);
218 +
219 +               printk(KERN_DEBUG "MCE: bind virq for DOM0 logging\n");
220 +               bind_virq_for_mce();
221 +       }
222 +#endif
223 +
224         return err;
225  }
226  
227 --- sle11sp1-2010-03-29.orig/arch/x86/kernel/cpu/mtrr/Makefile  2010-03-29 09:00:35.000000000 +0200
228 +++ sle11sp1-2010-03-29/arch/x86/kernel/cpu/mtrr/Makefile       2009-12-04 10:44:45.000000000 +0100
229 @@ -1,3 +1,4 @@
230  obj-y          := main.o if.o generic.o state.o cleanup.o
231  obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o
232  
233 +obj-$(CONFIG_XEN) := main.o if.o
234 --- sle11sp1-2010-03-29.orig/arch/x86/lib/Makefile      2010-03-29 09:00:35.000000000 +0200
235 +++ sle11sp1-2010-03-29/arch/x86/lib/Makefile   2010-03-29 09:06:18.000000000 +0200
236 @@ -28,3 +28,5 @@ else
237          lib-y += copy_user_64.o rwlock_64.o copy_user_nocache_64.o
238         lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem_64.o
239  endif
240 +
241 +lib-$(CONFIG_XEN_SCRUB_PAGES) += scrub.o
242 --- sle11sp1-2010-03-29.orig/arch/x86/mm/Makefile       2010-03-29 09:00:35.000000000 +0200
243 +++ sle11sp1-2010-03-29/arch/x86/mm/Makefile    2009-12-04 10:44:45.000000000 +0100
244 @@ -25,4 +25,6 @@ obj-$(CONFIG_NUMA)            += numa.o numa_$(BIT
245  obj-$(CONFIG_K8_NUMA)          += k8topology_64.o
246  obj-$(CONFIG_ACPI_NUMA)                += srat_$(BITS).o
247  
248 +obj-$(CONFIG_XEN)              += hypervisor.o
249 +
250  obj-$(CONFIG_MEMTEST)          += memtest.o
251 --- sle11sp1-2010-03-29.orig/arch/x86/oprofile/Makefile 2010-03-29 09:00:35.000000000 +0200
252 +++ sle11sp1-2010-03-29/arch/x86/oprofile/Makefile      2009-12-04 10:44:45.000000000 +0100
253 @@ -6,7 +6,14 @@ DRIVER_OBJS = $(addprefix ../../../drive
254                 oprofilefs.o oprofile_stats.o  \
255                 timer_int.o )
256  
257 +ifdef CONFIG_XEN
258 +XENOPROF_COMMON_OBJS = $(addprefix ../../../drivers/xen/xenoprof/, \
259 +                        xenoprofile.o)
260 +oprofile-y                             := $(DRIVER_OBJS) \
261 +                                          $(XENOPROF_COMMON_OBJS) xenoprof.o
262 +else
263  oprofile-y                             := $(DRIVER_OBJS) init.o backtrace.o
264  oprofile-$(CONFIG_X86_LOCAL_APIC)      += nmi_int.o op_model_amd.o \
265                                            op_model_ppro.o op_model_p4.o
266  oprofile-$(CONFIG_X86_IO_APIC)         += nmi_timer_int.o
267 +endif
268 --- sle11sp1-2010-03-29.orig/arch/x86/pci/Makefile      2010-03-29 09:00:35.000000000 +0200
269 +++ sle11sp1-2010-03-29/arch/x86/pci/Makefile   2009-12-04 10:44:45.000000000 +0100
270 @@ -4,6 +4,9 @@ obj-$(CONFIG_PCI_BIOS)          += pcbios.o
271  obj-$(CONFIG_PCI_MMCONFIG)     += mmconfig_$(BITS).o direct.o mmconfig-shared.o
272  obj-$(CONFIG_PCI_DIRECT)       += direct.o
273  obj-$(CONFIG_PCI_OLPC)         += olpc.o
274 +# pcifront should be after mmconfig.o and direct.o as it should only
275 +# take over if direct access to the PCI bus is unavailable
276 +obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += pcifront.o
277  
278  obj-y                          += fixup.o
279  obj-$(CONFIG_ACPI)             += acpi.o
280 --- sle11sp1-2010-03-29.orig/arch/x86/power/cpu.c       2010-03-29 09:00:35.000000000 +0200
281 +++ sle11sp1-2010-03-29/arch/x86/power/cpu.c    2009-12-04 10:44:45.000000000 +0100
282 @@ -125,6 +125,7 @@ static void do_fpu_end(void)
283  
284  static void fix_processor_context(void)
285  {
286 +#ifndef CONFIG_X86_NO_TSS
287         int cpu = smp_processor_id();
288         struct tss_struct *t = &per_cpu(init_tss, cpu);
289  
290 @@ -137,7 +138,10 @@ static void fix_processor_context(void)
291  
292  #ifdef CONFIG_X86_64
293         get_cpu_gdt_table(cpu)[GDT_ENTRY_TSS].type = 9;
294 +#endif
295 +#endif
296  
297 +#ifdef CONFIG_X86_64
298         syscall_init();                         /* This sets MSR_*STAR and related */
299  #endif
300         load_TR_desc();                         /* This does ltr */
301 --- sle11sp1-2010-03-29.orig/arch/x86/include/asm/acpi.h        2010-03-29 09:00:35.000000000 +0200
302 +++ sle11sp1-2010-03-29/arch/x86/include/asm/acpi.h     2009-12-04 10:44:45.000000000 +0100
303 @@ -30,6 +30,10 @@
304  #include <asm/mmu.h>
305  #include <asm/mpspec.h>
306  
307 +#ifdef CONFIG_XEN
308 +#include <xen/interface/platform.h>
309 +#endif
310 +
311  #define COMPILER_DEPENDENT_INT64   long long
312  #define COMPILER_DEPENDENT_UINT64  unsigned long long
313  
314 @@ -120,6 +124,27 @@ extern unsigned long acpi_wakeup_address
315  /* early initialization routine */
316  extern void acpi_reserve_bootmem(void);
317  
318 +#ifdef CONFIG_XEN
319 +static inline int acpi_notify_hypervisor_state(u8 sleep_state,
320 +                                              u32 pm1a_cnt_val,
321 +                                              u32 pm1b_cnt_val)
322 +{
323 +       struct xen_platform_op op = {
324 +               .cmd = XENPF_enter_acpi_sleep,
325 +               .interface_version = XENPF_INTERFACE_VERSION,
326 +               .u = {
327 +                       .enter_acpi_sleep = {
328 +                               .pm1a_cnt_val = pm1a_cnt_val,
329 +                               .pm1b_cnt_val = pm1b_cnt_val,
330 +                               .sleep_state = sleep_state,
331 +                       },
332 +               },
333 +       };
334 +
335 +       return HYPERVISOR_platform_op(&op);
336 +}
337 +#endif /* CONFIG_XEN */
338 +
339  /*
340   * Check if the CPU can handle C2 and deeper
341   */
342 @@ -152,7 +177,9 @@ static inline void disable_acpi(void) { 
343  
344  #endif /* !CONFIG_ACPI */
345  
346 +#ifndef CONFIG_XEN
347  #define ARCH_HAS_POWER_INIT    1
348 +#endif
349  
350  struct bootnode;
351  
352 --- sle11sp1-2010-03-29.orig/arch/x86/include/asm/apic.h        2010-03-29 09:00:35.000000000 +0200
353 +++ sle11sp1-2010-03-29/arch/x86/include/asm/apic.h     2009-12-04 10:44:45.000000000 +0100
354 @@ -15,7 +15,9 @@
355  #include <asm/system.h>
356  #include <asm/msr.h>
357  
358 +#ifndef CONFIG_XEN
359  #define ARCH_APICTIMER_STOPS_ON_C3     1
360 +#endif
361  
362  /*
363   * Debugging macros
364 --- sle11sp1-2010-03-29.orig/arch/x86/include/asm/kexec.h       2010-03-29 09:00:35.000000000 +0200
365 +++ sle11sp1-2010-03-29/arch/x86/include/asm/kexec.h    2009-12-04 10:44:45.000000000 +0100
366 @@ -163,6 +163,19 @@ struct kimage_arch {
367  };
368  #endif
369  
370 +/* Under Xen we need to work with machine addresses. These macros give the
371 + * machine address of a certain page to the generic kexec code instead of
372 + * the pseudo physical address which would be given by the default macros.
373 + */
374 +
375 +#ifdef CONFIG_XEN
376 +#define KEXEC_ARCH_HAS_PAGE_MACROS
377 +#define kexec_page_to_pfn(page)  pfn_to_mfn(page_to_pfn(page))
378 +#define kexec_pfn_to_page(pfn)   pfn_to_page(mfn_to_pfn(pfn))
379 +#define kexec_virt_to_phys(addr) virt_to_machine(addr)
380 +#define kexec_phys_to_virt(addr) phys_to_virt(machine_to_phys(addr))
381 +#endif
382 +
383  #endif /* __ASSEMBLY__ */
384  
385  #endif /* _ASM_X86_KEXEC_H */
386 --- sle11sp1-2010-03-29.orig/arch/x86/include/asm/types.h       2010-03-29 09:00:35.000000000 +0200
387 +++ sle11sp1-2010-03-29/arch/x86/include/asm/types.h    2010-02-09 16:45:16.000000000 +0100
388 @@ -9,7 +9,7 @@
389  #ifndef __ASSEMBLY__
390  
391  typedef u64 dma64_addr_t;
392 -#if defined(CONFIG_X86_64) || defined(CONFIG_HIGHMEM64G)
393 +#if defined(CONFIG_X86_64) || defined(CONFIG_XEN) || defined(CONFIG_HIGHMEM64G)
394  /* DMA addresses come in 32-bit and 64-bit flavours. */
395  typedef u64 dma_addr_t;
396  #else
397 --- sle11sp1-2010-03-29.orig/arch/x86/vdso/Makefile     2010-03-29 09:00:35.000000000 +0200
398 +++ sle11sp1-2010-03-29/arch/x86/vdso/Makefile  2009-12-04 10:44:49.000000000 +0100
399 @@ -65,6 +65,8 @@ obj-$(VDSO32-y)                       += vdso32-syms.lds
400  vdso32.so-$(VDSO32-y)          += int80
401  vdso32.so-$(CONFIG_COMPAT)     += syscall
402  vdso32.so-$(VDSO32-y)          += sysenter
403 +xen-vdso32-$(subst 1,$(CONFIG_COMPAT),$(shell expr $(CONFIG_XEN_COMPAT)0 '<' 0x0302000)) += int80
404 +vdso32.so-$(CONFIG_XEN)                += $(xen-vdso32-y)
405  
406  vdso32-images                  = $(vdso32.so-y:%=vdso32-%.so)
407  
408 --- sle11sp1-2010-03-29.orig/arch/x86/vdso/vdso32-setup.c       2010-03-29 09:00:35.000000000 +0200
409 +++ sle11sp1-2010-03-29/arch/x86/vdso/vdso32-setup.c    2009-12-04 10:44:46.000000000 +0100
410 @@ -26,6 +26,10 @@
411  #include <asm/vdso.h>
412  #include <asm/proto.h>
413  
414 +#ifdef CONFIG_XEN
415 +#include <xen/interface/callback.h>
416 +#endif
417 +
418  enum {
419         VDSO_DISABLED = 0,
420         VDSO_ENABLED = 1,
421 @@ -225,6 +229,7 @@ static inline void map_compat_vdso(int m
422  
423  void enable_sep_cpu(void)
424  {
425 +#ifndef CONFIG_XEN
426         int cpu = get_cpu();
427         struct tss_struct *tss = &per_cpu(init_tss, cpu);
428  
429 @@ -239,6 +244,35 @@ void enable_sep_cpu(void)
430         wrmsr(MSR_IA32_SYSENTER_ESP, tss->x86_tss.sp1, 0);
431         wrmsr(MSR_IA32_SYSENTER_EIP, (unsigned long) ia32_sysenter_target, 0);
432         put_cpu();      
433 +#else
434 +       extern asmlinkage void ia32pv_sysenter_target(void);
435 +       static struct callback_register sysenter = {
436 +               .type = CALLBACKTYPE_sysenter,
437 +               .address = { __KERNEL_CS, (unsigned long)ia32pv_sysenter_target },
438 +       };
439 +
440 +       if (!boot_cpu_has(X86_FEATURE_SEP))
441 +               return;
442 +
443 +       get_cpu();
444 +
445 +       if (xen_feature(XENFEAT_supervisor_mode_kernel))
446 +               sysenter.address.eip = (unsigned long)ia32_sysenter_target;
447 +
448 +       switch (HYPERVISOR_callback_op(CALLBACKOP_register, &sysenter)) {
449 +       case 0:
450 +               break;
451 +#if CONFIG_XEN_COMPAT < 0x030200
452 +       case -ENOSYS:
453 +               sysenter.type = CALLBACKTYPE_sysenter_deprecated;
454 +               if (HYPERVISOR_callback_op(CALLBACKOP_register, &sysenter) == 0)
455 +                       break;
456 +#endif
457 +       default:
458 +               clear_bit(X86_FEATURE_SEP, boot_cpu_data.x86_capability);
459 +               break;
460 +       }
461 +#endif
462  }
463  
464  static struct vm_area_struct gate_vma;