diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-20 11:40:43 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-20 11:40:43 -0500 |
commit | 3b6f7b9beb553ea71a6d4d76ba82cf32eb6dadd2 (patch) | |
tree | 2cd8a8d61f350aa3b00e6b0afc998544923f183e /arch | |
parent | 9be1b56a3e718aa998772019c57c398dbb19e258 (diff) | |
parent | 07a66d7c53a538e1a9759954a82bb6c07365eff9 (diff) |
Merge branch 'x86/urgent' into x86/core
Diffstat (limited to 'arch')
61 files changed, 187 insertions, 236 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index f238370c907d..8d0097f10208 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -93,8 +93,8 @@ common_shutdown_1(void *generic_ptr) | |||
93 | if (cpuid != boot_cpuid) { | 93 | if (cpuid != boot_cpuid) { |
94 | flags |= 0x00040000UL; /* "remain halted" */ | 94 | flags |= 0x00040000UL; /* "remain halted" */ |
95 | *pflags = flags; | 95 | *pflags = flags; |
96 | cpu_clear(cpuid, cpu_present_map); | 96 | set_cpu_present(cpuid, false); |
97 | cpu_clear(cpuid, cpu_possible_map); | 97 | set_cpu_possible(cpuid, false); |
98 | halt(); | 98 | halt(); |
99 | } | 99 | } |
100 | #endif | 100 | #endif |
@@ -120,8 +120,8 @@ common_shutdown_1(void *generic_ptr) | |||
120 | 120 | ||
121 | #ifdef CONFIG_SMP | 121 | #ifdef CONFIG_SMP |
122 | /* Wait for the secondaries to halt. */ | 122 | /* Wait for the secondaries to halt. */ |
123 | cpu_clear(boot_cpuid, cpu_present_map); | 123 | set_cpu_present(boot_cpuid, false); |
124 | cpu_clear(boot_cpuid, cpu_possible_map); | 124 | set_cpu_possible(boot_cpuid, false); |
125 | while (cpus_weight(cpu_present_map)) | 125 | while (cpus_weight(cpu_present_map)) |
126 | barrier(); | 126 | barrier(); |
127 | #endif | 127 | #endif |
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 00f1dc3dfd5f..b1fe5674c3a1 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c | |||
@@ -120,12 +120,12 @@ void __cpuinit | |||
120 | smp_callin(void) | 120 | smp_callin(void) |
121 | { | 121 | { |
122 | int cpuid = hard_smp_processor_id(); | 122 | int cpuid = hard_smp_processor_id(); |
123 | cpumask_t mask = cpu_online_map; | ||
124 | 123 | ||
125 | if (cpu_test_and_set(cpuid, mask)) { | 124 | if (cpu_online(cpuid)) { |
126 | printk("??, cpu 0x%x already present??\n", cpuid); | 125 | printk("??, cpu 0x%x already present??\n", cpuid); |
127 | BUG(); | 126 | BUG(); |
128 | } | 127 | } |
128 | set_cpu_online(cpuid, true); | ||
129 | 129 | ||
130 | /* Turn on machine checks. */ | 130 | /* Turn on machine checks. */ |
131 | wrmces(7); | 131 | wrmces(7); |
@@ -436,8 +436,8 @@ setup_smp(void) | |||
436 | ((char *)cpubase + i*hwrpb->processor_size); | 436 | ((char *)cpubase + i*hwrpb->processor_size); |
437 | if ((cpu->flags & 0x1cc) == 0x1cc) { | 437 | if ((cpu->flags & 0x1cc) == 0x1cc) { |
438 | smp_num_probed++; | 438 | smp_num_probed++; |
439 | cpu_set(i, cpu_possible_map); | 439 | set_cpu_possible(i, true); |
440 | cpu_set(i, cpu_present_map); | 440 | set_cpu_present(i, true); |
441 | cpu->pal_revision = boot_cpu_palrev; | 441 | cpu->pal_revision = boot_cpu_palrev; |
442 | } | 442 | } |
443 | 443 | ||
@@ -470,8 +470,8 @@ smp_prepare_cpus(unsigned int max_cpus) | |||
470 | 470 | ||
471 | /* Nothing to do on a UP box, or when told not to. */ | 471 | /* Nothing to do on a UP box, or when told not to. */ |
472 | if (smp_num_probed == 1 || max_cpus == 0) { | 472 | if (smp_num_probed == 1 || max_cpus == 0) { |
473 | cpu_possible_map = cpumask_of_cpu(boot_cpuid); | 473 | init_cpu_possible(cpumask_of(boot_cpuid)); |
474 | cpu_present_map = cpumask_of_cpu(boot_cpuid); | 474 | init_cpu_present(cpumask_of(boot_cpuid)); |
475 | printk(KERN_INFO "SMP mode deactivated.\n"); | 475 | printk(KERN_INFO "SMP mode deactivated.\n"); |
476 | return; | 476 | return; |
477 | } | 477 | } |
diff --git a/arch/arm/configs/at91sam9260ek_defconfig b/arch/arm/configs/at91sam9260ek_defconfig index e0ee7060f9aa..98e2f3de4bc5 100644 --- a/arch/arm/configs/at91sam9260ek_defconfig +++ b/arch/arm/configs/at91sam9260ek_defconfig | |||
@@ -608,7 +608,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y | |||
608 | # Watchdog Device Drivers | 608 | # Watchdog Device Drivers |
609 | # | 609 | # |
610 | # CONFIG_SOFT_WATCHDOG is not set | 610 | # CONFIG_SOFT_WATCHDOG is not set |
611 | CONFIG_AT91SAM9_WATCHDOG=y | 611 | CONFIG_AT91SAM9X_WATCHDOG=y |
612 | 612 | ||
613 | # | 613 | # |
614 | # USB-based Watchdog Cards | 614 | # USB-based Watchdog Cards |
diff --git a/arch/arm/configs/at91sam9261ek_defconfig b/arch/arm/configs/at91sam9261ek_defconfig index 01d1ef97d8be..149456142392 100644 --- a/arch/arm/configs/at91sam9261ek_defconfig +++ b/arch/arm/configs/at91sam9261ek_defconfig | |||
@@ -700,7 +700,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y | |||
700 | # Watchdog Device Drivers | 700 | # Watchdog Device Drivers |
701 | # | 701 | # |
702 | # CONFIG_SOFT_WATCHDOG is not set | 702 | # CONFIG_SOFT_WATCHDOG is not set |
703 | CONFIG_AT91SAM9_WATCHDOG=y | 703 | CONFIG_AT91SAM9X_WATCHDOG=y |
704 | 704 | ||
705 | # | 705 | # |
706 | # USB-based Watchdog Cards | 706 | # USB-based Watchdog Cards |
diff --git a/arch/arm/configs/at91sam9263ek_defconfig b/arch/arm/configs/at91sam9263ek_defconfig index 036a126725c1..21599f3c6275 100644 --- a/arch/arm/configs/at91sam9263ek_defconfig +++ b/arch/arm/configs/at91sam9263ek_defconfig | |||
@@ -710,7 +710,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y | |||
710 | # Watchdog Device Drivers | 710 | # Watchdog Device Drivers |
711 | # | 711 | # |
712 | # CONFIG_SOFT_WATCHDOG is not set | 712 | # CONFIG_SOFT_WATCHDOG is not set |
713 | CONFIG_AT91SAM9_WATCHDOG=y | 713 | CONFIG_AT91SAM9X_WATCHDOG=y |
714 | 714 | ||
715 | # | 715 | # |
716 | # USB-based Watchdog Cards | 716 | # USB-based Watchdog Cards |
diff --git a/arch/arm/configs/at91sam9rlek_defconfig b/arch/arm/configs/at91sam9rlek_defconfig index 237a2a6a8517..e2df81a3e804 100644 --- a/arch/arm/configs/at91sam9rlek_defconfig +++ b/arch/arm/configs/at91sam9rlek_defconfig | |||
@@ -606,7 +606,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y | |||
606 | # Watchdog Device Drivers | 606 | # Watchdog Device Drivers |
607 | # | 607 | # |
608 | # CONFIG_SOFT_WATCHDOG is not set | 608 | # CONFIG_SOFT_WATCHDOG is not set |
609 | CONFIG_AT91SAM9_WATCHDOG=y | 609 | CONFIG_AT91SAM9X_WATCHDOG=y |
610 | 610 | ||
611 | # | 611 | # |
612 | # Sonics Silicon Backplane | 612 | # Sonics Silicon Backplane |
diff --git a/arch/arm/configs/qil-a9260_defconfig b/arch/arm/configs/qil-a9260_defconfig index cd1d717903ac..9b32d0eb89ba 100644 --- a/arch/arm/configs/qil-a9260_defconfig +++ b/arch/arm/configs/qil-a9260_defconfig | |||
@@ -727,7 +727,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y | |||
727 | # Watchdog Device Drivers | 727 | # Watchdog Device Drivers |
728 | # | 728 | # |
729 | # CONFIG_SOFT_WATCHDOG is not set | 729 | # CONFIG_SOFT_WATCHDOG is not set |
730 | # CONFIG_AT91SAM9_WATCHDOG is not set | 730 | # CONFIG_AT91SAM9X_WATCHDOG is not set |
731 | 731 | ||
732 | # | 732 | # |
733 | # USB-based Watchdog Cards | 733 | # USB-based Watchdog Cards |
diff --git a/arch/arm/kernel/elf.c b/arch/arm/kernel/elf.c index 84849098c8e8..d4a0da1e48f4 100644 --- a/arch/arm/kernel/elf.c +++ b/arch/arm/kernel/elf.c | |||
@@ -74,9 +74,9 @@ EXPORT_SYMBOL(elf_set_personality); | |||
74 | */ | 74 | */ |
75 | int arm_elf_read_implies_exec(const struct elf32_hdr *x, int executable_stack) | 75 | int arm_elf_read_implies_exec(const struct elf32_hdr *x, int executable_stack) |
76 | { | 76 | { |
77 | if (executable_stack != EXSTACK_ENABLE_X) | 77 | if (executable_stack != EXSTACK_DISABLE_X) |
78 | return 1; | 78 | return 1; |
79 | if (cpu_architecture() <= CPU_ARCH_ARMv6) | 79 | if (cpu_architecture() < CPU_ARCH_ARMv6) |
80 | return 1; | 80 | return 1; |
81 | return 0; | 81 | return 0; |
82 | } | 82 | } |
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c index 9eca2209cde6..412aa49ad2fb 100644 --- a/arch/arm/mach-at91/at91cap9_devices.c +++ b/arch/arm/mach-at91/at91cap9_devices.c | |||
@@ -697,7 +697,7 @@ static void __init at91_add_device_rtt(void) | |||
697 | * Watchdog | 697 | * Watchdog |
698 | * -------------------------------------------------------------------- */ | 698 | * -------------------------------------------------------------------- */ |
699 | 699 | ||
700 | #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) | 700 | #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) |
701 | static struct platform_device at91cap9_wdt_device = { | 701 | static struct platform_device at91cap9_wdt_device = { |
702 | .name = "at91_wdt", | 702 | .name = "at91_wdt", |
703 | .id = -1, | 703 | .id = -1, |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index fdde1ea21b07..d74c9ac007e7 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -643,7 +643,7 @@ static void __init at91_add_device_rtt(void) | |||
643 | * Watchdog | 643 | * Watchdog |
644 | * -------------------------------------------------------------------- */ | 644 | * -------------------------------------------------------------------- */ |
645 | 645 | ||
646 | #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) | 646 | #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) |
647 | static struct platform_device at91sam9260_wdt_device = { | 647 | static struct platform_device at91sam9260_wdt_device = { |
648 | .name = "at91_wdt", | 648 | .name = "at91_wdt", |
649 | .id = -1, | 649 | .id = -1, |
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 17289756f80f..59fc48311fb0 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -621,7 +621,7 @@ static void __init at91_add_device_rtt(void) | |||
621 | * Watchdog | 621 | * Watchdog |
622 | * -------------------------------------------------------------------- */ | 622 | * -------------------------------------------------------------------- */ |
623 | 623 | ||
624 | #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) | 624 | #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) |
625 | static struct platform_device at91sam9261_wdt_device = { | 625 | static struct platform_device at91sam9261_wdt_device = { |
626 | .name = "at91_wdt", | 626 | .name = "at91_wdt", |
627 | .id = -1, | 627 | .id = -1, |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index b753cb879d8e..134af97ff340 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -854,7 +854,7 @@ static void __init at91_add_device_rtt(void) | |||
854 | * Watchdog | 854 | * Watchdog |
855 | * -------------------------------------------------------------------- */ | 855 | * -------------------------------------------------------------------- */ |
856 | 856 | ||
857 | #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) | 857 | #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) |
858 | static struct platform_device at91sam9263_wdt_device = { | 858 | static struct platform_device at91sam9263_wdt_device = { |
859 | .name = "at91_wdt", | 859 | .name = "at91_wdt", |
860 | .id = -1, | 860 | .id = -1, |
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index 145324f4ec56..728186515cdf 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -609,7 +609,7 @@ static void __init at91_add_device_rtt(void) | |||
609 | * Watchdog | 609 | * Watchdog |
610 | * -------------------------------------------------------------------- */ | 610 | * -------------------------------------------------------------------- */ |
611 | 611 | ||
612 | #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) | 612 | #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) |
613 | static struct platform_device at91sam9rl_wdt_device = { | 613 | static struct platform_device at91sam9rl_wdt_device = { |
614 | .name = "at91_wdt", | 614 | .name = "at91_wdt", |
615 | .id = -1, | 615 | .id = -1, |
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c index 9b0447c3d59b..2f7d4977dce9 100644 --- a/arch/arm/mach-at91/gpio.c +++ b/arch/arm/mach-at91/gpio.c | |||
@@ -490,7 +490,8 @@ postcore_initcall(at91_gpio_debugfs_init); | |||
490 | 490 | ||
491 | /*--------------------------------------------------------------------------*/ | 491 | /*--------------------------------------------------------------------------*/ |
492 | 492 | ||
493 | /* This lock class tells lockdep that GPIO irqs are in a different | 493 | /* |
494 | * This lock class tells lockdep that GPIO irqs are in a different | ||
494 | * category than their parents, so it won't report false recursion. | 495 | * category than their parents, so it won't report false recursion. |
495 | */ | 496 | */ |
496 | static struct lock_class_key gpio_lock_class; | 497 | static struct lock_class_key gpio_lock_class; |
@@ -509,9 +510,6 @@ void __init at91_gpio_irq_setup(void) | |||
509 | unsigned id = this->id; | 510 | unsigned id = this->id; |
510 | unsigned i; | 511 | unsigned i; |
511 | 512 | ||
512 | /* enable PIO controller's clock */ | ||
513 | clk_enable(this->clock); | ||
514 | |||
515 | __raw_writel(~0, this->regbase + PIO_IDR); | 513 | __raw_writel(~0, this->regbase + PIO_IDR); |
516 | 514 | ||
517 | for (i = 0, pin = this->chipbase; i < 32; i++, pin++) { | 515 | for (i = 0, pin = this->chipbase; i < 32; i++, pin++) { |
@@ -556,7 +554,14 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks) | |||
556 | data->chipbase = PIN_BASE + i * 32; | 554 | data->chipbase = PIN_BASE + i * 32; |
557 | data->regbase = data->offset + (void __iomem *)AT91_VA_BASE_SYS; | 555 | data->regbase = data->offset + (void __iomem *)AT91_VA_BASE_SYS; |
558 | 556 | ||
559 | /* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */ | 557 | /* enable PIO controller's clock */ |
558 | clk_enable(data->clock); | ||
559 | |||
560 | /* | ||
561 | * Some processors share peripheral ID between multiple GPIO banks. | ||
562 | * SAM9263 (PIOC, PIOD, PIOE) | ||
563 | * CAP9 (PIOA, PIOB, PIOC, PIOD) | ||
564 | */ | ||
560 | if (last && last->id == data->id) | 565 | if (last && last->id == data->id) |
561 | last->next = data; | 566 | last->next = data; |
562 | } | 567 | } |
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h index fb51f0e0a83f..0b3ae21b4565 100644 --- a/arch/arm/mach-at91/include/mach/board.h +++ b/arch/arm/mach-at91/include/mach/board.h | |||
@@ -93,6 +93,7 @@ struct atmel_nand_data { | |||
93 | u8 enable_pin; /* chip enable */ | 93 | u8 enable_pin; /* chip enable */ |
94 | u8 det_pin; /* card detect */ | 94 | u8 det_pin; /* card detect */ |
95 | u8 rdy_pin; /* ready/busy */ | 95 | u8 rdy_pin; /* ready/busy */ |
96 | u8 rdy_pin_active_low; /* rdy_pin value is inverted */ | ||
96 | u8 ale; /* address line number connected to ALE */ | 97 | u8 ale; /* address line number connected to ALE */ |
97 | u8 cle; /* address line number connected to CLE */ | 98 | u8 cle; /* address line number connected to CLE */ |
98 | u8 bus_width_16; /* buswidth is 16 bit */ | 99 | u8 bus_width_16; /* buswidth is 16 bit */ |
diff --git a/arch/arm/mach-ep93xx/include/mach/gesbc9312.h b/arch/arm/mach-ep93xx/include/mach/gesbc9312.h deleted file mode 100644 index 21fe2b922aa5..000000000000 --- a/arch/arm/mach-ep93xx/include/mach/gesbc9312.h +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ep93xx/include/mach/gesbc9312.h | ||
3 | */ | ||
diff --git a/arch/arm/mach-ep93xx/include/mach/hardware.h b/arch/arm/mach-ep93xx/include/mach/hardware.h index 529807d182bf..2866297310b7 100644 --- a/arch/arm/mach-ep93xx/include/mach/hardware.h +++ b/arch/arm/mach-ep93xx/include/mach/hardware.h | |||
@@ -10,7 +10,6 @@ | |||
10 | 10 | ||
11 | #include "platform.h" | 11 | #include "platform.h" |
12 | 12 | ||
13 | #include "gesbc9312.h" | ||
14 | #include "ts72xx.h" | 13 | #include "ts72xx.h" |
15 | 14 | ||
16 | #endif | 15 | #endif |
diff --git a/arch/arm/mach-kirkwood/irq.c b/arch/arm/mach-kirkwood/irq.c index efb86b700276..06083b23bb44 100644 --- a/arch/arm/mach-kirkwood/irq.c +++ b/arch/arm/mach-kirkwood/irq.c | |||
@@ -42,7 +42,7 @@ void __init kirkwood_init_irq(void) | |||
42 | writel(0, GPIO_EDGE_CAUSE(32)); | 42 | writel(0, GPIO_EDGE_CAUSE(32)); |
43 | 43 | ||
44 | for (i = IRQ_KIRKWOOD_GPIO_START; i < NR_IRQS; i++) { | 44 | for (i = IRQ_KIRKWOOD_GPIO_START; i < NR_IRQS; i++) { |
45 | set_irq_chip(i, &orion_gpio_irq_level_chip); | 45 | set_irq_chip(i, &orion_gpio_irq_chip); |
46 | set_irq_handler(i, handle_level_irq); | 46 | set_irq_handler(i, handle_level_irq); |
47 | irq_desc[i].status |= IRQ_LEVEL; | 47 | irq_desc[i].status |= IRQ_LEVEL; |
48 | set_irq_flags(i, IRQF_VALID); | 48 | set_irq_flags(i, IRQF_VALID); |
diff --git a/arch/arm/mach-mv78xx0/irq.c b/arch/arm/mach-mv78xx0/irq.c index e273418797b4..30b7e4bcdbc7 100644 --- a/arch/arm/mach-mv78xx0/irq.c +++ b/arch/arm/mach-mv78xx0/irq.c | |||
@@ -40,7 +40,7 @@ void __init mv78xx0_init_irq(void) | |||
40 | writel(0, GPIO_EDGE_CAUSE(0)); | 40 | writel(0, GPIO_EDGE_CAUSE(0)); |
41 | 41 | ||
42 | for (i = IRQ_MV78XX0_GPIO_START; i < NR_IRQS; i++) { | 42 | for (i = IRQ_MV78XX0_GPIO_START; i < NR_IRQS; i++) { |
43 | set_irq_chip(i, &orion_gpio_irq_level_chip); | 43 | set_irq_chip(i, &orion_gpio_irq_chip); |
44 | set_irq_handler(i, handle_level_irq); | 44 | set_irq_handler(i, handle_level_irq); |
45 | irq_desc[i].status |= IRQ_LEVEL; | 45 | irq_desc[i].status |= IRQ_LEVEL; |
46 | set_irq_flags(i, IRQF_VALID); | 46 | set_irq_flags(i, IRQF_VALID); |
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index ad721e0cbf7a..ce4d46a4a838 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -565,7 +565,7 @@ u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val) | |||
565 | * | 565 | * |
566 | * Given a struct clk of a rate-selectable clksel clock, and a clock divisor, | 566 | * Given a struct clk of a rate-selectable clksel clock, and a clock divisor, |
567 | * find the corresponding register field value. The return register value is | 567 | * find the corresponding register field value. The return register value is |
568 | * the value before left-shifting. Returns 0xffffffff on error | 568 | * the value before left-shifting. Returns ~0 on error |
569 | */ | 569 | */ |
570 | u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) | 570 | u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) |
571 | { | 571 | { |
@@ -577,7 +577,7 @@ u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) | |||
577 | 577 | ||
578 | clks = omap2_get_clksel_by_parent(clk, clk->parent); | 578 | clks = omap2_get_clksel_by_parent(clk, clk->parent); |
579 | if (clks == NULL) | 579 | if (clks == NULL) |
580 | return 0; | 580 | return ~0; |
581 | 581 | ||
582 | for (clkr = clks->rates; clkr->div; clkr++) { | 582 | for (clkr = clks->rates; clkr->div; clkr++) { |
583 | if ((clkr->flags & cpu_mask) && (clkr->div == div)) | 583 | if ((clkr->flags & cpu_mask) && (clkr->div == div)) |
@@ -588,7 +588,7 @@ u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) | |||
588 | printk(KERN_ERR "clock: Could not find divisor %d for " | 588 | printk(KERN_ERR "clock: Could not find divisor %d for " |
589 | "clock %s parent %s\n", div, clk->name, | 589 | "clock %s parent %s\n", div, clk->name, |
590 | clk->parent->name); | 590 | clk->parent->name); |
591 | return 0; | 591 | return ~0; |
592 | } | 592 | } |
593 | 593 | ||
594 | return clkr->val; | 594 | return clkr->val; |
@@ -708,7 +708,7 @@ static u32 omap2_clksel_get_src_field(void __iomem **src_addr, | |||
708 | return 0; | 708 | return 0; |
709 | 709 | ||
710 | for (clkr = clks->rates; clkr->div; clkr++) { | 710 | for (clkr = clks->rates; clkr->div; clkr++) { |
711 | if (clkr->flags & (cpu_mask | DEFAULT_RATE)) | 711 | if (clkr->flags & cpu_mask && clkr->flags & DEFAULT_RATE) |
712 | break; /* Found the default rate for this platform */ | 712 | break; /* Found the default rate for this platform */ |
713 | } | 713 | } |
714 | 714 | ||
@@ -746,7 +746,7 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent) | |||
746 | return -EINVAL; | 746 | return -EINVAL; |
747 | 747 | ||
748 | if (clk->usecount > 0) | 748 | if (clk->usecount > 0) |
749 | _omap2_clk_disable(clk); | 749 | omap2_clk_disable(clk); |
750 | 750 | ||
751 | /* Set new source value (previous dividers if any in effect) */ | 751 | /* Set new source value (previous dividers if any in effect) */ |
752 | reg_val = __raw_readl(src_addr) & ~field_mask; | 752 | reg_val = __raw_readl(src_addr) & ~field_mask; |
@@ -759,11 +759,11 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent) | |||
759 | wmb(); | 759 | wmb(); |
760 | } | 760 | } |
761 | 761 | ||
762 | if (clk->usecount > 0) | ||
763 | _omap2_clk_enable(clk); | ||
764 | |||
765 | clk->parent = new_parent; | 762 | clk->parent = new_parent; |
766 | 763 | ||
764 | if (clk->usecount > 0) | ||
765 | omap2_clk_enable(clk); | ||
766 | |||
767 | /* CLKSEL clocks follow their parents' rates, divided by a divisor */ | 767 | /* CLKSEL clocks follow their parents' rates, divided by a divisor */ |
768 | clk->rate = new_parent->rate; | 768 | clk->rate = new_parent->rate; |
769 | 769 | ||
diff --git a/arch/arm/mach-orion5x/irq.c b/arch/arm/mach-orion5x/irq.c index 0caae43301e5..e03f7b45cb0d 100644 --- a/arch/arm/mach-orion5x/irq.c +++ b/arch/arm/mach-orion5x/irq.c | |||
@@ -44,7 +44,7 @@ void __init orion5x_init_irq(void) | |||
44 | * User can use set_type() if he wants to use edge types handlers. | 44 | * User can use set_type() if he wants to use edge types handlers. |
45 | */ | 45 | */ |
46 | for (i = IRQ_ORION5X_GPIO_START; i < NR_IRQS; i++) { | 46 | for (i = IRQ_ORION5X_GPIO_START; i < NR_IRQS; i++) { |
47 | set_irq_chip(i, &orion_gpio_irq_level_chip); | 47 | set_irq_chip(i, &orion_gpio_irq_chip); |
48 | set_irq_handler(i, handle_level_irq); | 48 | set_irq_handler(i, handle_level_irq); |
49 | irq_desc[i].status |= IRQ_LEVEL; | 49 | irq_desc[i].status |= IRQ_LEVEL; |
50 | set_irq_flags(i, IRQF_VALID); | 50 | set_irq_flags(i, IRQF_VALID); |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 9b36c5cb5e9f..d4d082c5c2d4 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -693,7 +693,8 @@ static void __init sanity_check_meminfo(void) | |||
693 | * Check whether this memory bank would entirely overlap | 693 | * Check whether this memory bank would entirely overlap |
694 | * the vmalloc area. | 694 | * the vmalloc area. |
695 | */ | 695 | */ |
696 | if (__va(bank->start) >= VMALLOC_MIN) { | 696 | if (__va(bank->start) >= VMALLOC_MIN || |
697 | __va(bank->start) < PAGE_OFFSET) { | ||
697 | printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx " | 698 | printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx " |
698 | "(vmalloc region overlap).\n", | 699 | "(vmalloc region overlap).\n", |
699 | bank->start, bank->start + bank->size - 1); | 700 | bank->start, bank->start + bank->size - 1); |
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c index 967186425ca1..0d12c2164766 100644 --- a/arch/arm/plat-orion/gpio.c +++ b/arch/arm/plat-orion/gpio.c | |||
@@ -265,51 +265,36 @@ EXPORT_SYMBOL(orion_gpio_set_blink); | |||
265 | * polarity LEVEL mask | 265 | * polarity LEVEL mask |
266 | * | 266 | * |
267 | ****************************************************************************/ | 267 | ****************************************************************************/ |
268 | static void gpio_irq_edge_ack(u32 irq) | ||
269 | { | ||
270 | int pin = irq_to_gpio(irq); | ||
271 | |||
272 | writel(~(1 << (pin & 31)), GPIO_EDGE_CAUSE(pin)); | ||
273 | } | ||
274 | |||
275 | static void gpio_irq_edge_mask(u32 irq) | ||
276 | { | ||
277 | int pin = irq_to_gpio(irq); | ||
278 | u32 u; | ||
279 | |||
280 | u = readl(GPIO_EDGE_MASK(pin)); | ||
281 | u &= ~(1 << (pin & 31)); | ||
282 | writel(u, GPIO_EDGE_MASK(pin)); | ||
283 | } | ||
284 | 268 | ||
285 | static void gpio_irq_edge_unmask(u32 irq) | 269 | static void gpio_irq_ack(u32 irq) |
286 | { | 270 | { |
287 | int pin = irq_to_gpio(irq); | 271 | int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK; |
288 | u32 u; | 272 | if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { |
289 | 273 | int pin = irq_to_gpio(irq); | |
290 | u = readl(GPIO_EDGE_MASK(pin)); | 274 | writel(~(1 << (pin & 31)), GPIO_EDGE_CAUSE(pin)); |
291 | u |= 1 << (pin & 31); | 275 | } |
292 | writel(u, GPIO_EDGE_MASK(pin)); | ||
293 | } | 276 | } |
294 | 277 | ||
295 | static void gpio_irq_level_mask(u32 irq) | 278 | static void gpio_irq_mask(u32 irq) |
296 | { | 279 | { |
297 | int pin = irq_to_gpio(irq); | 280 | int pin = irq_to_gpio(irq); |
298 | u32 u; | 281 | int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK; |
299 | 282 | u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ? | |
300 | u = readl(GPIO_LEVEL_MASK(pin)); | 283 | GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin); |
284 | u32 u = readl(reg); | ||
301 | u &= ~(1 << (pin & 31)); | 285 | u &= ~(1 << (pin & 31)); |
302 | writel(u, GPIO_LEVEL_MASK(pin)); | 286 | writel(u, reg); |
303 | } | 287 | } |
304 | 288 | ||
305 | static void gpio_irq_level_unmask(u32 irq) | 289 | static void gpio_irq_unmask(u32 irq) |
306 | { | 290 | { |
307 | int pin = irq_to_gpio(irq); | 291 | int pin = irq_to_gpio(irq); |
308 | u32 u; | 292 | int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK; |
309 | 293 | u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ? | |
310 | u = readl(GPIO_LEVEL_MASK(pin)); | 294 | GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin); |
295 | u32 u = readl(reg); | ||
311 | u |= 1 << (pin & 31); | 296 | u |= 1 << (pin & 31); |
312 | writel(u, GPIO_LEVEL_MASK(pin)); | 297 | writel(u, reg); |
313 | } | 298 | } |
314 | 299 | ||
315 | static int gpio_irq_set_type(u32 irq, u32 type) | 300 | static int gpio_irq_set_type(u32 irq, u32 type) |
@@ -331,9 +316,9 @@ static int gpio_irq_set_type(u32 irq, u32 type) | |||
331 | * Set edge/level type. | 316 | * Set edge/level type. |
332 | */ | 317 | */ |
333 | if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { | 318 | if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { |
334 | desc->chip = &orion_gpio_irq_edge_chip; | 319 | desc->handle_irq = handle_edge_irq; |
335 | } else if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { | 320 | } else if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { |
336 | desc->chip = &orion_gpio_irq_level_chip; | 321 | desc->handle_irq = handle_level_irq; |
337 | } else { | 322 | } else { |
338 | printk(KERN_ERR "failed to set irq=%d (type=%d)\n", irq, type); | 323 | printk(KERN_ERR "failed to set irq=%d (type=%d)\n", irq, type); |
339 | return -EINVAL; | 324 | return -EINVAL; |
@@ -371,19 +356,11 @@ static int gpio_irq_set_type(u32 irq, u32 type) | |||
371 | return 0; | 356 | return 0; |
372 | } | 357 | } |
373 | 358 | ||
374 | struct irq_chip orion_gpio_irq_edge_chip = { | 359 | struct irq_chip orion_gpio_irq_chip = { |
375 | .name = "orion_gpio_irq_edge", | 360 | .name = "orion_gpio", |
376 | .ack = gpio_irq_edge_ack, | 361 | .ack = gpio_irq_ack, |
377 | .mask = gpio_irq_edge_mask, | 362 | .mask = gpio_irq_mask, |
378 | .unmask = gpio_irq_edge_unmask, | 363 | .unmask = gpio_irq_unmask, |
379 | .set_type = gpio_irq_set_type, | ||
380 | }; | ||
381 | |||
382 | struct irq_chip orion_gpio_irq_level_chip = { | ||
383 | .name = "orion_gpio_irq_level", | ||
384 | .mask = gpio_irq_level_mask, | ||
385 | .mask_ack = gpio_irq_level_mask, | ||
386 | .unmask = gpio_irq_level_unmask, | ||
387 | .set_type = gpio_irq_set_type, | 364 | .set_type = gpio_irq_set_type, |
388 | }; | 365 | }; |
389 | 366 | ||
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h index 54deaf274b52..ec743e82c876 100644 --- a/arch/arm/plat-orion/include/plat/gpio.h +++ b/arch/arm/plat-orion/include/plat/gpio.h | |||
@@ -31,8 +31,7 @@ void orion_gpio_set_blink(unsigned pin, int blink); | |||
31 | /* | 31 | /* |
32 | * GPIO interrupt handling. | 32 | * GPIO interrupt handling. |
33 | */ | 33 | */ |
34 | extern struct irq_chip orion_gpio_irq_edge_chip; | 34 | extern struct irq_chip orion_gpio_irq_chip; |
35 | extern struct irq_chip orion_gpio_irq_level_chip; | ||
36 | void orion_gpio_irq_handler(int irqoff); | 35 | void orion_gpio_irq_handler(int irqoff); |
37 | 36 | ||
38 | 37 | ||
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h index aafaf7a78886..cff8e84f78f2 100644 --- a/arch/avr32/mach-at32ap/include/mach/board.h +++ b/arch/avr32/mach-at32ap/include/mach/board.h | |||
@@ -116,6 +116,7 @@ struct atmel_nand_data { | |||
116 | int enable_pin; /* chip enable */ | 116 | int enable_pin; /* chip enable */ |
117 | int det_pin; /* card detect */ | 117 | int det_pin; /* card detect */ |
118 | int rdy_pin; /* ready/busy */ | 118 | int rdy_pin; /* ready/busy */ |
119 | u8 rdy_pin_active_low; /* rdy_pin value is inverted */ | ||
119 | u8 ale; /* address line number connected to ALE */ | 120 | u8 ale; /* address line number connected to ALE */ |
120 | u8 cle; /* address line number connected to CLE */ | 121 | u8 cle; /* address line number connected to CLE */ |
121 | u8 bus_width_16; /* buswidth is 16 bit */ | 122 | u8 bus_width_16; /* buswidth is 16 bit */ |
diff --git a/arch/ia64/include/asm/kvm.h b/arch/ia64/include/asm/kvm.h index 116761ca462d..2b0a38e84705 100644 --- a/arch/ia64/include/asm/kvm.h +++ b/arch/ia64/include/asm/kvm.h | |||
@@ -24,6 +24,10 @@ | |||
24 | #include <linux/types.h> | 24 | #include <linux/types.h> |
25 | #include <linux/ioctl.h> | 25 | #include <linux/ioctl.h> |
26 | 26 | ||
27 | /* Select x86 specific features in <linux/kvm.h> */ | ||
28 | #define __KVM_HAVE_IOAPIC | ||
29 | #define __KVM_HAVE_DEVICE_ASSIGNMENT | ||
30 | |||
27 | /* Architectural interrupt line count. */ | 31 | /* Architectural interrupt line count. */ |
28 | #define KVM_NR_INTERRUPTS 256 | 32 | #define KVM_NR_INTERRUPTS 256 |
29 | 33 | ||
diff --git a/arch/ia64/include/asm/mmzone.h b/arch/ia64/include/asm/mmzone.h index 34efe88eb849..f2ca32069b3f 100644 --- a/arch/ia64/include/asm/mmzone.h +++ b/arch/ia64/include/asm/mmzone.h | |||
@@ -31,10 +31,6 @@ static inline int pfn_to_nid(unsigned long pfn) | |||
31 | #endif | 31 | #endif |
32 | } | 32 | } |
33 | 33 | ||
34 | #ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID | ||
35 | extern int early_pfn_to_nid(unsigned long pfn); | ||
36 | #endif | ||
37 | |||
38 | #ifdef CONFIG_IA64_DIG /* DIG systems are small */ | 34 | #ifdef CONFIG_IA64_DIG /* DIG systems are small */ |
39 | # define MAX_PHYSNODE_ID 8 | 35 | # define MAX_PHYSNODE_ID 8 |
40 | # define NR_NODE_MEMBLKS (MAX_NUMNODES * 8) | 36 | # define NR_NODE_MEMBLKS (MAX_NUMNODES * 8) |
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index 4e586f6110aa..28f982045f29 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -1337,6 +1337,10 @@ static void kvm_release_vm_pages(struct kvm *kvm) | |||
1337 | } | 1337 | } |
1338 | } | 1338 | } |
1339 | 1339 | ||
1340 | void kvm_arch_sync_events(struct kvm *kvm) | ||
1341 | { | ||
1342 | } | ||
1343 | |||
1340 | void kvm_arch_destroy_vm(struct kvm *kvm) | 1344 | void kvm_arch_destroy_vm(struct kvm *kvm) |
1341 | { | 1345 | { |
1342 | kvm_iommu_unmap_guest(kvm); | 1346 | kvm_iommu_unmap_guest(kvm); |
diff --git a/arch/ia64/kvm/process.c b/arch/ia64/kvm/process.c index 552d07724207..230eae482f32 100644 --- a/arch/ia64/kvm/process.c +++ b/arch/ia64/kvm/process.c | |||
@@ -455,13 +455,18 @@ fpswa_ret_t vmm_fp_emulate(int fp_fault, void *bundle, unsigned long *ipsr, | |||
455 | if (!vmm_fpswa_interface) | 455 | if (!vmm_fpswa_interface) |
456 | return (fpswa_ret_t) {-1, 0, 0, 0}; | 456 | return (fpswa_ret_t) {-1, 0, 0, 0}; |
457 | 457 | ||
458 | /* | ||
459 | * Just let fpswa driver to use hardware fp registers. | ||
460 | * No fp register is valid in memory. | ||
461 | */ | ||
462 | memset(&fp_state, 0, sizeof(fp_state_t)); | 458 | memset(&fp_state, 0, sizeof(fp_state_t)); |
463 | 459 | ||
464 | /* | 460 | /* |
461 | * compute fp_state. only FP registers f6 - f11 are used by the | ||
462 | * vmm, so set those bits in the mask and set the low volatile | ||
463 | * pointer to point to these registers. | ||
464 | */ | ||
465 | fp_state.bitmask_low64 = 0xfc0; /* bit6..bit11 */ | ||
466 | |||
467 | fp_state.fp_state_low_volatile = (fp_state_low_volatile_t *) ®s->f6; | ||
468 | |||
469 | /* | ||
465 | * unsigned long (*EFI_FPSWA) ( | 470 | * unsigned long (*EFI_FPSWA) ( |
466 | * unsigned long trap_type, | 471 | * unsigned long trap_type, |
467 | * void *Bundle, | 472 | * void *Bundle, |
@@ -545,10 +550,6 @@ void reflect_interruption(u64 ifa, u64 isr, u64 iim, | |||
545 | status = vmm_handle_fpu_swa(0, regs, isr); | 550 | status = vmm_handle_fpu_swa(0, regs, isr); |
546 | if (!status) | 551 | if (!status) |
547 | return ; | 552 | return ; |
548 | else if (-EAGAIN == status) { | ||
549 | vcpu_decrement_iip(vcpu); | ||
550 | return ; | ||
551 | } | ||
552 | break; | 553 | break; |
553 | } | 554 | } |
554 | 555 | ||
diff --git a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c index b73bf1838e57..3efea7d0a351 100644 --- a/arch/ia64/mm/numa.c +++ b/arch/ia64/mm/numa.c | |||
@@ -58,7 +58,7 @@ paddr_to_nid(unsigned long paddr) | |||
58 | * SPARSEMEM to allocate the SPARSEMEM sectionmap on the NUMA node where | 58 | * SPARSEMEM to allocate the SPARSEMEM sectionmap on the NUMA node where |
59 | * the section resides. | 59 | * the section resides. |
60 | */ | 60 | */ |
61 | int early_pfn_to_nid(unsigned long pfn) | 61 | int __meminit __early_pfn_to_nid(unsigned long pfn) |
62 | { | 62 | { |
63 | int i, section = pfn >> PFN_SECTION_SHIFT, ssec, esec; | 63 | int i, section = pfn >> PFN_SECTION_SHIFT, ssec, esec; |
64 | 64 | ||
@@ -70,7 +70,7 @@ int early_pfn_to_nid(unsigned long pfn) | |||
70 | return node_memblk[i].nid; | 70 | return node_memblk[i].nid; |
71 | } | 71 | } |
72 | 72 | ||
73 | return 0; | 73 | return -1; |
74 | } | 74 | } |
75 | 75 | ||
76 | #ifdef CONFIG_MEMORY_HOTPLUG | 76 | #ifdef CONFIG_MEMORY_HOTPLUG |
diff --git a/arch/powerpc/include/asm/pgtable-4k.h b/arch/powerpc/include/asm/pgtable-4k.h index 6b18ba9d2d85..1dbca4e7de67 100644 --- a/arch/powerpc/include/asm/pgtable-4k.h +++ b/arch/powerpc/include/asm/pgtable-4k.h | |||
@@ -60,7 +60,7 @@ | |||
60 | /* It should be preserving the high 48 bits and then specifically */ | 60 | /* It should be preserving the high 48 bits and then specifically */ |
61 | /* preserving _PAGE_SECONDARY | _PAGE_GROUP_IX */ | 61 | /* preserving _PAGE_SECONDARY | _PAGE_GROUP_IX */ |
62 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \ | 62 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \ |
63 | _PAGE_HPTEFLAGS) | 63 | _PAGE_HPTEFLAGS | _PAGE_SPECIAL) |
64 | 64 | ||
65 | /* Bits to mask out from a PMD to get to the PTE page */ | 65 | /* Bits to mask out from a PMD to get to the PTE page */ |
66 | #define PMD_MASKED_BITS 0 | 66 | #define PMD_MASKED_BITS 0 |
diff --git a/arch/powerpc/include/asm/pgtable-64k.h b/arch/powerpc/include/asm/pgtable-64k.h index 07b0d8f09cb6..7389003349a6 100644 --- a/arch/powerpc/include/asm/pgtable-64k.h +++ b/arch/powerpc/include/asm/pgtable-64k.h | |||
@@ -114,7 +114,7 @@ static inline struct subpage_prot_table *pgd_subpage_prot(pgd_t *pgd) | |||
114 | * pgprot changes | 114 | * pgprot changes |
115 | */ | 115 | */ |
116 | #define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \ | 116 | #define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \ |
117 | _PAGE_ACCESSED) | 117 | _PAGE_ACCESSED | _PAGE_SPECIAL) |
118 | 118 | ||
119 | /* Bits to mask out from a PMD to get to the PTE page */ | 119 | /* Bits to mask out from a PMD to get to the PTE page */ |
120 | #define PMD_MASKED_BITS 0x1ff | 120 | #define PMD_MASKED_BITS 0x1ff |
diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h index f69a4d977729..820b5f0a35ce 100644 --- a/arch/powerpc/include/asm/pgtable-ppc32.h +++ b/arch/powerpc/include/asm/pgtable-ppc32.h | |||
@@ -429,7 +429,8 @@ extern int icache_44x_need_flush; | |||
429 | #define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE() | 429 | #define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE() |
430 | #endif | 430 | #endif |
431 | 431 | ||
432 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) | 432 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \ |
433 | _PAGE_SPECIAL) | ||
433 | 434 | ||
434 | 435 | ||
435 | #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \ | 436 | #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \ |
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c index 5af4e9b2dbe2..ada06924a423 100644 --- a/arch/powerpc/kernel/align.c +++ b/arch/powerpc/kernel/align.c | |||
@@ -646,11 +646,16 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg, | |||
646 | unsigned int areg, struct pt_regs *regs, | 646 | unsigned int areg, struct pt_regs *regs, |
647 | unsigned int flags, unsigned int length) | 647 | unsigned int flags, unsigned int length) |
648 | { | 648 | { |
649 | char *ptr = (char *) ¤t->thread.TS_FPR(reg); | 649 | char *ptr; |
650 | int ret = 0; | 650 | int ret = 0; |
651 | 651 | ||
652 | flush_vsx_to_thread(current); | 652 | flush_vsx_to_thread(current); |
653 | 653 | ||
654 | if (reg < 32) | ||
655 | ptr = (char *) ¤t->thread.TS_FPR(reg); | ||
656 | else | ||
657 | ptr = (char *) ¤t->thread.vr[reg - 32]; | ||
658 | |||
654 | if (flags & ST) | 659 | if (flags & ST) |
655 | ret = __copy_to_user(addr, ptr, length); | 660 | ret = __copy_to_user(addr, ptr, length); |
656 | else { | 661 | else { |
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 2822c8ccfaaf..5f81256287f5 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
@@ -125,6 +125,10 @@ static void kvmppc_free_vcpus(struct kvm *kvm) | |||
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | void kvm_arch_sync_events(struct kvm *kvm) | ||
129 | { | ||
130 | } | ||
131 | |||
128 | void kvm_arch_destroy_vm(struct kvm *kvm) | 132 | void kvm_arch_destroy_vm(struct kvm *kvm) |
129 | { | 133 | { |
130 | kvmppc_free_vcpus(kvm); | 134 | kvmppc_free_vcpus(kvm); |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 7393bd76d698..5ac08b8ab654 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/notifier.h> | 19 | #include <linux/notifier.h> |
20 | #include <linux/lmb.h> | 20 | #include <linux/lmb.h> |
21 | #include <linux/of.h> | 21 | #include <linux/of.h> |
22 | #include <linux/pfn.h> | ||
22 | #include <asm/sparsemem.h> | 23 | #include <asm/sparsemem.h> |
23 | #include <asm/prom.h> | 24 | #include <asm/prom.h> |
24 | #include <asm/system.h> | 25 | #include <asm/system.h> |
@@ -882,7 +883,7 @@ static void mark_reserved_regions_for_nid(int nid) | |||
882 | unsigned long physbase = lmb.reserved.region[i].base; | 883 | unsigned long physbase = lmb.reserved.region[i].base; |
883 | unsigned long size = lmb.reserved.region[i].size; | 884 | unsigned long size = lmb.reserved.region[i].size; |
884 | unsigned long start_pfn = physbase >> PAGE_SHIFT; | 885 | unsigned long start_pfn = physbase >> PAGE_SHIFT; |
885 | unsigned long end_pfn = ((physbase + size) >> PAGE_SHIFT); | 886 | unsigned long end_pfn = PFN_UP(physbase + size); |
886 | struct node_active_region node_ar; | 887 | struct node_active_region node_ar; |
887 | unsigned long node_end_pfn = node->node_start_pfn + | 888 | unsigned long node_end_pfn = node->node_start_pfn + |
888 | node->node_spanned_pages; | 889 | node->node_spanned_pages; |
@@ -908,7 +909,7 @@ static void mark_reserved_regions_for_nid(int nid) | |||
908 | */ | 909 | */ |
909 | if (end_pfn > node_ar.end_pfn) | 910 | if (end_pfn > node_ar.end_pfn) |
910 | reserve_size = (node_ar.end_pfn << PAGE_SHIFT) | 911 | reserve_size = (node_ar.end_pfn << PAGE_SHIFT) |
911 | - (start_pfn << PAGE_SHIFT); | 912 | - physbase; |
912 | /* | 913 | /* |
913 | * Only worry about *this* node, others may not | 914 | * Only worry about *this* node, others may not |
914 | * yet have valid NODE_DATA(). | 915 | * yet have valid NODE_DATA(). |
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c index 67de6bf3db3d..d281cc0bca71 100644 --- a/arch/powerpc/platforms/ps3/mm.c +++ b/arch/powerpc/platforms/ps3/mm.c | |||
@@ -328,7 +328,7 @@ static int __init ps3_mm_add_memory(void) | |||
328 | return result; | 328 | return result; |
329 | } | 329 | } |
330 | 330 | ||
331 | core_initcall(ps3_mm_add_memory); | 331 | device_initcall(ps3_mm_add_memory); |
332 | 332 | ||
333 | /*============================================================================*/ | 333 | /*============================================================================*/ |
334 | /* dma routines */ | 334 | /* dma routines */ |
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h index 521726430afa..95b0f7db3c69 100644 --- a/arch/s390/include/asm/cputime.h +++ b/arch/s390/include/asm/cputime.h | |||
@@ -145,7 +145,7 @@ cputime_to_timeval(const cputime_t cputime, struct timeval *value) | |||
145 | value->tv_usec = rp.subreg.even / 4096; | 145 | value->tv_usec = rp.subreg.even / 4096; |
146 | value->tv_sec = rp.subreg.odd; | 146 | value->tv_sec = rp.subreg.odd; |
147 | #else | 147 | #else |
148 | value->tv_usec = cputime % 4096000000ULL; | 148 | value->tv_usec = (cputime % 4096000000ULL) / 4096; |
149 | value->tv_sec = cputime / 4096000000ULL; | 149 | value->tv_sec = cputime / 4096000000ULL; |
150 | #endif | 150 | #endif |
151 | } | 151 | } |
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h index 2bd9faeb3919..e8bd6ac22c99 100644 --- a/arch/s390/include/asm/setup.h +++ b/arch/s390/include/asm/setup.h | |||
@@ -43,6 +43,8 @@ struct mem_chunk { | |||
43 | 43 | ||
44 | extern struct mem_chunk memory_chunk[]; | 44 | extern struct mem_chunk memory_chunk[]; |
45 | extern unsigned long real_memory_size; | 45 | extern unsigned long real_memory_size; |
46 | extern int memory_end_set; | ||
47 | extern unsigned long memory_end; | ||
46 | 48 | ||
47 | void detect_memory_layout(struct mem_chunk chunk[]); | 49 | void detect_memory_layout(struct mem_chunk chunk[]); |
48 | 50 | ||
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index d825f4950e4e..c5cfb6185eac 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -82,7 +82,9 @@ char elf_platform[ELF_PLATFORM_SIZE]; | |||
82 | 82 | ||
83 | struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS]; | 83 | struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS]; |
84 | volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */ | 84 | volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */ |
85 | static unsigned long __initdata memory_end; | 85 | |
86 | int __initdata memory_end_set; | ||
87 | unsigned long __initdata memory_end; | ||
86 | 88 | ||
87 | /* | 89 | /* |
88 | * This is set up by the setup-routine at boot-time | 90 | * This is set up by the setup-routine at boot-time |
@@ -281,6 +283,7 @@ void (*pm_power_off)(void) = machine_power_off; | |||
281 | static int __init early_parse_mem(char *p) | 283 | static int __init early_parse_mem(char *p) |
282 | { | 284 | { |
283 | memory_end = memparse(p, &p); | 285 | memory_end = memparse(p, &p); |
286 | memory_end_set = 1; | ||
284 | return 0; | 287 | return 0; |
285 | } | 288 | } |
286 | early_param("mem", early_parse_mem); | 289 | early_param("mem", early_parse_mem); |
@@ -508,8 +511,10 @@ static void __init setup_memory_end(void) | |||
508 | int i; | 511 | int i; |
509 | 512 | ||
510 | #if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_ZFCPDUMP_MODULE) | 513 | #if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_ZFCPDUMP_MODULE) |
511 | if (ipl_info.type == IPL_TYPE_FCP_DUMP) | 514 | if (ipl_info.type == IPL_TYPE_FCP_DUMP) { |
512 | memory_end = ZFCPDUMP_HSA_SIZE; | 515 | memory_end = ZFCPDUMP_HSA_SIZE; |
516 | memory_end_set = 1; | ||
517 | } | ||
513 | #endif | 518 | #endif |
514 | memory_size = 0; | 519 | memory_size = 0; |
515 | memory_end &= PAGE_MASK; | 520 | memory_end &= PAGE_MASK; |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index be8497186b96..0d33893e1e89 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -212,6 +212,10 @@ static void kvm_free_vcpus(struct kvm *kvm) | |||
212 | } | 212 | } |
213 | } | 213 | } |
214 | 214 | ||
215 | void kvm_arch_sync_events(struct kvm *kvm) | ||
216 | { | ||
217 | } | ||
218 | |||
215 | void kvm_arch_destroy_vm(struct kvm *kvm) | 219 | void kvm_arch_destroy_vm(struct kvm *kvm) |
216 | { | 220 | { |
217 | kvm_free_vcpus(kvm); | 221 | kvm_free_vcpus(kvm); |
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index ba4781b93890..fdb45df608b6 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug | |||
@@ -175,28 +175,8 @@ config IOMMU_LEAK | |||
175 | Add a simple leak tracer to the IOMMU code. This is useful when you | 175 | Add a simple leak tracer to the IOMMU code. This is useful when you |
176 | are debugging a buggy device driver that leaks IOMMU mappings. | 176 | are debugging a buggy device driver that leaks IOMMU mappings. |
177 | 177 | ||
178 | config MMIOTRACE | 178 | config HAVE_MMIOTRACE_SUPPORT |
179 | bool "Memory mapped IO tracing" | 179 | def_bool y |
180 | depends on DEBUG_KERNEL && PCI | ||
181 | select TRACING | ||
182 | help | ||
183 | Mmiotrace traces Memory Mapped I/O access and is meant for | ||
184 | debugging and reverse engineering. It is called from the ioremap | ||
185 | implementation and works via page faults. Tracing is disabled by | ||
186 | default and can be enabled at run-time. | ||
187 | |||
188 | See Documentation/tracers/mmiotrace.txt. | ||
189 | If you are not helping to develop drivers, say N. | ||
190 | |||
191 | config MMIOTRACE_TEST | ||
192 | tristate "Test module for mmiotrace" | ||
193 | depends on MMIOTRACE && m | ||
194 | help | ||
195 | This is a dumb module for testing mmiotrace. It is very dangerous | ||
196 | as it will write garbage to IO memory starting at a given address. | ||
197 | However, it should be safe to use on e.g. unused portion of VRAM. | ||
198 | |||
199 | Say N, unless you absolutely know what you are doing. | ||
200 | 180 | ||
201 | # | 181 | # |
202 | # IO delay types: | 182 | # IO delay types: |
diff --git a/arch/x86/include/asm/kvm.h b/arch/x86/include/asm/kvm.h index d2e3bf3608af..886c9402ec45 100644 --- a/arch/x86/include/asm/kvm.h +++ b/arch/x86/include/asm/kvm.h | |||
@@ -9,6 +9,13 @@ | |||
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
10 | #include <linux/ioctl.h> | 10 | #include <linux/ioctl.h> |
11 | 11 | ||
12 | /* Select x86 specific features in <linux/kvm.h> */ | ||
13 | #define __KVM_HAVE_PIT | ||
14 | #define __KVM_HAVE_IOAPIC | ||
15 | #define __KVM_HAVE_DEVICE_ASSIGNMENT | ||
16 | #define __KVM_HAVE_MSI | ||
17 | #define __KVM_HAVE_USER_NMI | ||
18 | |||
12 | /* Architectural interrupt line count. */ | 19 | /* Architectural interrupt line count. */ |
13 | #define KVM_NR_INTERRUPTS 256 | 20 | #define KVM_NR_INTERRUPTS 256 |
14 | 21 | ||
diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h index 07f1af494ca5..105fb90a0635 100644 --- a/arch/x86/include/asm/mmzone_32.h +++ b/arch/x86/include/asm/mmzone_32.h | |||
@@ -32,8 +32,6 @@ static inline void get_memcfg_numa(void) | |||
32 | get_memcfg_numa_flat(); | 32 | get_memcfg_numa_flat(); |
33 | } | 33 | } |
34 | 34 | ||
35 | extern int early_pfn_to_nid(unsigned long pfn); | ||
36 | |||
37 | extern void resume_map_numa_kva(pgd_t *pgd); | 35 | extern void resume_map_numa_kva(pgd_t *pgd); |
38 | 36 | ||
39 | #else /* !CONFIG_NUMA */ | 37 | #else /* !CONFIG_NUMA */ |
diff --git a/arch/x86/include/asm/mmzone_64.h b/arch/x86/include/asm/mmzone_64.h index a5b3817d4b9e..a29f48c2a322 100644 --- a/arch/x86/include/asm/mmzone_64.h +++ b/arch/x86/include/asm/mmzone_64.h | |||
@@ -40,8 +40,6 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) | |||
40 | #define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ | 40 | #define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ |
41 | NODE_DATA(nid)->node_spanned_pages) | 41 | NODE_DATA(nid)->node_spanned_pages) |
42 | 42 | ||
43 | extern int early_pfn_to_nid(unsigned long pfn); | ||
44 | |||
45 | #ifdef CONFIG_NUMA_EMU | 43 | #ifdef CONFIG_NUMA_EMU |
46 | #define FAKE_NODE_MIN_SIZE (64 * 1024 * 1024) | 44 | #define FAKE_NODE_MIN_SIZE (64 * 1024 * 1024) |
47 | #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) | 45 | #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) |
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index c12823eb55b5..160b3ab11e7a 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -837,7 +837,7 @@ void clear_local_APIC(void) | |||
837 | } | 837 | } |
838 | 838 | ||
839 | /* lets not touch this if we didn't frob it */ | 839 | /* lets not touch this if we didn't frob it */ |
840 | #if defined(CONFIG_X86_MCE_P4THERMAL) || defined(X86_MCE_INTEL) | 840 | #if defined(CONFIG_X86_MCE_P4THERMAL) || defined(CONFIG_X86_MCE_INTEL) |
841 | if (maxlvt >= 5) { | 841 | if (maxlvt >= 5) { |
842 | v = apic_read(APIC_LVTTHMR); | 842 | v = apic_read(APIC_LVTTHMR); |
843 | apic_write(APIC_LVTTHMR, v | APIC_LVT_MASKED); | 843 | apic_write(APIC_LVTTHMR, v | APIC_LVT_MASKED); |
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index fb039cd345d8..6428aa17b40e 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -1157,8 +1157,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1157 | data->cpu = pol->cpu; | 1157 | data->cpu = pol->cpu; |
1158 | data->currpstate = HW_PSTATE_INVALID; | 1158 | data->currpstate = HW_PSTATE_INVALID; |
1159 | 1159 | ||
1160 | rc = powernow_k8_cpu_init_acpi(data); | 1160 | if (powernow_k8_cpu_init_acpi(data)) { |
1161 | if (rc) { | ||
1162 | /* | 1161 | /* |
1163 | * Use the PSB BIOS structure. This is only availabe on | 1162 | * Use the PSB BIOS structure. This is only availabe on |
1164 | * an UP version, and is deprecated by AMD. | 1163 | * an UP version, and is deprecated by AMD. |
@@ -1176,17 +1175,20 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1176 | "ACPI maintainers and complain to your BIOS " | 1175 | "ACPI maintainers and complain to your BIOS " |
1177 | "vendor.\n"); | 1176 | "vendor.\n"); |
1178 | #endif | 1177 | #endif |
1179 | goto err_out; | 1178 | kfree(data); |
1179 | return -ENODEV; | ||
1180 | } | 1180 | } |
1181 | if (pol->cpu != 0) { | 1181 | if (pol->cpu != 0) { |
1182 | printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for " | 1182 | printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for " |
1183 | "CPU other than CPU0. Complain to your BIOS " | 1183 | "CPU other than CPU0. Complain to your BIOS " |
1184 | "vendor.\n"); | 1184 | "vendor.\n"); |
1185 | goto err_out; | 1185 | kfree(data); |
1186 | return -ENODEV; | ||
1186 | } | 1187 | } |
1187 | rc = find_psb_table(data); | 1188 | rc = find_psb_table(data); |
1188 | if (rc) { | 1189 | if (rc) { |
1189 | goto err_out; | 1190 | kfree(data); |
1191 | return -ENODEV; | ||
1190 | } | 1192 | } |
1191 | /* Take a crude guess here. | 1193 | /* Take a crude guess here. |
1192 | * That guess was in microseconds, so multiply with 1000 */ | 1194 | * That guess was in microseconds, so multiply with 1000 */ |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c index 1c838032fd37..25cf624eccb7 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_64.c | |||
@@ -295,11 +295,11 @@ void do_machine_check(struct pt_regs * regs, long error_code) | |||
295 | * If we know that the error was in user space, send a | 295 | * If we know that the error was in user space, send a |
296 | * SIGBUS. Otherwise, panic if tolerance is low. | 296 | * SIGBUS. Otherwise, panic if tolerance is low. |
297 | * | 297 | * |
298 | * do_exit() takes an awful lot of locks and has a slight | 298 | * force_sig() takes an awful lot of locks and has a slight |
299 | * risk of deadlocking. | 299 | * risk of deadlocking. |
300 | */ | 300 | */ |
301 | if (user_space) { | 301 | if (user_space) { |
302 | do_exit(SIGBUS); | 302 | force_sig(SIGBUS, current); |
303 | } else if (panic_on_oops || tolerant < 2) { | 303 | } else if (panic_on_oops || tolerant < 2) { |
304 | mce_panic("Uncorrected machine check", | 304 | mce_panic("Uncorrected machine check", |
305 | &panicm, mcestart); | 305 | &panicm, mcestart); |
@@ -734,6 +734,7 @@ __setup("mce=", mcheck_enable); | |||
734 | static int mce_resume(struct sys_device *dev) | 734 | static int mce_resume(struct sys_device *dev) |
735 | { | 735 | { |
736 | mce_init(NULL); | 736 | mce_init(NULL); |
737 | mce_cpu_features(¤t_cpu_data); | ||
737 | return 0; | 738 | return 0; |
738 | } | 739 | } |
739 | 740 | ||
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index fec79ad85dc6..646da41a620a 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -111,9 +111,6 @@ void cpu_idle(void) | |||
111 | check_pgt_cache(); | 111 | check_pgt_cache(); |
112 | rmb(); | 112 | rmb(); |
113 | 113 | ||
114 | if (rcu_pending(cpu)) | ||
115 | rcu_check_callbacks(cpu, 0); | ||
116 | |||
117 | if (cpu_is_offline(cpu)) | 114 | if (cpu_is_offline(cpu)) |
118 | play_dead(); | 115 | play_dead(); |
119 | 116 | ||
diff --git a/arch/x86/kernel/vmiclock_32.c b/arch/x86/kernel/vmiclock_32.c index a4791ef412d1..9cd28c04952a 100644 --- a/arch/x86/kernel/vmiclock_32.c +++ b/arch/x86/kernel/vmiclock_32.c | |||
@@ -283,10 +283,13 @@ void __devinit vmi_time_ap_init(void) | |||
283 | #endif | 283 | #endif |
284 | 284 | ||
285 | /** vmi clocksource */ | 285 | /** vmi clocksource */ |
286 | static struct clocksource clocksource_vmi; | ||
286 | 287 | ||
287 | static cycle_t read_real_cycles(void) | 288 | static cycle_t read_real_cycles(void) |
288 | { | 289 | { |
289 | return vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL); | 290 | cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL); |
291 | return ret >= clocksource_vmi.cycle_last ? | ||
292 | ret : clocksource_vmi.cycle_last; | ||
290 | } | 293 | } |
291 | 294 | ||
292 | static struct clocksource clocksource_vmi = { | 295 | static struct clocksource clocksource_vmi = { |
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index e665d1c623ca..72bd275a9b5c 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c | |||
@@ -207,7 +207,7 @@ static int __pit_timer_fn(struct kvm_kpit_state *ps) | |||
207 | hrtimer_add_expires_ns(&pt->timer, pt->period); | 207 | hrtimer_add_expires_ns(&pt->timer, pt->period); |
208 | pt->scheduled = hrtimer_get_expires_ns(&pt->timer); | 208 | pt->scheduled = hrtimer_get_expires_ns(&pt->timer); |
209 | if (pt->period) | 209 | if (pt->period) |
210 | ps->channels[0].count_load_time = hrtimer_get_expires(&pt->timer); | 210 | ps->channels[0].count_load_time = ktime_get(); |
211 | 211 | ||
212 | return (pt->period == 0 ? 0 : 1); | 212 | return (pt->period == 0 ? 0 : 1); |
213 | } | 213 | } |
diff --git a/arch/x86/kvm/irq.c b/arch/x86/kvm/irq.c index c019b8edcdb7..cf17ed52f6fb 100644 --- a/arch/x86/kvm/irq.c +++ b/arch/x86/kvm/irq.c | |||
@@ -87,13 +87,6 @@ void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu) | |||
87 | } | 87 | } |
88 | EXPORT_SYMBOL_GPL(kvm_inject_pending_timer_irqs); | 88 | EXPORT_SYMBOL_GPL(kvm_inject_pending_timer_irqs); |
89 | 89 | ||
90 | void kvm_timer_intr_post(struct kvm_vcpu *vcpu, int vec) | ||
91 | { | ||
92 | kvm_apic_timer_intr_post(vcpu, vec); | ||
93 | /* TODO: PIT, RTC etc. */ | ||
94 | } | ||
95 | EXPORT_SYMBOL_GPL(kvm_timer_intr_post); | ||
96 | |||
97 | void __kvm_migrate_timers(struct kvm_vcpu *vcpu) | 90 | void __kvm_migrate_timers(struct kvm_vcpu *vcpu) |
98 | { | 91 | { |
99 | __kvm_migrate_apic_timer(vcpu); | 92 | __kvm_migrate_apic_timer(vcpu); |
diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h index 2bf32a03ceec..82579ee538d0 100644 --- a/arch/x86/kvm/irq.h +++ b/arch/x86/kvm/irq.h | |||
@@ -89,7 +89,6 @@ static inline int irqchip_in_kernel(struct kvm *kvm) | |||
89 | 89 | ||
90 | void kvm_pic_reset(struct kvm_kpic_state *s); | 90 | void kvm_pic_reset(struct kvm_kpic_state *s); |
91 | 91 | ||
92 | void kvm_timer_intr_post(struct kvm_vcpu *vcpu, int vec); | ||
93 | void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu); | 92 | void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu); |
94 | void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu); | 93 | void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu); |
95 | void kvm_apic_nmi_wd_deliver(struct kvm_vcpu *vcpu); | 94 | void kvm_apic_nmi_wd_deliver(struct kvm_vcpu *vcpu); |
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index afac68c0815c..f0b67f2cdd69 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c | |||
@@ -35,6 +35,12 @@ | |||
35 | #include "kvm_cache_regs.h" | 35 | #include "kvm_cache_regs.h" |
36 | #include "irq.h" | 36 | #include "irq.h" |
37 | 37 | ||
38 | #ifndef CONFIG_X86_64 | ||
39 | #define mod_64(x, y) ((x) - (y) * div64_u64(x, y)) | ||
40 | #else | ||
41 | #define mod_64(x, y) ((x) % (y)) | ||
42 | #endif | ||
43 | |||
38 | #define PRId64 "d" | 44 | #define PRId64 "d" |
39 | #define PRIx64 "llx" | 45 | #define PRIx64 "llx" |
40 | #define PRIu64 "u" | 46 | #define PRIu64 "u" |
@@ -511,52 +517,22 @@ static void apic_send_ipi(struct kvm_lapic *apic) | |||
511 | 517 | ||
512 | static u32 apic_get_tmcct(struct kvm_lapic *apic) | 518 | static u32 apic_get_tmcct(struct kvm_lapic *apic) |
513 | { | 519 | { |
514 | u64 counter_passed; | 520 | ktime_t remaining; |
515 | ktime_t passed, now; | 521 | s64 ns; |
516 | u32 tmcct; | 522 | u32 tmcct; |
517 | 523 | ||
518 | ASSERT(apic != NULL); | 524 | ASSERT(apic != NULL); |
519 | 525 | ||
520 | now = apic->timer.dev.base->get_time(); | ||
521 | tmcct = apic_get_reg(apic, APIC_TMICT); | ||
522 | |||
523 | /* if initial count is 0, current count should also be 0 */ | 526 | /* if initial count is 0, current count should also be 0 */ |
524 | if (tmcct == 0) | 527 | if (apic_get_reg(apic, APIC_TMICT) == 0) |
525 | return 0; | 528 | return 0; |
526 | 529 | ||
527 | if (unlikely(ktime_to_ns(now) <= | 530 | remaining = hrtimer_expires_remaining(&apic->timer.dev); |
528 | ktime_to_ns(apic->timer.last_update))) { | 531 | if (ktime_to_ns(remaining) < 0) |
529 | /* Wrap around */ | 532 | remaining = ktime_set(0, 0); |
530 | passed = ktime_add(( { | 533 | |
531 | (ktime_t) { | 534 | ns = mod_64(ktime_to_ns(remaining), apic->timer.period); |
532 | .tv64 = KTIME_MAX - | 535 | tmcct = div64_u64(ns, (APIC_BUS_CYCLE_NS * apic->timer.divide_count)); |
533 | (apic->timer.last_update).tv64}; } | ||
534 | ), now); | ||
535 | apic_debug("time elapsed\n"); | ||
536 | } else | ||
537 | passed = ktime_sub(now, apic->timer.last_update); | ||
538 | |||
539 | counter_passed = div64_u64(ktime_to_ns(passed), | ||
540 | (APIC_BUS_CYCLE_NS * apic->timer.divide_count)); | ||
541 | |||
542 | if (counter_passed > tmcct) { | ||
543 | if (unlikely(!apic_lvtt_period(apic))) { | ||
544 | /* one-shot timers stick at 0 until reset */ | ||
545 | tmcct = 0; | ||
546 | } else { | ||
547 | /* | ||
548 | * periodic timers reset to APIC_TMICT when they | ||
549 | * hit 0. The while loop simulates this happening N | ||
550 | * times. (counter_passed %= tmcct) would also work, | ||
551 | * but might be slower or not work on 32-bit?? | ||
552 | */ | ||
553 | while (counter_passed > tmcct) | ||
554 | counter_passed -= tmcct; | ||
555 | tmcct -= counter_passed; | ||
556 | } | ||
557 | } else { | ||
558 | tmcct -= counter_passed; | ||
559 | } | ||
560 | 536 | ||
561 | return tmcct; | 537 | return tmcct; |
562 | } | 538 | } |
@@ -653,8 +629,6 @@ static void start_apic_timer(struct kvm_lapic *apic) | |||
653 | { | 629 | { |
654 | ktime_t now = apic->timer.dev.base->get_time(); | 630 | ktime_t now = apic->timer.dev.base->get_time(); |
655 | 631 | ||
656 | apic->timer.last_update = now; | ||
657 | |||
658 | apic->timer.period = apic_get_reg(apic, APIC_TMICT) * | 632 | apic->timer.period = apic_get_reg(apic, APIC_TMICT) * |
659 | APIC_BUS_CYCLE_NS * apic->timer.divide_count; | 633 | APIC_BUS_CYCLE_NS * apic->timer.divide_count; |
660 | atomic_set(&apic->timer.pending, 0); | 634 | atomic_set(&apic->timer.pending, 0); |
@@ -1110,16 +1084,6 @@ void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu) | |||
1110 | } | 1084 | } |
1111 | } | 1085 | } |
1112 | 1086 | ||
1113 | void kvm_apic_timer_intr_post(struct kvm_vcpu *vcpu, int vec) | ||
1114 | { | ||
1115 | struct kvm_lapic *apic = vcpu->arch.apic; | ||
1116 | |||
1117 | if (apic && apic_lvt_vector(apic, APIC_LVTT) == vec) | ||
1118 | apic->timer.last_update = ktime_add_ns( | ||
1119 | apic->timer.last_update, | ||
1120 | apic->timer.period); | ||
1121 | } | ||
1122 | |||
1123 | int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu) | 1087 | int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu) |
1124 | { | 1088 | { |
1125 | int vector = kvm_apic_has_interrupt(vcpu); | 1089 | int vector = kvm_apic_has_interrupt(vcpu); |
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h index 81858881287e..45ab6ee71209 100644 --- a/arch/x86/kvm/lapic.h +++ b/arch/x86/kvm/lapic.h | |||
@@ -12,7 +12,6 @@ struct kvm_lapic { | |||
12 | atomic_t pending; | 12 | atomic_t pending; |
13 | s64 period; /* unit: ns */ | 13 | s64 period; /* unit: ns */ |
14 | u32 divide_count; | 14 | u32 divide_count; |
15 | ktime_t last_update; | ||
16 | struct hrtimer dev; | 15 | struct hrtimer dev; |
17 | } timer; | 16 | } timer; |
18 | struct kvm_vcpu *vcpu; | 17 | struct kvm_vcpu *vcpu; |
@@ -42,7 +41,6 @@ void kvm_set_apic_base(struct kvm_vcpu *vcpu, u64 data); | |||
42 | void kvm_apic_post_state_restore(struct kvm_vcpu *vcpu); | 41 | void kvm_apic_post_state_restore(struct kvm_vcpu *vcpu); |
43 | int kvm_lapic_enabled(struct kvm_vcpu *vcpu); | 42 | int kvm_lapic_enabled(struct kvm_vcpu *vcpu); |
44 | int kvm_lapic_find_highest_irr(struct kvm_vcpu *vcpu); | 43 | int kvm_lapic_find_highest_irr(struct kvm_vcpu *vcpu); |
45 | void kvm_apic_timer_intr_post(struct kvm_vcpu *vcpu, int vec); | ||
46 | 44 | ||
47 | void kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr); | 45 | void kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr); |
48 | void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu); | 46 | void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu); |
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 83f11c7474a1..2d4477c71473 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -1698,8 +1698,13 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte, | |||
1698 | if (largepage) | 1698 | if (largepage) |
1699 | spte |= PT_PAGE_SIZE_MASK; | 1699 | spte |= PT_PAGE_SIZE_MASK; |
1700 | if (mt_mask) { | 1700 | if (mt_mask) { |
1701 | mt_mask = get_memory_type(vcpu, gfn) << | 1701 | if (!kvm_is_mmio_pfn(pfn)) { |
1702 | kvm_x86_ops->get_mt_mask_shift(); | 1702 | mt_mask = get_memory_type(vcpu, gfn) << |
1703 | kvm_x86_ops->get_mt_mask_shift(); | ||
1704 | mt_mask |= VMX_EPT_IGMT_BIT; | ||
1705 | } else | ||
1706 | mt_mask = MTRR_TYPE_UNCACHABLE << | ||
1707 | kvm_x86_ops->get_mt_mask_shift(); | ||
1703 | spte |= mt_mask; | 1708 | spte |= mt_mask; |
1704 | } | 1709 | } |
1705 | 1710 | ||
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 1452851ae258..a9e769e4e251 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -1600,7 +1600,6 @@ static void svm_intr_assist(struct kvm_vcpu *vcpu) | |||
1600 | /* Okay, we can deliver the interrupt: grab it and update PIC state. */ | 1600 | /* Okay, we can deliver the interrupt: grab it and update PIC state. */ |
1601 | intr_vector = kvm_cpu_get_interrupt(vcpu); | 1601 | intr_vector = kvm_cpu_get_interrupt(vcpu); |
1602 | svm_inject_irq(svm, intr_vector); | 1602 | svm_inject_irq(svm, intr_vector); |
1603 | kvm_timer_intr_post(vcpu, intr_vector); | ||
1604 | out: | 1603 | out: |
1605 | update_cr8_intercept(vcpu); | 1604 | update_cr8_intercept(vcpu); |
1606 | } | 1605 | } |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 6259d7467648..7611af576829 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -903,6 +903,7 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata) | |||
903 | data = vmcs_readl(GUEST_SYSENTER_ESP); | 903 | data = vmcs_readl(GUEST_SYSENTER_ESP); |
904 | break; | 904 | break; |
905 | default: | 905 | default: |
906 | vmx_load_host_state(to_vmx(vcpu)); | ||
906 | msr = find_msr_entry(to_vmx(vcpu), msr_index); | 907 | msr = find_msr_entry(to_vmx(vcpu), msr_index); |
907 | if (msr) { | 908 | if (msr) { |
908 | data = msr->data; | 909 | data = msr->data; |
@@ -3285,7 +3286,6 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu) | |||
3285 | } | 3286 | } |
3286 | if (vcpu->arch.interrupt.pending) { | 3287 | if (vcpu->arch.interrupt.pending) { |
3287 | vmx_inject_irq(vcpu, vcpu->arch.interrupt.nr); | 3288 | vmx_inject_irq(vcpu, vcpu->arch.interrupt.nr); |
3288 | kvm_timer_intr_post(vcpu, vcpu->arch.interrupt.nr); | ||
3289 | if (kvm_cpu_has_interrupt(vcpu)) | 3289 | if (kvm_cpu_has_interrupt(vcpu)) |
3290 | enable_irq_window(vcpu); | 3290 | enable_irq_window(vcpu); |
3291 | } | 3291 | } |
@@ -3687,8 +3687,7 @@ static int __init vmx_init(void) | |||
3687 | if (vm_need_ept()) { | 3687 | if (vm_need_ept()) { |
3688 | bypass_guest_pf = 0; | 3688 | bypass_guest_pf = 0; |
3689 | kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK | | 3689 | kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK | |
3690 | VMX_EPT_WRITABLE_MASK | | 3690 | VMX_EPT_WRITABLE_MASK); |
3691 | VMX_EPT_IGMT_BIT); | ||
3692 | kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, | 3691 | kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, |
3693 | VMX_EPT_EXECUTABLE_MASK, | 3692 | VMX_EPT_EXECUTABLE_MASK, |
3694 | VMX_EPT_DEFAULT_MT << VMX_EPT_MT_EPTE_SHIFT); | 3693 | VMX_EPT_DEFAULT_MT << VMX_EPT_MT_EPTE_SHIFT); |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index cc17546a2406..758b7a155ae9 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -967,7 +967,6 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
967 | case KVM_CAP_MMU_SHADOW_CACHE_CONTROL: | 967 | case KVM_CAP_MMU_SHADOW_CACHE_CONTROL: |
968 | case KVM_CAP_SET_TSS_ADDR: | 968 | case KVM_CAP_SET_TSS_ADDR: |
969 | case KVM_CAP_EXT_CPUID: | 969 | case KVM_CAP_EXT_CPUID: |
970 | case KVM_CAP_CLOCKSOURCE: | ||
971 | case KVM_CAP_PIT: | 970 | case KVM_CAP_PIT: |
972 | case KVM_CAP_NOP_IO_DELAY: | 971 | case KVM_CAP_NOP_IO_DELAY: |
973 | case KVM_CAP_MP_STATE: | 972 | case KVM_CAP_MP_STATE: |
@@ -992,6 +991,9 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
992 | case KVM_CAP_IOMMU: | 991 | case KVM_CAP_IOMMU: |
993 | r = iommu_found(); | 992 | r = iommu_found(); |
994 | break; | 993 | break; |
994 | case KVM_CAP_CLOCKSOURCE: | ||
995 | r = boot_cpu_has(X86_FEATURE_CONSTANT_TSC); | ||
996 | break; | ||
995 | default: | 997 | default: |
996 | r = 0; | 998 | r = 0; |
997 | break; | 999 | break; |
@@ -4127,9 +4129,13 @@ static void kvm_free_vcpus(struct kvm *kvm) | |||
4127 | 4129 | ||
4128 | } | 4130 | } |
4129 | 4131 | ||
4130 | void kvm_arch_destroy_vm(struct kvm *kvm) | 4132 | void kvm_arch_sync_events(struct kvm *kvm) |
4131 | { | 4133 | { |
4132 | kvm_free_all_assigned_devices(kvm); | 4134 | kvm_free_all_assigned_devices(kvm); |
4135 | } | ||
4136 | |||
4137 | void kvm_arch_destroy_vm(struct kvm *kvm) | ||
4138 | { | ||
4133 | kvm_iommu_unmap_guest(kvm); | 4139 | kvm_iommu_unmap_guest(kvm); |
4134 | kvm_free_pit(kvm); | 4140 | kvm_free_pit(kvm); |
4135 | kfree(kvm->arch.vpic); | 4141 | kfree(kvm->arch.vpic); |
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index deb1c1ab7868..64c9cf043cdd 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -166,7 +166,7 @@ int __init compute_hash_shift(struct bootnode *nodes, int numnodes, | |||
166 | return shift; | 166 | return shift; |
167 | } | 167 | } |
168 | 168 | ||
169 | int early_pfn_to_nid(unsigned long pfn) | 169 | int __meminit __early_pfn_to_nid(unsigned long pfn) |
170 | { | 170 | { |
171 | return phys_to_nid(pfn << PAGE_SHIFT); | 171 | return phys_to_nid(pfn << PAGE_SHIFT); |
172 | } | 172 | } |
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 8ca0d8566fc8..7be47d1a97e4 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -508,18 +508,13 @@ static int split_large_page(pte_t *kpte, unsigned long address) | |||
508 | #endif | 508 | #endif |
509 | 509 | ||
510 | /* | 510 | /* |
511 | * Install the new, split up pagetable. Important details here: | 511 | * Install the new, split up pagetable. |
512 | * | 512 | * |
513 | * On Intel the NX bit of all levels must be cleared to make a | 513 | * We use the standard kernel pagetable protections for the new |
514 | * page executable. See section 4.13.2 of Intel 64 and IA-32 | 514 | * pagetable protections, the actual ptes set above control the |
515 | * Architectures Software Developer's Manual). | 515 | * primary protection behavior: |
516 | * | ||
517 | * Mark the entry present. The current mapping might be | ||
518 | * set to not present, which we preserved above. | ||
519 | */ | 516 | */ |
520 | ref_prot = pte_pgprot(pte_mkexec(pte_clrhuge(*kpte))); | 517 | __set_pmd_pte(kpte, address, mk_pte(base, __pgprot(_KERNPG_TABLE))); |
521 | pgprot_val(ref_prot) |= _PAGE_PRESENT; | ||
522 | __set_pmd_pte(kpte, address, mk_pte(base, ref_prot)); | ||
523 | base = NULL; | 518 | base = NULL; |
524 | 519 | ||
525 | out_unlock: | 520 | out_unlock: |