ia64/xen-unstable
changeset 14734:2b24d842bbd3
linux: make compatibility config options more scalable
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
line diff
1.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S Thu Apr 05 08:46:54 2007 +0100 1.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S Thu Apr 05 08:58:32 2007 +0100 1.3 @@ -142,7 +142,7 @@ ENTRY(cpu_gdt_table) 1.4 .quad 0x0000000000000000 /* 0xf0 - unused */ 1.5 .quad 0x0000000000000000 /* 0xf8 - GDT entry 31: double-fault TSS */ 1.6 1.7 -#ifdef CONFIG_XEN_COMPAT_030002 1.8 +#if CONFIG_XEN_COMPAT <= 0x030002 1.9 /* 1.10 * __xen_guest information 1.11 */ 1.12 @@ -180,18 +180,18 @@ ENTRY(cpu_gdt_table) 1.13 #endif 1.14 .ascii ",LOADER=generic" 1.15 .byte 0 1.16 -#endif /* CONFIG_XEN_COMPAT_030002 */ 1.17 +#endif /* CONFIG_XEN_COMPAT <= 0x030002 */ 1.18 1.19 1.20 ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz, "linux") 1.21 ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION, .asciz, "2.6") 1.22 ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz, "xen-3.0") 1.23 ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, .long, __PAGE_OFFSET) 1.24 -#ifdef CONFIG_XEN_COMPAT_030002 1.25 +#if CONFIG_XEN_COMPAT <= 0x030002 1.26 ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, .long, __PAGE_OFFSET) 1.27 #else 1.28 ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, .long, 0) 1.29 -#endif /* !CONFIG_XEN_COMPAT_030002 */ 1.30 +#endif 1.31 ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, .long, startup_32) 1.32 ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .long, hypercall_page) 1.33 ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW, .long, HYPERVISOR_VIRT_START)
2.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c Thu Apr 05 08:46:54 2007 +0100 2.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c Thu Apr 05 08:58:32 2007 +0100 2.3 @@ -1010,7 +1010,7 @@ static void stop_hz_timer(void) 2.4 singleshot.timeout_abs_ns = jiffies_to_st(j); 2.5 singleshot.flags = 0; 2.6 rc = HYPERVISOR_vcpu_op(VCPUOP_set_singleshot_timer, cpu, &singleshot); 2.7 -#ifdef CONFIG_XEN_COMPAT_030004 2.8 +#if CONFIG_XEN_COMPAT <= 0x030004 2.9 if (rc) { 2.10 BUG_ON(rc != -ENOSYS); 2.11 rc = HYPERVISOR_set_timer_op(singleshot.timeout_abs_ns);
3.1 --- a/linux-2.6-xen-sparse/arch/i386/mach-xen/setup.c Thu Apr 05 08:46:54 2007 +0100 3.2 +++ b/linux-2.6-xen-sparse/arch/i386/mach-xen/setup.c Thu Apr 05 08:58:32 2007 +0100 3.3 @@ -114,7 +114,7 @@ void __init machine_specific_arch_setup( 3.4 ret = HYPERVISOR_callback_op(CALLBACKOP_register, &event); 3.5 if (ret == 0) 3.6 ret = HYPERVISOR_callback_op(CALLBACKOP_register, &failsafe); 3.7 -#ifdef CONFIG_XEN_COMPAT_030002 3.8 +#if CONFIG_XEN_COMPAT <= 0x030002 3.9 if (ret == -ENOSYS) 3.10 ret = HYPERVISOR_set_callbacks( 3.11 event.address.cs, event.address.eip, 3.12 @@ -123,7 +123,7 @@ void __init machine_specific_arch_setup( 3.13 BUG_ON(ret); 3.14 3.15 ret = HYPERVISOR_callback_op(CALLBACKOP_register, &nmi_cb); 3.16 -#ifdef CONFIG_XEN_COMPAT_030002 3.17 +#if CONFIG_XEN_COMPAT <= 0x030002 3.18 if (ret == -ENOSYS) { 3.19 static struct xennmi_callback __initdata cb = { 3.20 .handler_address = (unsigned long)nmi
4.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c Thu Apr 05 08:46:54 2007 +0100 4.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c Thu Apr 05 08:58:32 2007 +0100 4.3 @@ -312,7 +312,7 @@ int xen_create_contiguous_region( 4.4 success = (exchange.nr_exchanged == (1UL << order)); 4.5 BUG_ON(!success && ((exchange.nr_exchanged != 0) || (rc == 0))); 4.6 BUG_ON(success && (rc != 0)); 4.7 -#ifdef CONFIG_XEN_COMPAT_030002 4.8 +#if CONFIG_XEN_COMPAT <= 0x030002 4.9 if (unlikely(rc == -ENOSYS)) { 4.10 /* Compatibility when XENMEM_exchange is unsupported. */ 4.11 if (HYPERVISOR_memory_op(XENMEM_decrease_reservation, 4.12 @@ -408,7 +408,7 @@ void xen_destroy_contiguous_region(unsig 4.13 success = (exchange.nr_exchanged == 1); 4.14 BUG_ON(!success && ((exchange.nr_exchanged != 0) || (rc == 0))); 4.15 BUG_ON(success && (rc != 0)); 4.16 -#ifdef CONFIG_XEN_COMPAT_030002 4.17 +#if CONFIG_XEN_COMPAT <= 0x030002 4.18 if (unlikely(rc == -ENOSYS)) { 4.19 /* Compatibility when XENMEM_exchange is unsupported. */ 4.20 if (HYPERVISOR_memory_op(XENMEM_decrease_reservation,
5.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S Thu Apr 05 08:46:54 2007 +0100 5.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S Thu Apr 05 08:58:32 2007 +0100 5.3 @@ -152,7 +152,7 @@ gdt_end: 5.4 ENTRY(empty_zero_page) 5.5 .skip PAGE_SIZE 5.6 5.7 -#ifdef CONFIG_XEN_COMPAT_030002 5.8 +#if CONFIG_XEN_COMPAT <= 0x030002 5.9 /* 5.10 * __xen_guest information 5.11 */ 5.12 @@ -184,17 +184,17 @@ ENTRY(empty_zero_page) 5.13 .ascii "|supervisor_mode_kernel" 5.14 .ascii ",LOADER=generic" 5.15 .byte 0 5.16 -#endif /* CONFIG_XEN_COMPAT_030002 */ 5.17 +#endif /* CONFIG_XEN_COMPAT <= 0x030002 */ 5.18 5.19 ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz, "linux") 5.20 ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION, .asciz, "2.6") 5.21 ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz, "xen-3.0") 5.22 ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, .quad, __START_KERNEL_map) 5.23 -#ifdef CONFIG_XEN_COMPAT_030002 5.24 +#if CONFIG_XEN_COMPAT <= 0x030002 5.25 ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, .quad, __START_KERNEL_map) 5.26 #else 5.27 ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, .quad, 0) 5.28 -#endif /* !CONFIG_XEN_COMPAT_030002 */ 5.29 +#endif 5.30 ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, .quad, startup_64) 5.31 ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad, hypercall_page) 5.32 ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID, .quad, _PAGE_PRESENT,_PAGE_PRESENT)
6.1 --- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c Thu Apr 05 08:46:54 2007 +0100 6.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c Thu Apr 05 08:58:32 2007 +0100 6.3 @@ -54,7 +54,7 @@ 6.4 struct dma_mapping_ops* dma_ops; 6.5 EXPORT_SYMBOL(dma_ops); 6.6 6.7 -#ifdef CONFIG_XEN_COMPAT_030002 6.8 +#if CONFIG_XEN_COMPAT <= 0x030002 6.9 unsigned int __kernel_page_user; 6.10 EXPORT_SYMBOL(__kernel_page_user); 6.11 #endif 6.12 @@ -551,7 +551,7 @@ void __init xen_init_pt(void) 6.13 addr = page[pud_index(__START_KERNEL_map)]; 6.14 addr_to_page(addr, page); 6.15 6.16 -#ifdef CONFIG_XEN_COMPAT_030002 6.17 +#if CONFIG_XEN_COMPAT <= 0x030002 6.18 /* On Xen 3.0.2 and older we may need to explicitly specify _PAGE_USER 6.19 in kernel PTEs. We check that here. */ 6.20 if (HYPERVISOR_xen_version(XENVER_version, NULL) <= 0x30000) {
7.1 --- a/linux-2.6-xen-sparse/drivers/xen/Kconfig Thu Apr 05 08:46:54 2007 +0100 7.2 +++ b/linux-2.6-xen-sparse/drivers/xen/Kconfig Thu Apr 05 08:58:32 2007 +0100 7.3 @@ -235,13 +235,12 @@ choice 7.4 7.5 endchoice 7.6 7.7 -config XEN_COMPAT_030002 7.8 - bool 7.9 - default XEN_COMPAT_030002_AND_LATER 7.10 - 7.11 -config XEN_COMPAT_030004 7.12 - bool 7.13 - default XEN_COMPAT_030002_AND_LATER || XEN_COMPAT_030004_AND_LATER 7.14 +config XEN_COMPAT 7.15 + hex 7.16 + default 0xffffff if XEN_COMPAT_LATEST_ONLY 7.17 + default 0x030004 if XEN_COMPAT_030004_AND_LATER 7.18 + default 0x030002 if XEN_COMPAT_030002_AND_LATER 7.19 + default 0 7.20 7.21 endmenu 7.22
8.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h Thu Apr 05 08:46:54 2007 +0100 8.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h Thu Apr 05 08:58:32 2007 +0100 8.3 @@ -261,7 +261,7 @@ HYPERVISOR_event_channel_op( 8.4 { 8.5 int rc = _hypercall2(int, event_channel_op, cmd, arg); 8.6 8.7 -#ifdef CONFIG_XEN_COMPAT_030002 8.8 +#if CONFIG_XEN_COMPAT <= 0x030002 8.9 if (unlikely(rc == -ENOSYS)) { 8.10 struct evtchn_op op; 8.11 op.cmd = cmd; 8.12 @@ -301,7 +301,7 @@ HYPERVISOR_physdev_op( 8.13 { 8.14 int rc = _hypercall2(int, physdev_op, cmd, arg); 8.15 8.16 -#ifdef CONFIG_XEN_COMPAT_030002 8.17 +#if CONFIG_XEN_COMPAT <= 0x030002 8.18 if (unlikely(rc == -ENOSYS)) { 8.19 struct physdev_op op; 8.20 op.cmd = cmd; 8.21 @@ -358,7 +358,7 @@ HYPERVISOR_suspend( 8.22 int rc = _hypercall3(int, sched_op, SCHEDOP_shutdown, 8.23 &sched_shutdown, srec); 8.24 8.25 -#ifdef CONFIG_XEN_COMPAT_030002 8.26 +#if CONFIG_XEN_COMPAT <= 0x030002 8.27 if (rc == -ENOSYS) 8.28 rc = _hypercall3(int, sched_op_compat, SCHEDOP_shutdown, 8.29 SHUTDOWN_suspend, srec);
9.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h Thu Apr 05 08:46:54 2007 +0100 9.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h Thu Apr 05 08:58:32 2007 +0100 9.3 @@ -146,7 +146,7 @@ HYPERVISOR_yield( 9.4 { 9.5 int rc = HYPERVISOR_sched_op(SCHEDOP_yield, NULL); 9.6 9.7 -#ifdef CONFIG_XEN_COMPAT_030002 9.8 +#if CONFIG_XEN_COMPAT <= 0x030002 9.9 if (rc == -ENOSYS) 9.10 rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0); 9.11 #endif 9.12 @@ -160,7 +160,7 @@ HYPERVISOR_block( 9.13 { 9.14 int rc = HYPERVISOR_sched_op(SCHEDOP_block, NULL); 9.15 9.16 -#ifdef CONFIG_XEN_COMPAT_030002 9.17 +#if CONFIG_XEN_COMPAT <= 0x030002 9.18 if (rc == -ENOSYS) 9.19 rc = HYPERVISOR_sched_op_compat(SCHEDOP_block, 0); 9.20 #endif 9.21 @@ -178,7 +178,7 @@ HYPERVISOR_shutdown( 9.22 9.23 int rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown); 9.24 9.25 -#ifdef CONFIG_XEN_COMPAT_030002 9.26 +#if CONFIG_XEN_COMPAT <= 0x030002 9.27 if (rc == -ENOSYS) 9.28 rc = HYPERVISOR_sched_op_compat(SCHEDOP_shutdown, reason); 9.29 #endif 9.30 @@ -198,7 +198,7 @@ HYPERVISOR_poll( 9.31 set_xen_guest_handle(sched_poll.ports, ports); 9.32 9.33 rc = HYPERVISOR_sched_op(SCHEDOP_poll, &sched_poll); 9.34 -#ifdef CONFIG_XEN_COMPAT_030002 9.35 +#if CONFIG_XEN_COMPAT <= 0x030002 9.36 if (rc == -ENOSYS) 9.37 rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0); 9.38 #endif
10.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/page.h Thu Apr 05 08:46:54 2007 +0100 10.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/page.h Thu Apr 05 08:58:32 2007 +0100 10.3 @@ -102,7 +102,7 @@ static inline unsigned long long pte_val 10.4 static inline unsigned long long pmd_val(pmd_t x) 10.5 { 10.6 unsigned long long ret = x.pmd; 10.7 -#ifdef CONFIG_XEN_COMPAT_030002 10.8 +#if CONFIG_XEN_COMPAT <= 0x030002 10.9 if (ret) ret = pte_machine_to_phys(ret) | _PAGE_PRESENT; 10.10 #else 10.11 if (ret & _PAGE_PRESENT) ret = pte_machine_to_phys(ret); 10.12 @@ -134,7 +134,7 @@ typedef struct { unsigned long pgprot; } 10.13 static inline unsigned long pgd_val(pgd_t x) 10.14 { 10.15 unsigned long ret = x.pgd; 10.16 -#ifdef CONFIG_XEN_COMPAT_030002 10.17 +#if CONFIG_XEN_COMPAT <= 0x030002 10.18 if (ret) ret = machine_to_phys(ret) | _PAGE_PRESENT; 10.19 #else 10.20 if (ret & _PAGE_PRESENT) ret = machine_to_phys(ret); 10.21 @@ -197,10 +197,10 @@ extern int page_is_ram(unsigned long pag 10.22 #endif 10.23 #define __KERNEL_START (__PAGE_OFFSET + __PHYSICAL_START) 10.24 10.25 -#ifdef CONFIG_XEN_COMPAT_030002 10.26 +#if CONFIG_XEN_COMPAT <= 0x030002 10.27 #undef LOAD_OFFSET 10.28 #define LOAD_OFFSET 0 10.29 -#endif /* CONFIG_XEN_COMPAT_030002 */ 10.30 +#endif 10.31 10.32 #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) 10.33 #define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE)
11.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/hypercall.h Thu Apr 05 08:46:54 2007 +0100 11.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/hypercall.h Thu Apr 05 08:58:32 2007 +0100 11.3 @@ -259,7 +259,7 @@ HYPERVISOR_event_channel_op( 11.4 { 11.5 int rc = _hypercall2(int, event_channel_op, cmd, arg); 11.6 11.7 -#ifdef CONFIG_XEN_COMPAT_030002 11.8 +#if CONFIG_XEN_COMPAT <= 0x030002 11.9 if (unlikely(rc == -ENOSYS)) { 11.10 struct evtchn_op op; 11.11 op.cmd = cmd; 11.12 @@ -299,7 +299,7 @@ HYPERVISOR_physdev_op( 11.13 { 11.14 int rc = _hypercall2(int, physdev_op, cmd, arg); 11.15 11.16 -#ifdef CONFIG_XEN_COMPAT_030002 11.17 +#if CONFIG_XEN_COMPAT <= 0x030002 11.18 if (unlikely(rc == -ENOSYS)) { 11.19 struct physdev_op op; 11.20 op.cmd = cmd; 11.21 @@ -359,7 +359,7 @@ HYPERVISOR_suspend( 11.22 int rc = _hypercall3(int, sched_op, SCHEDOP_shutdown, 11.23 &sched_shutdown, srec); 11.24 11.25 -#ifdef CONFIG_XEN_COMPAT_030002 11.26 +#if CONFIG_XEN_COMPAT <= 0x030002 11.27 if (rc == -ENOSYS) 11.28 rc = _hypercall3(int, sched_op_compat, SCHEDOP_shutdown, 11.29 SHUTDOWN_suspend, srec);
12.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/page.h Thu Apr 05 08:46:54 2007 +0100 12.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/page.h Thu Apr 05 08:58:32 2007 +0100 12.3 @@ -104,7 +104,7 @@ typedef struct { unsigned long pgprot; } 12.4 static inline unsigned long pmd_val(pmd_t x) 12.5 { 12.6 unsigned long ret = x.pmd; 12.7 -#ifdef CONFIG_XEN_COMPAT_030002 12.8 +#if CONFIG_XEN_COMPAT <= 0x030002 12.9 if (ret) ret = pte_machine_to_phys(ret) | _PAGE_PRESENT; 12.10 #else 12.11 if (ret & _PAGE_PRESENT) ret = pte_machine_to_phys(ret); 12.12 @@ -166,10 +166,10 @@ static inline pgd_t __pgd(unsigned long 12.13 #define __PAGE_OFFSET 0xffff880000000000 12.14 #endif /* !__ASSEMBLY__ */ 12.15 12.16 -#ifdef CONFIG_XEN_COMPAT_030002 12.17 +#if CONFIG_XEN_COMPAT <= 0x030002 12.18 #undef LOAD_OFFSET 12.19 #define LOAD_OFFSET 0 12.20 -#endif /* CONFIG_XEN_COMPAT_030002 */ 12.21 +#endif 12.22 12.23 /* to align the pointer to the (next) page boundary */ 12.24 #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
13.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/pgtable.h Thu Apr 05 08:46:54 2007 +0100 13.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/pgtable.h Thu Apr 05 08:58:32 2007 +0100 13.3 @@ -205,7 +205,7 @@ static inline pte_t ptep_get_and_clear_f 13.4 #define _PAGE_PROTNONE 0x080 /* If not present */ 13.5 #define _PAGE_NX (1UL<<_PAGE_BIT_NX) 13.6 13.7 -#ifdef CONFIG_XEN_COMPAT_030002 13.8 +#if CONFIG_XEN_COMPAT <= 0x030002 13.9 extern unsigned int __kernel_page_user; 13.10 #else 13.11 #define __kernel_page_user 0
14.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h Thu Apr 05 08:46:54 2007 +0100 14.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h Thu Apr 05 08:58:32 2007 +0100 14.3 @@ -39,7 +39,7 @@ static void __init machine_specific_arch 14.4 ret = HYPERVISOR_callback_op(CALLBACKOP_register, &failsafe); 14.5 if (ret == 0) 14.6 ret = HYPERVISOR_callback_op(CALLBACKOP_register, &syscall); 14.7 -#ifdef CONFIG_XEN_COMPAT_030002 14.8 +#if CONFIG_XEN_COMPAT <= 0x030002 14.9 if (ret == -ENOSYS) 14.10 ret = HYPERVISOR_set_callbacks( 14.11 event.address, 14.12 @@ -50,7 +50,7 @@ static void __init machine_specific_arch 14.13 14.14 #ifdef CONFIG_X86_LOCAL_APIC 14.15 ret = HYPERVISOR_callback_op(CALLBACKOP_register, &nmi_cb); 14.16 -#ifdef CONFIG_XEN_COMPAT_030002 14.17 +#if CONFIG_XEN_COMPAT <= 0x030002 14.18 if (ret == -ENOSYS) { 14.19 static struct xennmi_callback __initdata cb = { 14.20 .handler_address = (unsigned long)nmi