From: Linus Torvalds Date: Fri, 18 Sep 2009 21:05:47 +0000 (-0700) Subject: Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel... X-Git-Tag: v2.6.32-rc1~629 X-Git-Url: http://bbs.cooldavid.org/git/?a=commitdiff_plain;h=78f28b7c555359c67c2a0d23f7436e915329421e;p=net-next-2.6.git Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (38 commits) x86: Move get/set_wallclock to x86_platform_ops x86: platform: Fix section annotations x86: apic namespace cleanup x86: Distangle ioapic and i8259 x86: Add Moorestown early detection x86: Add hardware_subarch ID for Moorestown x86: Add early platform detection x86: Move tsc_init to late_time_init x86: Move tsc_calibration to x86_init_ops x86: Replace the now identical time_32/64.c by time.c x86: time_32/64.c unify profile_pc x86: Move calibrate_cpu to tsc.c x86: Make timer setup and global variables the same in time_32/64.c x86: Remove mca bus ifdef from timer interrupt x86: Simplify timer_ack magic in time_32.c x86: Prepare unification of time_32/64.c x86: Remove do_timer hook x86: Add timer_init to x86_init_ops x86: Move percpu clockevents setup to x86_init_ops x86: Move xen_post_allocator_init into xen_pagetable_setup_done ... Fix up conflicts in arch/x86/include/asm/io_apic.h --- 78f28b7c555359c67c2a0d23f7436e915329421e diff --cc arch/x86/include/asm/io_apic.h index 85232d32fcb,e1f89a1a07e..7c7c16cde1f --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h @@@ -176,23 -179,14 +178,26 @@@ extern int setup_ioapic_entry(int apic int polarity, int vector, int pin); extern void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e); + extern void setup_ioapic_ids_from_mpc(void); + +struct mp_ioapic_gsi{ + int gsi_base; + int gsi_end; +}; +extern struct mp_ioapic_gsi mp_gsi_routing[]; +int mp_find_ioapic(int gsi); +int mp_find_ioapic_pin(int ioapic, int gsi); +void __init mp_register_ioapic(int id, u32 address, u32 gsi_base); + #else /* !CONFIG_X86_IO_APIC */ ++ #define io_apic_assign_pci_irqs 0 + #define setup_ioapic_ids_from_mpc x86_init_noop static const int timer_through_8259 = 0; static inline void ioapic_init_mappings(void) { } static inline void ioapic_insert_resources(void) { } - static inline void probe_nr_irqs_gsi(void) { } ++ #endif #endif /* _ASM_X86_IO_APIC_H */ diff --cc arch/x86/kernel/apic/io_apic.c index 3c8f9e75d03,6c961290a5f..809e1cf86d6 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@@ -3856,13 -3924,9 +3870,13 @@@ static int __io_apic_set_pci_routing(st /* * IRQs < 16 are already in the irq_2_pin[] map */ - if (irq >= NR_IRQS_LEGACY) { + if (irq >= nr_legacy_irqs) { cfg = desc->chip_data; - add_pin_to_irq_node(cfg, node, ioapic, pin); + if (add_pin_to_irq_node_nopanic(cfg, node, ioapic, pin)) { + printk(KERN_INFO "can not add pin %d for irq %d\n", + pin, irq); + return 0; + } } setup_IO_APIC_irq(ioapic, pin, irq, desc, trigger, polarity); diff --cc arch/x86/kernel/rtc.c index bf67dcb4a44,b8652f2e685..1cfbbfc3ae2 --- a/arch/x86/kernel/rtc.c +++ b/arch/x86/kernel/rtc.c @@@ -183,18 -184,12 +184,13 @@@ void read_persistent_clock(struct times unsigned long retval, flags; spin_lock_irqsave(&rtc_lock, flags); - retval = get_wallclock(); + retval = x86_platform.get_wallclock(); spin_unlock_irqrestore(&rtc_lock, flags); - return retval; + ts->tv_sec = retval; + ts->tv_nsec = 0; } - int update_persistent_clock(struct timespec now) - { - return set_rtc_mmss(now.tv_sec); - } - unsigned long long native_read_tsc(void) { return __native_read_tsc(); diff --cc arch/x86/kernel/setup.c index 19f15c4076f,fda22ec1a93..a55f6609fe1 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@@ -983,13 -955,10 +966,12 @@@ void __init setup_arch(char **cmdline_p kvmclock_init(); #endif - paravirt_pagetable_setup_start(swapper_pg_dir); + x86_init.paging.pagetable_setup_start(swapper_pg_dir); paging_init(); - paravirt_pagetable_setup_done(swapper_pg_dir); - paravirt_post_allocator_init(); + x86_init.paging.pagetable_setup_done(swapper_pg_dir); + tboot_probe(); + #ifdef CONFIG_X86_64 map_vsyscall(); #endif diff --cc arch/x86/xen/enlighten.c index 0dd0c2c6cae,b5bf8b9119a..544eb749653 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@@ -1070,31 -968,28 +1058,43 @@@ asmlinkage void __init xen_start_kernel pv_time_ops = xen_time_ops; pv_cpu_ops = xen_cpu_ops; pv_apic_ops = xen_apic_ops; - pv_mmu_ops = xen_mmu_ops; + + x86_init.resources.memory_setup = xen_memory_setup; + x86_init.oem.arch_setup = xen_arch_setup; + x86_init.oem.banner = xen_banner; + + x86_init.timers.timer_init = xen_time_init; + x86_init.timers.setup_percpu_clockev = x86_init_noop; + x86_cpuinit.setup_percpu_clockev = x86_init_noop; + + x86_platform.calibrate_tsc = xen_tsc_khz; + x86_platform.get_wallclock = xen_get_wallclock; + x86_platform.set_wallclock = xen_set_wallclock; -#ifdef CONFIG_X86_64 /* - * Setup percpu state. We only need to do this for 64-bit - * because 32-bit already has %fs set properly. + * Set up some pagetable state before starting to set any ptes. */ - load_percpu_segment(0); -#endif + + /* Prevent unwanted bits from being set in PTEs. */ + __supported_pte_mask &= ~_PAGE_GLOBAL; + if (!xen_initial_domain()) + __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD); + + __supported_pte_mask |= _PAGE_IOMAP; + + xen_setup_features(); + + /* Get mfn list */ + if (!xen_feature(XENFEAT_auto_translated_physmap)) + xen_build_dynamic_phys_to_machine(); + + /* + * Set up kernel GDT and segment registers, mainly so that + * -fstack-protector code can be executed. + */ + xen_setup_stackprotector(); + xen_init_mmu_ops(); xen_init_irq_ops(); xen_init_cpuid_mask();