diff options
Diffstat (limited to 'arch')
24 files changed, 243 insertions, 212 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 7049815d66d5..68d6494c0389 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -233,12 +233,13 @@ static void __init cacheid_init(void) | |||
233 | unsigned int cachetype = read_cpuid_cachetype(); | 233 | unsigned int cachetype = read_cpuid_cachetype(); |
234 | unsigned int arch = cpu_architecture(); | 234 | unsigned int arch = cpu_architecture(); |
235 | 235 | ||
236 | if (arch >= CPU_ARCH_ARMv7) { | 236 | if (arch >= CPU_ARCH_ARMv6) { |
237 | cacheid = CACHEID_VIPT_NONALIASING; | 237 | if ((cachetype & (7 << 29)) == 4 << 29) { |
238 | if ((cachetype & (3 << 14)) == 1 << 14) | 238 | /* ARMv7 register format */ |
239 | cacheid |= CACHEID_ASID_TAGGED; | 239 | cacheid = CACHEID_VIPT_NONALIASING; |
240 | } else if (arch >= CPU_ARCH_ARMv6) { | 240 | if ((cachetype & (3 << 14)) == 1 << 14) |
241 | if (cachetype & (1 << 23)) | 241 | cacheid |= CACHEID_ASID_TAGGED; |
242 | } else if (cachetype & (1 << 23)) | ||
242 | cacheid = CACHEID_VIPT_ALIASING; | 243 | cacheid = CACHEID_VIPT_ALIASING; |
243 | else | 244 | else |
244 | cacheid = CACHEID_VIPT_NONALIASING; | 245 | cacheid = CACHEID_VIPT_NONALIASING; |
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 9bb4f043aa22..7ac812dc055a 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c | |||
@@ -332,7 +332,6 @@ static int at91_pm_enter(suspend_state_t state) | |||
332 | at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR)); | 332 | at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR)); |
333 | 333 | ||
334 | error: | 334 | error: |
335 | sdram_selfrefresh_disable(); | ||
336 | target_state = PM_SUSPEND_ON; | 335 | target_state = PM_SUSPEND_ON; |
337 | at91_irq_resume(); | 336 | at91_irq_resume(); |
338 | at91_gpio_resume(); | 337 | at91_gpio_resume(); |
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S index 8a7f65ba14b7..94077fbd96b7 100644 --- a/arch/arm/mm/abort-ev6.S +++ b/arch/arm/mm/abort-ev6.S | |||
@@ -23,7 +23,8 @@ ENTRY(v6_early_abort) | |||
23 | #ifdef CONFIG_CPU_32v6K | 23 | #ifdef CONFIG_CPU_32v6K |
24 | clrex | 24 | clrex |
25 | #else | 25 | #else |
26 | strex r0, r1, [sp] @ Clear the exclusive monitor | 26 | sub r1, sp, #4 @ Get unused stack location |
27 | strex r0, r1, [r1] @ Clear the exclusive monitor | ||
27 | #endif | 28 | #endif |
28 | mrc p15, 0, r1, c5, c0, 0 @ get FSR | 29 | mrc p15, 0, r1, c5, c0, 0 @ get FSR |
29 | mrc p15, 0, r0, c6, c0, 0 @ get FAR | 30 | mrc p15, 0, r0, c6, c0, 0 @ get FAR |
diff --git a/arch/arm/plat-s3c64xx/irq-eint.c b/arch/arm/plat-s3c64xx/irq-eint.c index 1f7cc0067f5c..ebb305ce7689 100644 --- a/arch/arm/plat-s3c64xx/irq-eint.c +++ b/arch/arm/plat-s3c64xx/irq-eint.c | |||
@@ -55,7 +55,7 @@ static void s3c_irq_eint_unmask(unsigned int irq) | |||
55 | u32 mask; | 55 | u32 mask; |
56 | 56 | ||
57 | mask = __raw_readl(S3C64XX_EINT0MASK); | 57 | mask = __raw_readl(S3C64XX_EINT0MASK); |
58 | mask |= eint_irq_to_bit(irq); | 58 | mask &= ~eint_irq_to_bit(irq); |
59 | __raw_writel(mask, S3C64XX_EINT0MASK); | 59 | __raw_writel(mask, S3C64XX_EINT0MASK); |
60 | } | 60 | } |
61 | 61 | ||
diff --git a/arch/mips/include/asm/seccomp.h b/arch/mips/include/asm/seccomp.h index 36ed44070256..a6772e9507f5 100644 --- a/arch/mips/include/asm/seccomp.h +++ b/arch/mips/include/asm/seccomp.h | |||
@@ -1,6 +1,5 @@ | |||
1 | #ifndef __ASM_SECCOMP_H | 1 | #ifndef __ASM_SECCOMP_H |
2 | 2 | ||
3 | #include <linux/thread_info.h> | ||
4 | #include <linux/unistd.h> | 3 | #include <linux/unistd.h> |
5 | 4 | ||
6 | #define __NR_seccomp_read __NR_read | 5 | #define __NR_seccomp_read __NR_read |
diff --git a/arch/powerpc/configs/linkstation_defconfig b/arch/powerpc/configs/linkstation_defconfig index aa5855a156de..15900dcf0bfa 100644 --- a/arch/powerpc/configs/linkstation_defconfig +++ b/arch/powerpc/configs/linkstation_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.29-rc2 | 3 | # Linux kernel version: 2.6.29-rc6 |
4 | # Mon Jan 26 15:35:29 2009 | 4 | # Fri Mar 6 00:07:38 2009 |
5 | # | 5 | # |
6 | # CONFIG_PPC64 is not set | 6 | # CONFIG_PPC64 is not set |
7 | 7 | ||
@@ -71,6 +71,15 @@ CONFIG_POSIX_MQUEUE=y | |||
71 | # CONFIG_BSD_PROCESS_ACCT is not set | 71 | # CONFIG_BSD_PROCESS_ACCT is not set |
72 | # CONFIG_TASKSTATS is not set | 72 | # CONFIG_TASKSTATS is not set |
73 | # CONFIG_AUDIT is not set | 73 | # CONFIG_AUDIT is not set |
74 | |||
75 | # | ||
76 | # RCU Subsystem | ||
77 | # | ||
78 | CONFIG_CLASSIC_RCU=y | ||
79 | # CONFIG_TREE_RCU is not set | ||
80 | # CONFIG_PREEMPT_RCU is not set | ||
81 | # CONFIG_TREE_RCU_TRACE is not set | ||
82 | # CONFIG_PREEMPT_RCU_TRACE is not set | ||
74 | CONFIG_IKCONFIG=y | 83 | CONFIG_IKCONFIG=y |
75 | CONFIG_IKCONFIG_PROC=y | 84 | CONFIG_IKCONFIG_PROC=y |
76 | CONFIG_LOG_BUF_SHIFT=14 | 85 | CONFIG_LOG_BUF_SHIFT=14 |
@@ -88,6 +97,7 @@ CONFIG_NAMESPACES=y | |||
88 | # CONFIG_IPC_NS is not set | 97 | # CONFIG_IPC_NS is not set |
89 | # CONFIG_USER_NS is not set | 98 | # CONFIG_USER_NS is not set |
90 | # CONFIG_PID_NS is not set | 99 | # CONFIG_PID_NS is not set |
100 | # CONFIG_NET_NS is not set | ||
91 | CONFIG_BLK_DEV_INITRD=y | 101 | CONFIG_BLK_DEV_INITRD=y |
92 | CONFIG_INITRAMFS_SOURCE="" | 102 | CONFIG_INITRAMFS_SOURCE="" |
93 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | 103 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y |
@@ -153,11 +163,6 @@ CONFIG_DEFAULT_AS=y | |||
153 | # CONFIG_DEFAULT_CFQ is not set | 163 | # CONFIG_DEFAULT_CFQ is not set |
154 | # CONFIG_DEFAULT_NOOP is not set | 164 | # CONFIG_DEFAULT_NOOP is not set |
155 | CONFIG_DEFAULT_IOSCHED="anticipatory" | 165 | CONFIG_DEFAULT_IOSCHED="anticipatory" |
156 | CONFIG_CLASSIC_RCU=y | ||
157 | # CONFIG_TREE_RCU is not set | ||
158 | # CONFIG_PREEMPT_RCU is not set | ||
159 | # CONFIG_TREE_RCU_TRACE is not set | ||
160 | # CONFIG_PREEMPT_RCU_TRACE is not set | ||
161 | # CONFIG_FREEZER is not set | 166 | # CONFIG_FREEZER is not set |
162 | 167 | ||
163 | # | 168 | # |
@@ -294,7 +299,6 @@ CONFIG_NET=y | |||
294 | # | 299 | # |
295 | # Networking options | 300 | # Networking options |
296 | # | 301 | # |
297 | # CONFIG_NET_NS is not set | ||
298 | CONFIG_COMPAT_NET_DEV_OPS=y | 302 | CONFIG_COMPAT_NET_DEV_OPS=y |
299 | CONFIG_PACKET=y | 303 | CONFIG_PACKET=y |
300 | CONFIG_PACKET_MMAP=y | 304 | CONFIG_PACKET_MMAP=y |
@@ -508,8 +512,8 @@ CONFIG_MTD_CONCAT=y | |||
508 | CONFIG_MTD_PARTITIONS=y | 512 | CONFIG_MTD_PARTITIONS=y |
509 | # CONFIG_MTD_TESTS is not set | 513 | # CONFIG_MTD_TESTS is not set |
510 | # CONFIG_MTD_REDBOOT_PARTS is not set | 514 | # CONFIG_MTD_REDBOOT_PARTS is not set |
511 | # CONFIG_MTD_CMDLINE_PARTS is not set | 515 | CONFIG_MTD_CMDLINE_PARTS=y |
512 | # CONFIG_MTD_OF_PARTS is not set | 516 | CONFIG_MTD_OF_PARTS=y |
513 | # CONFIG_MTD_AR7_PARTS is not set | 517 | # CONFIG_MTD_AR7_PARTS is not set |
514 | 518 | ||
515 | # | 519 | # |
@@ -587,7 +591,6 @@ CONFIG_MTD_PHYSMAP=y | |||
587 | # LPDDR flash memory drivers | 591 | # LPDDR flash memory drivers |
588 | # | 592 | # |
589 | # CONFIG_MTD_LPDDR is not set | 593 | # CONFIG_MTD_LPDDR is not set |
590 | # CONFIG_MTD_QINFO_PROBE is not set | ||
591 | 594 | ||
592 | # | 595 | # |
593 | # UBI - Unsorted block images | 596 | # UBI - Unsorted block images |
@@ -617,13 +620,19 @@ CONFIG_BLK_DEV_RAM_SIZE=8192 | |||
617 | # CONFIG_BLK_DEV_HD is not set | 620 | # CONFIG_BLK_DEV_HD is not set |
618 | CONFIG_MISC_DEVICES=y | 621 | CONFIG_MISC_DEVICES=y |
619 | # CONFIG_PHANTOM is not set | 622 | # CONFIG_PHANTOM is not set |
620 | # CONFIG_EEPROM_93CX6 is not set | ||
621 | # CONFIG_SGI_IOC4 is not set | 623 | # CONFIG_SGI_IOC4 is not set |
622 | # CONFIG_TIFM_CORE is not set | 624 | # CONFIG_TIFM_CORE is not set |
623 | # CONFIG_ICS932S401 is not set | 625 | # CONFIG_ICS932S401 is not set |
624 | # CONFIG_ENCLOSURE_SERVICES is not set | 626 | # CONFIG_ENCLOSURE_SERVICES is not set |
625 | # CONFIG_HP_ILO is not set | 627 | # CONFIG_HP_ILO is not set |
626 | # CONFIG_C2PORT is not set | 628 | # CONFIG_C2PORT is not set |
629 | |||
630 | # | ||
631 | # EEPROM support | ||
632 | # | ||
633 | # CONFIG_EEPROM_AT24 is not set | ||
634 | CONFIG_EEPROM_LEGACY=m | ||
635 | # CONFIG_EEPROM_93CX6 is not set | ||
627 | CONFIG_HAVE_IDE=y | 636 | CONFIG_HAVE_IDE=y |
628 | # CONFIG_IDE is not set | 637 | # CONFIG_IDE is not set |
629 | 638 | ||
@@ -839,6 +848,7 @@ CONFIG_R8169=y | |||
839 | # CONFIG_QLA3XXX is not set | 848 | # CONFIG_QLA3XXX is not set |
840 | # CONFIG_ATL1 is not set | 849 | # CONFIG_ATL1 is not set |
841 | # CONFIG_ATL1E is not set | 850 | # CONFIG_ATL1E is not set |
851 | # CONFIG_ATL1C is not set | ||
842 | # CONFIG_JME is not set | 852 | # CONFIG_JME is not set |
843 | CONFIG_NETDEV_10000=y | 853 | CONFIG_NETDEV_10000=y |
844 | # CONFIG_CHELSIO_T1 is not set | 854 | # CONFIG_CHELSIO_T1 is not set |
@@ -1037,8 +1047,6 @@ CONFIG_I2C_MPC=y | |||
1037 | # Miscellaneous I2C Chip support | 1047 | # Miscellaneous I2C Chip support |
1038 | # | 1048 | # |
1039 | # CONFIG_DS1682 is not set | 1049 | # CONFIG_DS1682 is not set |
1040 | # CONFIG_EEPROM_AT24 is not set | ||
1041 | CONFIG_EEPROM_LEGACY=m | ||
1042 | # CONFIG_SENSORS_PCF8574 is not set | 1050 | # CONFIG_SENSORS_PCF8574 is not set |
1043 | # CONFIG_PCF8575 is not set | 1051 | # CONFIG_PCF8575 is not set |
1044 | # CONFIG_SENSORS_PCA9539 is not set | 1052 | # CONFIG_SENSORS_PCA9539 is not set |
diff --git a/arch/powerpc/configs/storcenter_defconfig b/arch/powerpc/configs/storcenter_defconfig index 86512c8790d1..94903465ea12 100644 --- a/arch/powerpc/configs/storcenter_defconfig +++ b/arch/powerpc/configs/storcenter_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.29-rc2 | 3 | # Linux kernel version: 2.6.29-rc6 |
4 | # Mon Jan 26 15:35:46 2009 | 4 | # Fri Mar 6 00:09:08 2009 |
5 | # | 5 | # |
6 | # CONFIG_PPC64 is not set | 6 | # CONFIG_PPC64 is not set |
7 | 7 | ||
@@ -71,6 +71,15 @@ CONFIG_SYSVIPC_SYSCTL=y | |||
71 | # CONFIG_BSD_PROCESS_ACCT is not set | 71 | # CONFIG_BSD_PROCESS_ACCT is not set |
72 | # CONFIG_TASKSTATS is not set | 72 | # CONFIG_TASKSTATS is not set |
73 | # CONFIG_AUDIT is not set | 73 | # CONFIG_AUDIT is not set |
74 | |||
75 | # | ||
76 | # RCU Subsystem | ||
77 | # | ||
78 | CONFIG_CLASSIC_RCU=y | ||
79 | # CONFIG_TREE_RCU is not set | ||
80 | # CONFIG_PREEMPT_RCU is not set | ||
81 | # CONFIG_TREE_RCU_TRACE is not set | ||
82 | # CONFIG_PREEMPT_RCU_TRACE is not set | ||
74 | # CONFIG_IKCONFIG is not set | 83 | # CONFIG_IKCONFIG is not set |
75 | CONFIG_LOG_BUF_SHIFT=14 | 84 | CONFIG_LOG_BUF_SHIFT=14 |
76 | CONFIG_GROUP_SCHED=y | 85 | CONFIG_GROUP_SCHED=y |
@@ -144,11 +153,6 @@ CONFIG_IOSCHED_CFQ=y | |||
144 | CONFIG_DEFAULT_CFQ=y | 153 | CONFIG_DEFAULT_CFQ=y |
145 | # CONFIG_DEFAULT_NOOP is not set | 154 | # CONFIG_DEFAULT_NOOP is not set |
146 | CONFIG_DEFAULT_IOSCHED="cfq" | 155 | CONFIG_DEFAULT_IOSCHED="cfq" |
147 | CONFIG_CLASSIC_RCU=y | ||
148 | # CONFIG_TREE_RCU is not set | ||
149 | # CONFIG_PREEMPT_RCU is not set | ||
150 | # CONFIG_TREE_RCU_TRACE is not set | ||
151 | # CONFIG_PREEMPT_RCU_TRACE is not set | ||
152 | # CONFIG_FREEZER is not set | 156 | # CONFIG_FREEZER is not set |
153 | 157 | ||
154 | # | 158 | # |
@@ -377,8 +381,8 @@ CONFIG_MTD=y | |||
377 | CONFIG_MTD_PARTITIONS=y | 381 | CONFIG_MTD_PARTITIONS=y |
378 | # CONFIG_MTD_TESTS is not set | 382 | # CONFIG_MTD_TESTS is not set |
379 | # CONFIG_MTD_REDBOOT_PARTS is not set | 383 | # CONFIG_MTD_REDBOOT_PARTS is not set |
380 | # CONFIG_MTD_CMDLINE_PARTS is not set | 384 | CONFIG_MTD_CMDLINE_PARTS=y |
381 | # CONFIG_MTD_OF_PARTS is not set | 385 | CONFIG_MTD_OF_PARTS=y |
382 | # CONFIG_MTD_AR7_PARTS is not set | 386 | # CONFIG_MTD_AR7_PARTS is not set |
383 | 387 | ||
384 | # | 388 | # |
@@ -452,7 +456,6 @@ CONFIG_MTD_PHYSMAP=y | |||
452 | # LPDDR flash memory drivers | 456 | # LPDDR flash memory drivers |
453 | # | 457 | # |
454 | # CONFIG_MTD_LPDDR is not set | 458 | # CONFIG_MTD_LPDDR is not set |
455 | # CONFIG_MTD_QINFO_PROBE is not set | ||
456 | 459 | ||
457 | # | 460 | # |
458 | # UBI - Unsorted block images | 461 | # UBI - Unsorted block images |
@@ -478,13 +481,19 @@ CONFIG_BLK_DEV=y | |||
478 | # CONFIG_BLK_DEV_HD is not set | 481 | # CONFIG_BLK_DEV_HD is not set |
479 | CONFIG_MISC_DEVICES=y | 482 | CONFIG_MISC_DEVICES=y |
480 | # CONFIG_PHANTOM is not set | 483 | # CONFIG_PHANTOM is not set |
481 | # CONFIG_EEPROM_93CX6 is not set | ||
482 | # CONFIG_SGI_IOC4 is not set | 484 | # CONFIG_SGI_IOC4 is not set |
483 | # CONFIG_TIFM_CORE is not set | 485 | # CONFIG_TIFM_CORE is not set |
484 | # CONFIG_ICS932S401 is not set | 486 | # CONFIG_ICS932S401 is not set |
485 | # CONFIG_ENCLOSURE_SERVICES is not set | 487 | # CONFIG_ENCLOSURE_SERVICES is not set |
486 | # CONFIG_HP_ILO is not set | 488 | # CONFIG_HP_ILO is not set |
487 | # CONFIG_C2PORT is not set | 489 | # CONFIG_C2PORT is not set |
490 | |||
491 | # | ||
492 | # EEPROM support | ||
493 | # | ||
494 | # CONFIG_EEPROM_AT24 is not set | ||
495 | # CONFIG_EEPROM_LEGACY is not set | ||
496 | # CONFIG_EEPROM_93CX6 is not set | ||
488 | CONFIG_HAVE_IDE=y | 497 | CONFIG_HAVE_IDE=y |
489 | CONFIG_IDE=y | 498 | CONFIG_IDE=y |
490 | 499 | ||
@@ -677,6 +686,7 @@ CONFIG_R8169=y | |||
677 | # CONFIG_QLA3XXX is not set | 686 | # CONFIG_QLA3XXX is not set |
678 | # CONFIG_ATL1 is not set | 687 | # CONFIG_ATL1 is not set |
679 | # CONFIG_ATL1E is not set | 688 | # CONFIG_ATL1E is not set |
689 | # CONFIG_ATL1C is not set | ||
680 | # CONFIG_JME is not set | 690 | # CONFIG_JME is not set |
681 | # CONFIG_NETDEV_10000 is not set | 691 | # CONFIG_NETDEV_10000 is not set |
682 | # CONFIG_TR is not set | 692 | # CONFIG_TR is not set |
@@ -818,8 +828,6 @@ CONFIG_I2C_MPC=y | |||
818 | # Miscellaneous I2C Chip support | 828 | # Miscellaneous I2C Chip support |
819 | # | 829 | # |
820 | # CONFIG_DS1682 is not set | 830 | # CONFIG_DS1682 is not set |
821 | # CONFIG_EEPROM_AT24 is not set | ||
822 | # CONFIG_EEPROM_LEGACY is not set | ||
823 | # CONFIG_SENSORS_PCF8574 is not set | 831 | # CONFIG_SENSORS_PCF8574 is not set |
824 | # CONFIG_PCF8575 is not set | 832 | # CONFIG_PCF8575 is not set |
825 | # CONFIG_SENSORS_PCA9539 is not set | 833 | # CONFIG_SENSORS_PCA9539 is not set |
@@ -1159,6 +1167,7 @@ CONFIG_JFFS2_RTIME=y | |||
1159 | # CONFIG_SYSV_FS is not set | 1167 | # CONFIG_SYSV_FS is not set |
1160 | # CONFIG_UFS_FS is not set | 1168 | # CONFIG_UFS_FS is not set |
1161 | # CONFIG_NETWORK_FILESYSTEMS is not set | 1169 | # CONFIG_NETWORK_FILESYSTEMS is not set |
1170 | CONFIG_EXPORTFS=m | ||
1162 | 1171 | ||
1163 | # | 1172 | # |
1164 | # Partition Types | 1173 | # Partition Types |
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h index d811a8cd7b58..4774c2f92232 100644 --- a/arch/powerpc/include/asm/compat.h +++ b/arch/powerpc/include/asm/compat.h | |||
@@ -210,5 +210,10 @@ struct compat_shmid64_ds { | |||
210 | compat_ulong_t __unused6; | 210 | compat_ulong_t __unused6; |
211 | }; | 211 | }; |
212 | 212 | ||
213 | static inline int is_compat_task(void) | ||
214 | { | ||
215 | return test_thread_flag(TIF_32BIT); | ||
216 | } | ||
217 | |||
213 | #endif /* __KERNEL__ */ | 218 | #endif /* __KERNEL__ */ |
214 | #endif /* _ASM_POWERPC_COMPAT_H */ | 219 | #endif /* _ASM_POWERPC_COMPAT_H */ |
diff --git a/arch/powerpc/include/asm/seccomp.h b/arch/powerpc/include/asm/seccomp.h index 853765eb1f65..00c1d9133cfe 100644 --- a/arch/powerpc/include/asm/seccomp.h +++ b/arch/powerpc/include/asm/seccomp.h | |||
@@ -1,10 +1,6 @@ | |||
1 | #ifndef _ASM_POWERPC_SECCOMP_H | 1 | #ifndef _ASM_POWERPC_SECCOMP_H |
2 | #define _ASM_POWERPC_SECCOMP_H | 2 | #define _ASM_POWERPC_SECCOMP_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | #include <linux/thread_info.h> | ||
6 | #endif | ||
7 | |||
8 | #include <linux/unistd.h> | 4 | #include <linux/unistd.h> |
9 | 5 | ||
10 | #define __NR_seccomp_read __NR_read | 6 | #define __NR_seccomp_read __NR_read |
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c index fb371f5ce132..d6b772ba3b8f 100644 --- a/arch/powerpc/platforms/86xx/gef_sbc610.c +++ b/arch/powerpc/platforms/86xx/gef_sbc610.c | |||
@@ -142,6 +142,10 @@ static void __init gef_sbc610_nec_fixup(struct pci_dev *pdev) | |||
142 | { | 142 | { |
143 | unsigned int val; | 143 | unsigned int val; |
144 | 144 | ||
145 | /* Do not do the fixup on other platforms! */ | ||
146 | if (!machine_is(gef_sbc610)) | ||
147 | return; | ||
148 | |||
145 | printk(KERN_INFO "Running NEC uPD720101 Fixup\n"); | 149 | printk(KERN_INFO "Running NEC uPD720101 Fixup\n"); |
146 | 150 | ||
147 | /* Ensure ports 1, 2, 3, 4 & 5 are enabled */ | 151 | /* Ensure ports 1, 2, 3, 4 & 5 are enabled */ |
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c index 2ca7be65c2d2..244f997de791 100644 --- a/arch/powerpc/platforms/embedded6xx/linkstation.c +++ b/arch/powerpc/platforms/embedded6xx/linkstation.c | |||
@@ -12,7 +12,6 @@ | |||
12 | 12 | ||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/initrd.h> | 14 | #include <linux/initrd.h> |
15 | #include <linux/mtd/physmap.h> | ||
16 | #include <linux/of_platform.h> | 15 | #include <linux/of_platform.h> |
17 | 16 | ||
18 | #include <asm/time.h> | 17 | #include <asm/time.h> |
@@ -22,39 +21,6 @@ | |||
22 | 21 | ||
23 | #include "mpc10x.h" | 22 | #include "mpc10x.h" |
24 | 23 | ||
25 | static struct mtd_partition linkstation_physmap_partitions[] = { | ||
26 | { | ||
27 | .name = "mtd_firmimg", | ||
28 | .offset = 0x000000, | ||
29 | .size = 0x300000, | ||
30 | }, | ||
31 | { | ||
32 | .name = "mtd_bootcode", | ||
33 | .offset = 0x300000, | ||
34 | .size = 0x070000, | ||
35 | }, | ||
36 | { | ||
37 | .name = "mtd_status", | ||
38 | .offset = 0x370000, | ||
39 | .size = 0x010000, | ||
40 | }, | ||
41 | { | ||
42 | .name = "mtd_conf", | ||
43 | .offset = 0x380000, | ||
44 | .size = 0x080000, | ||
45 | }, | ||
46 | { | ||
47 | .name = "mtd_allflash", | ||
48 | .offset = 0x000000, | ||
49 | .size = 0x400000, | ||
50 | }, | ||
51 | { | ||
52 | .name = "mtd_data", | ||
53 | .offset = 0x310000, | ||
54 | .size = 0x0f0000, | ||
55 | }, | ||
56 | }; | ||
57 | |||
58 | static __initdata struct of_device_id of_bus_ids[] = { | 24 | static __initdata struct of_device_id of_bus_ids[] = { |
59 | { .type = "soc", }, | 25 | { .type = "soc", }, |
60 | { .compatible = "simple-bus", }, | 26 | { .compatible = "simple-bus", }, |
@@ -99,10 +65,6 @@ static int __init linkstation_add_bridge(struct device_node *dev) | |||
99 | static void __init linkstation_setup_arch(void) | 65 | static void __init linkstation_setup_arch(void) |
100 | { | 66 | { |
101 | struct device_node *np; | 67 | struct device_node *np; |
102 | #ifdef CONFIG_MTD_PHYSMAP | ||
103 | physmap_set_partitions(linkstation_physmap_partitions, | ||
104 | ARRAY_SIZE(linkstation_physmap_partitions)); | ||
105 | #endif | ||
106 | 68 | ||
107 | /* Lookup PCI host bridges */ | 69 | /* Lookup PCI host bridges */ |
108 | for_each_compatible_node(np, "pci", "mpc10x-pci") | 70 | for_each_compatible_node(np, "pci", "mpc10x-pci") |
diff --git a/arch/powerpc/platforms/embedded6xx/storcenter.c b/arch/powerpc/platforms/embedded6xx/storcenter.c index 8864e4884980..613070e9ddbe 100644 --- a/arch/powerpc/platforms/embedded6xx/storcenter.c +++ b/arch/powerpc/platforms/embedded6xx/storcenter.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/pci.h> | 15 | #include <linux/pci.h> |
16 | #include <linux/initrd.h> | 16 | #include <linux/initrd.h> |
17 | #include <linux/mtd/physmap.h> | ||
18 | #include <linux/of_platform.h> | 17 | #include <linux/of_platform.h> |
19 | 18 | ||
20 | #include <asm/system.h> | 19 | #include <asm/system.h> |
@@ -26,32 +25,6 @@ | |||
26 | #include "mpc10x.h" | 25 | #include "mpc10x.h" |
27 | 26 | ||
28 | 27 | ||
29 | #ifdef CONFIG_MTD_PHYSMAP | ||
30 | static struct mtd_partition storcenter_physmap_partitions[] = { | ||
31 | { | ||
32 | .name = "kernel", | ||
33 | .offset = 0x000000, | ||
34 | .size = 0x170000, | ||
35 | }, | ||
36 | { | ||
37 | .name = "rootfs", | ||
38 | .offset = 0x170000, | ||
39 | .size = 0x590000, | ||
40 | }, | ||
41 | { | ||
42 | .name = "uboot", | ||
43 | .offset = 0x700000, | ||
44 | .size = 0x040000, | ||
45 | }, | ||
46 | { | ||
47 | .name = "config", | ||
48 | .offset = 0x740000, | ||
49 | .size = 0x0c0000, | ||
50 | }, | ||
51 | }; | ||
52 | #endif | ||
53 | |||
54 | |||
55 | static __initdata struct of_device_id storcenter_of_bus[] = { | 28 | static __initdata struct of_device_id storcenter_of_bus[] = { |
56 | { .name = "soc", }, | 29 | { .name = "soc", }, |
57 | {}, | 30 | {}, |
@@ -96,11 +69,6 @@ static void __init storcenter_setup_arch(void) | |||
96 | { | 69 | { |
97 | struct device_node *np; | 70 | struct device_node *np; |
98 | 71 | ||
99 | #ifdef CONFIG_MTD_PHYSMAP | ||
100 | physmap_set_partitions(storcenter_physmap_partitions, | ||
101 | ARRAY_SIZE(storcenter_physmap_partitions)); | ||
102 | #endif | ||
103 | |||
104 | /* Lookup PCI host bridges */ | 72 | /* Lookup PCI host bridges */ |
105 | for_each_compatible_node(np, "pci", "mpc10x-pci") | 73 | for_each_compatible_node(np, "pci", "mpc10x-pci") |
106 | storcenter_add_bridge(np); | 74 | storcenter_add_bridge(np); |
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c index c42cd898f68b..6118890c946d 100644 --- a/arch/s390/crypto/aes_s390.c +++ b/arch/s390/crypto/aes_s390.c | |||
@@ -556,7 +556,7 @@ static void __exit aes_s390_fini(void) | |||
556 | module_init(aes_s390_init); | 556 | module_init(aes_s390_init); |
557 | module_exit(aes_s390_fini); | 557 | module_exit(aes_s390_fini); |
558 | 558 | ||
559 | MODULE_ALIAS("aes"); | 559 | MODULE_ALIAS("aes-all"); |
560 | 560 | ||
561 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); | 561 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); |
562 | MODULE_LICENSE("GPL"); | 562 | MODULE_LICENSE("GPL"); |
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h index f260b58f5ce9..0e706257918f 100644 --- a/arch/sparc/include/asm/compat.h +++ b/arch/sparc/include/asm/compat.h | |||
@@ -240,4 +240,9 @@ struct compat_shmid64_ds { | |||
240 | unsigned int __unused2; | 240 | unsigned int __unused2; |
241 | }; | 241 | }; |
242 | 242 | ||
243 | static inline int is_compat_task(void) | ||
244 | { | ||
245 | return test_thread_flag(TIF_32BIT); | ||
246 | } | ||
247 | |||
243 | #endif /* _ASM_SPARC64_COMPAT_H */ | 248 | #endif /* _ASM_SPARC64_COMPAT_H */ |
diff --git a/arch/sparc/include/asm/seccomp.h b/arch/sparc/include/asm/seccomp.h index 7fcd9968192b..adca1bce41d4 100644 --- a/arch/sparc/include/asm/seccomp.h +++ b/arch/sparc/include/asm/seccomp.h | |||
@@ -1,11 +1,5 @@ | |||
1 | #ifndef _ASM_SECCOMP_H | 1 | #ifndef _ASM_SECCOMP_H |
2 | 2 | ||
3 | #include <linux/thread_info.h> /* already defines TIF_32BIT */ | ||
4 | |||
5 | #ifndef TIF_32BIT | ||
6 | #error "unexpected TIF_32BIT on sparc64" | ||
7 | #endif | ||
8 | |||
9 | #include <linux/unistd.h> | 3 | #include <linux/unistd.h> |
10 | 4 | ||
11 | #define __NR_seccomp_read __NR_read | 5 | #define __NR_seccomp_read __NR_read |
diff --git a/arch/x86/include/asm/seccomp_32.h b/arch/x86/include/asm/seccomp_32.h index a6ad87b352c4..b811d6f5780c 100644 --- a/arch/x86/include/asm/seccomp_32.h +++ b/arch/x86/include/asm/seccomp_32.h | |||
@@ -1,12 +1,6 @@ | |||
1 | #ifndef _ASM_X86_SECCOMP_32_H | 1 | #ifndef _ASM_X86_SECCOMP_32_H |
2 | #define _ASM_X86_SECCOMP_32_H | 2 | #define _ASM_X86_SECCOMP_32_H |
3 | 3 | ||
4 | #include <linux/thread_info.h> | ||
5 | |||
6 | #ifdef TIF_32BIT | ||
7 | #error "unexpected TIF_32BIT on i386" | ||
8 | #endif | ||
9 | |||
10 | #include <linux/unistd.h> | 4 | #include <linux/unistd.h> |
11 | 5 | ||
12 | #define __NR_seccomp_read __NR_read | 6 | #define __NR_seccomp_read __NR_read |
diff --git a/arch/x86/include/asm/seccomp_64.h b/arch/x86/include/asm/seccomp_64.h index 4171bb794e9e..84ec1bd161a5 100644 --- a/arch/x86/include/asm/seccomp_64.h +++ b/arch/x86/include/asm/seccomp_64.h | |||
@@ -1,14 +1,6 @@ | |||
1 | #ifndef _ASM_X86_SECCOMP_64_H | 1 | #ifndef _ASM_X86_SECCOMP_64_H |
2 | #define _ASM_X86_SECCOMP_64_H | 2 | #define _ASM_X86_SECCOMP_64_H |
3 | 3 | ||
4 | #include <linux/thread_info.h> | ||
5 | |||
6 | #ifdef TIF_32BIT | ||
7 | #error "unexpected TIF_32BIT on x86_64" | ||
8 | #else | ||
9 | #define TIF_32BIT TIF_IA32 | ||
10 | #endif | ||
11 | |||
12 | #include <linux/unistd.h> | 4 | #include <linux/unistd.h> |
13 | #include <asm/ia32_unistd.h> | 5 | #include <asm/ia32_unistd.h> |
14 | 6 | ||
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 5a4c23d89892..06ca07f6ad86 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -1388,7 +1388,7 @@ void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, | |||
1388 | #ifdef CONFIG_X86_32 | 1388 | #ifdef CONFIG_X86_32 |
1389 | # define IS_IA32 1 | 1389 | # define IS_IA32 1 |
1390 | #elif defined CONFIG_IA32_EMULATION | 1390 | #elif defined CONFIG_IA32_EMULATION |
1391 | # define IS_IA32 test_thread_flag(TIF_IA32) | 1391 | # define IS_IA32 is_compat_task() |
1392 | #else | 1392 | #else |
1393 | # define IS_IA32 0 | 1393 | # define IS_IA32 0 |
1394 | #endif | 1394 | #endif |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index e6d36b490250..b1352250096e 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -714,6 +714,8 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
714 | pos = start_pfn << PAGE_SHIFT; | 714 | pos = start_pfn << PAGE_SHIFT; |
715 | end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT) | 715 | end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT) |
716 | << (PMD_SHIFT - PAGE_SHIFT); | 716 | << (PMD_SHIFT - PAGE_SHIFT); |
717 | if (end_pfn > (end >> PAGE_SHIFT)) | ||
718 | end_pfn = end >> PAGE_SHIFT; | ||
717 | if (start_pfn < end_pfn) { | 719 | if (start_pfn < end_pfn) { |
718 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); | 720 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); |
719 | pos = end_pfn << PAGE_SHIFT; | 721 | pos = end_pfn << PAGE_SHIFT; |
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c index 6c2b1af16926..04102d42ff42 100644 --- a/arch/x86/mm/iomap_32.c +++ b/arch/x86/mm/iomap_32.c | |||
@@ -20,23 +20,16 @@ | |||
20 | #include <asm/pat.h> | 20 | #include <asm/pat.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | 22 | ||
23 | #ifdef CONFIG_X86_PAE | 23 | int is_io_mapping_possible(resource_size_t base, unsigned long size) |
24 | int | ||
25 | is_io_mapping_possible(resource_size_t base, unsigned long size) | ||
26 | { | ||
27 | return 1; | ||
28 | } | ||
29 | #else | ||
30 | int | ||
31 | is_io_mapping_possible(resource_size_t base, unsigned long size) | ||
32 | { | 24 | { |
25 | #ifndef CONFIG_X86_PAE | ||
33 | /* There is no way to map greater than 1 << 32 address without PAE */ | 26 | /* There is no way to map greater than 1 << 32 address without PAE */ |
34 | if (base + size > 0x100000000ULL) | 27 | if (base + size > 0x100000000ULL) |
35 | return 0; | 28 | return 0; |
36 | 29 | #endif | |
37 | return 1; | 30 | return 1; |
38 | } | 31 | } |
39 | #endif | 32 | EXPORT_SYMBOL_GPL(is_io_mapping_possible); |
40 | 33 | ||
41 | /* Map 'pfn' using fixed map 'type' and protections 'prot' | 34 | /* Map 'pfn' using fixed map 'type' and protections 'prot' |
42 | */ | 35 | */ |
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c index 93d82038af4b..9f205030d9aa 100644 --- a/arch/x86/mm/kmmio.c +++ b/arch/x86/mm/kmmio.c | |||
@@ -32,11 +32,14 @@ struct kmmio_fault_page { | |||
32 | struct list_head list; | 32 | struct list_head list; |
33 | struct kmmio_fault_page *release_next; | 33 | struct kmmio_fault_page *release_next; |
34 | unsigned long page; /* location of the fault page */ | 34 | unsigned long page; /* location of the fault page */ |
35 | bool old_presence; /* page presence prior to arming */ | ||
36 | bool armed; | ||
35 | 37 | ||
36 | /* | 38 | /* |
37 | * Number of times this page has been registered as a part | 39 | * Number of times this page has been registered as a part |
38 | * of a probe. If zero, page is disarmed and this may be freed. | 40 | * of a probe. If zero, page is disarmed and this may be freed. |
39 | * Used only by writers (RCU). | 41 | * Used only by writers (RCU) and post_kmmio_handler(). |
42 | * Protected by kmmio_lock, when linked into kmmio_page_table. | ||
40 | */ | 43 | */ |
41 | int count; | 44 | int count; |
42 | }; | 45 | }; |
@@ -105,57 +108,85 @@ static struct kmmio_fault_page *get_kmmio_fault_page(unsigned long page) | |||
105 | return NULL; | 108 | return NULL; |
106 | } | 109 | } |
107 | 110 | ||
108 | static void set_page_present(unsigned long addr, bool present, | 111 | static void set_pmd_presence(pmd_t *pmd, bool present, bool *old) |
109 | unsigned int *pglevel) | 112 | { |
113 | pmdval_t v = pmd_val(*pmd); | ||
114 | *old = !!(v & _PAGE_PRESENT); | ||
115 | v &= ~_PAGE_PRESENT; | ||
116 | if (present) | ||
117 | v |= _PAGE_PRESENT; | ||
118 | set_pmd(pmd, __pmd(v)); | ||
119 | } | ||
120 | |||
121 | static void set_pte_presence(pte_t *pte, bool present, bool *old) | ||
122 | { | ||
123 | pteval_t v = pte_val(*pte); | ||
124 | *old = !!(v & _PAGE_PRESENT); | ||
125 | v &= ~_PAGE_PRESENT; | ||
126 | if (present) | ||
127 | v |= _PAGE_PRESENT; | ||
128 | set_pte_atomic(pte, __pte(v)); | ||
129 | } | ||
130 | |||
131 | static int set_page_presence(unsigned long addr, bool present, bool *old) | ||
110 | { | 132 | { |
111 | pteval_t pteval; | ||
112 | pmdval_t pmdval; | ||
113 | unsigned int level; | 133 | unsigned int level; |
114 | pmd_t *pmd; | ||
115 | pte_t *pte = lookup_address(addr, &level); | 134 | pte_t *pte = lookup_address(addr, &level); |
116 | 135 | ||
117 | if (!pte) { | 136 | if (!pte) { |
118 | pr_err("kmmio: no pte for page 0x%08lx\n", addr); | 137 | pr_err("kmmio: no pte for page 0x%08lx\n", addr); |
119 | return; | 138 | return -1; |
120 | } | 139 | } |
121 | 140 | ||
122 | if (pglevel) | ||
123 | *pglevel = level; | ||
124 | |||
125 | switch (level) { | 141 | switch (level) { |
126 | case PG_LEVEL_2M: | 142 | case PG_LEVEL_2M: |
127 | pmd = (pmd_t *)pte; | 143 | set_pmd_presence((pmd_t *)pte, present, old); |
128 | pmdval = pmd_val(*pmd) & ~_PAGE_PRESENT; | ||
129 | if (present) | ||
130 | pmdval |= _PAGE_PRESENT; | ||
131 | set_pmd(pmd, __pmd(pmdval)); | ||
132 | break; | 144 | break; |
133 | |||
134 | case PG_LEVEL_4K: | 145 | case PG_LEVEL_4K: |
135 | pteval = pte_val(*pte) & ~_PAGE_PRESENT; | 146 | set_pte_presence(pte, present, old); |
136 | if (present) | ||
137 | pteval |= _PAGE_PRESENT; | ||
138 | set_pte_atomic(pte, __pte(pteval)); | ||
139 | break; | 147 | break; |
140 | |||
141 | default: | 148 | default: |
142 | pr_err("kmmio: unexpected page level 0x%x.\n", level); | 149 | pr_err("kmmio: unexpected page level 0x%x.\n", level); |
143 | return; | 150 | return -1; |
144 | } | 151 | } |
145 | 152 | ||
146 | __flush_tlb_one(addr); | 153 | __flush_tlb_one(addr); |
154 | return 0; | ||
147 | } | 155 | } |
148 | 156 | ||
149 | /** Mark the given page as not present. Access to it will trigger a fault. */ | 157 | /* |
150 | static void arm_kmmio_fault_page(unsigned long page, unsigned int *pglevel) | 158 | * Mark the given page as not present. Access to it will trigger a fault. |
159 | * | ||
160 | * Struct kmmio_fault_page is protected by RCU and kmmio_lock, but the | ||
161 | * protection is ignored here. RCU read lock is assumed held, so the struct | ||
162 | * will not disappear unexpectedly. Furthermore, the caller must guarantee, | ||
163 | * that double arming the same virtual address (page) cannot occur. | ||
164 | * | ||
165 | * Double disarming on the other hand is allowed, and may occur when a fault | ||
166 | * and mmiotrace shutdown happen simultaneously. | ||
167 | */ | ||
168 | static int arm_kmmio_fault_page(struct kmmio_fault_page *f) | ||
151 | { | 169 | { |
152 | set_page_present(page & PAGE_MASK, false, pglevel); | 170 | int ret; |
171 | WARN_ONCE(f->armed, KERN_ERR "kmmio page already armed.\n"); | ||
172 | if (f->armed) { | ||
173 | pr_warning("kmmio double-arm: page 0x%08lx, ref %d, old %d\n", | ||
174 | f->page, f->count, f->old_presence); | ||
175 | } | ||
176 | ret = set_page_presence(f->page, false, &f->old_presence); | ||
177 | WARN_ONCE(ret < 0, KERN_ERR "kmmio arming 0x%08lx failed.\n", f->page); | ||
178 | f->armed = true; | ||
179 | return ret; | ||
153 | } | 180 | } |
154 | 181 | ||
155 | /** Mark the given page as present. */ | 182 | /** Restore the given page to saved presence state. */ |
156 | static void disarm_kmmio_fault_page(unsigned long page, unsigned int *pglevel) | 183 | static void disarm_kmmio_fault_page(struct kmmio_fault_page *f) |
157 | { | 184 | { |
158 | set_page_present(page & PAGE_MASK, true, pglevel); | 185 | bool tmp; |
186 | int ret = set_page_presence(f->page, f->old_presence, &tmp); | ||
187 | WARN_ONCE(ret < 0, | ||
188 | KERN_ERR "kmmio disarming 0x%08lx failed.\n", f->page); | ||
189 | f->armed = false; | ||
159 | } | 190 | } |
160 | 191 | ||
161 | /* | 192 | /* |
@@ -202,28 +233,32 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr) | |||
202 | 233 | ||
203 | ctx = &get_cpu_var(kmmio_ctx); | 234 | ctx = &get_cpu_var(kmmio_ctx); |
204 | if (ctx->active) { | 235 | if (ctx->active) { |
205 | disarm_kmmio_fault_page(faultpage->page, NULL); | ||
206 | if (addr == ctx->addr) { | 236 | if (addr == ctx->addr) { |
207 | /* | 237 | /* |
208 | * On SMP we sometimes get recursive probe hits on the | 238 | * A second fault on the same page means some other |
209 | * same address. Context is already saved, fall out. | 239 | * condition needs handling by do_page_fault(), the |
240 | * page really not being present is the most common. | ||
210 | */ | 241 | */ |
211 | pr_debug("kmmio: duplicate probe hit on CPU %d, for " | 242 | pr_debug("kmmio: secondary hit for 0x%08lx CPU %d.\n", |
212 | "address 0x%08lx.\n", | 243 | addr, smp_processor_id()); |
213 | smp_processor_id(), addr); | 244 | |
214 | ret = 1; | 245 | if (!faultpage->old_presence) |
215 | goto no_kmmio_ctx; | 246 | pr_info("kmmio: unexpected secondary hit for " |
216 | } | 247 | "address 0x%08lx on CPU %d.\n", addr, |
217 | /* | 248 | smp_processor_id()); |
218 | * Prevent overwriting already in-flight context. | 249 | } else { |
219 | * This should not happen, let's hope disarming at least | 250 | /* |
220 | * prevents a panic. | 251 | * Prevent overwriting already in-flight context. |
221 | */ | 252 | * This should not happen, let's hope disarming at |
222 | pr_emerg("kmmio: recursive probe hit on CPU %d, " | 253 | * least prevents a panic. |
254 | */ | ||
255 | pr_emerg("kmmio: recursive probe hit on CPU %d, " | ||
223 | "for address 0x%08lx. Ignoring.\n", | 256 | "for address 0x%08lx. Ignoring.\n", |
224 | smp_processor_id(), addr); | 257 | smp_processor_id(), addr); |
225 | pr_emerg("kmmio: previous hit was at 0x%08lx.\n", | 258 | pr_emerg("kmmio: previous hit was at 0x%08lx.\n", |
226 | ctx->addr); | 259 | ctx->addr); |
260 | disarm_kmmio_fault_page(faultpage); | ||
261 | } | ||
227 | goto no_kmmio_ctx; | 262 | goto no_kmmio_ctx; |
228 | } | 263 | } |
229 | ctx->active++; | 264 | ctx->active++; |
@@ -244,7 +279,7 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr) | |||
244 | regs->flags &= ~X86_EFLAGS_IF; | 279 | regs->flags &= ~X86_EFLAGS_IF; |
245 | 280 | ||
246 | /* Now we set present bit in PTE and single step. */ | 281 | /* Now we set present bit in PTE and single step. */ |
247 | disarm_kmmio_fault_page(ctx->fpage->page, NULL); | 282 | disarm_kmmio_fault_page(ctx->fpage); |
248 | 283 | ||
249 | /* | 284 | /* |
250 | * If another cpu accesses the same page while we are stepping, | 285 | * If another cpu accesses the same page while we are stepping, |
@@ -275,7 +310,7 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs) | |||
275 | struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx); | 310 | struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx); |
276 | 311 | ||
277 | if (!ctx->active) { | 312 | if (!ctx->active) { |
278 | pr_debug("kmmio: spurious debug trap on CPU %d.\n", | 313 | pr_warning("kmmio: spurious debug trap on CPU %d.\n", |
279 | smp_processor_id()); | 314 | smp_processor_id()); |
280 | goto out; | 315 | goto out; |
281 | } | 316 | } |
@@ -283,7 +318,11 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs) | |||
283 | if (ctx->probe && ctx->probe->post_handler) | 318 | if (ctx->probe && ctx->probe->post_handler) |
284 | ctx->probe->post_handler(ctx->probe, condition, regs); | 319 | ctx->probe->post_handler(ctx->probe, condition, regs); |
285 | 320 | ||
286 | arm_kmmio_fault_page(ctx->fpage->page, NULL); | 321 | /* Prevent racing against release_kmmio_fault_page(). */ |
322 | spin_lock(&kmmio_lock); | ||
323 | if (ctx->fpage->count) | ||
324 | arm_kmmio_fault_page(ctx->fpage); | ||
325 | spin_unlock(&kmmio_lock); | ||
287 | 326 | ||
288 | regs->flags &= ~X86_EFLAGS_TF; | 327 | regs->flags &= ~X86_EFLAGS_TF; |
289 | regs->flags |= ctx->saved_flags; | 328 | regs->flags |= ctx->saved_flags; |
@@ -315,20 +354,24 @@ static int add_kmmio_fault_page(unsigned long page) | |||
315 | f = get_kmmio_fault_page(page); | 354 | f = get_kmmio_fault_page(page); |
316 | if (f) { | 355 | if (f) { |
317 | if (!f->count) | 356 | if (!f->count) |
318 | arm_kmmio_fault_page(f->page, NULL); | 357 | arm_kmmio_fault_page(f); |
319 | f->count++; | 358 | f->count++; |
320 | return 0; | 359 | return 0; |
321 | } | 360 | } |
322 | 361 | ||
323 | f = kmalloc(sizeof(*f), GFP_ATOMIC); | 362 | f = kzalloc(sizeof(*f), GFP_ATOMIC); |
324 | if (!f) | 363 | if (!f) |
325 | return -1; | 364 | return -1; |
326 | 365 | ||
327 | f->count = 1; | 366 | f->count = 1; |
328 | f->page = page; | 367 | f->page = page; |
329 | list_add_rcu(&f->list, kmmio_page_list(f->page)); | ||
330 | 368 | ||
331 | arm_kmmio_fault_page(f->page, NULL); | 369 | if (arm_kmmio_fault_page(f)) { |
370 | kfree(f); | ||
371 | return -1; | ||
372 | } | ||
373 | |||
374 | list_add_rcu(&f->list, kmmio_page_list(f->page)); | ||
332 | 375 | ||
333 | return 0; | 376 | return 0; |
334 | } | 377 | } |
@@ -347,7 +390,7 @@ static void release_kmmio_fault_page(unsigned long page, | |||
347 | f->count--; | 390 | f->count--; |
348 | BUG_ON(f->count < 0); | 391 | BUG_ON(f->count < 0); |
349 | if (!f->count) { | 392 | if (!f->count) { |
350 | disarm_kmmio_fault_page(f->page, NULL); | 393 | disarm_kmmio_fault_page(f); |
351 | f->release_next = *release_list; | 394 | f->release_next = *release_list; |
352 | *release_list = f; | 395 | *release_list = f; |
353 | } | 396 | } |
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index aebbf67a79d0..e0ab173b6974 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/bootmem.h> | 11 | #include <linux/bootmem.h> |
12 | #include <linux/debugfs.h> | 12 | #include <linux/debugfs.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/module.h> | ||
14 | #include <linux/gfp.h> | 15 | #include <linux/gfp.h> |
15 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
16 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
@@ -868,6 +869,7 @@ pgprot_t pgprot_writecombine(pgprot_t prot) | |||
868 | else | 869 | else |
869 | return pgprot_noncached(prot); | 870 | return pgprot_noncached(prot); |
870 | } | 871 | } |
872 | EXPORT_SYMBOL_GPL(pgprot_writecombine); | ||
871 | 873 | ||
872 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT) | 874 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT) |
873 | 875 | ||
diff --git a/arch/x86/mm/testmmiotrace.c b/arch/x86/mm/testmmiotrace.c index ab50a8d7402c..427fd1b56df5 100644 --- a/arch/x86/mm/testmmiotrace.c +++ b/arch/x86/mm/testmmiotrace.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Written by Pekka Paalanen, 2008 <pq@iki.fi> | 2 | * Written by Pekka Paalanen, 2008-2009 <pq@iki.fi> |
3 | */ | 3 | */ |
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <linux/io.h> | 5 | #include <linux/io.h> |
@@ -9,35 +9,74 @@ | |||
9 | 9 | ||
10 | static unsigned long mmio_address; | 10 | static unsigned long mmio_address; |
11 | module_param(mmio_address, ulong, 0); | 11 | module_param(mmio_address, ulong, 0); |
12 | MODULE_PARM_DESC(mmio_address, "Start address of the mapping of 16 kB."); | 12 | MODULE_PARM_DESC(mmio_address, " Start address of the mapping of 16 kB " |
13 | "(or 8 MB if read_far is non-zero)."); | ||
14 | |||
15 | static unsigned long read_far = 0x400100; | ||
16 | module_param(read_far, ulong, 0); | ||
17 | MODULE_PARM_DESC(read_far, " Offset of a 32-bit read within 8 MB " | ||
18 | "(default: 0x400100)."); | ||
19 | |||
20 | static unsigned v16(unsigned i) | ||
21 | { | ||
22 | return i * 12 + 7; | ||
23 | } | ||
24 | |||
25 | static unsigned v32(unsigned i) | ||
26 | { | ||
27 | return i * 212371 + 13; | ||
28 | } | ||
13 | 29 | ||
14 | static void do_write_test(void __iomem *p) | 30 | static void do_write_test(void __iomem *p) |
15 | { | 31 | { |
16 | unsigned int i; | 32 | unsigned int i; |
33 | pr_info(MODULE_NAME ": write test.\n"); | ||
17 | mmiotrace_printk("Write test.\n"); | 34 | mmiotrace_printk("Write test.\n"); |
35 | |||
18 | for (i = 0; i < 256; i++) | 36 | for (i = 0; i < 256; i++) |
19 | iowrite8(i, p + i); | 37 | iowrite8(i, p + i); |
38 | |||
20 | for (i = 1024; i < (5 * 1024); i += 2) | 39 | for (i = 1024; i < (5 * 1024); i += 2) |
21 | iowrite16(i * 12 + 7, p + i); | 40 | iowrite16(v16(i), p + i); |
41 | |||
22 | for (i = (5 * 1024); i < (16 * 1024); i += 4) | 42 | for (i = (5 * 1024); i < (16 * 1024); i += 4) |
23 | iowrite32(i * 212371 + 13, p + i); | 43 | iowrite32(v32(i), p + i); |
24 | } | 44 | } |
25 | 45 | ||
26 | static void do_read_test(void __iomem *p) | 46 | static void do_read_test(void __iomem *p) |
27 | { | 47 | { |
28 | unsigned int i; | 48 | unsigned int i; |
49 | unsigned errs[3] = { 0 }; | ||
50 | pr_info(MODULE_NAME ": read test.\n"); | ||
29 | mmiotrace_printk("Read test.\n"); | 51 | mmiotrace_printk("Read test.\n"); |
52 | |||
30 | for (i = 0; i < 256; i++) | 53 | for (i = 0; i < 256; i++) |
31 | ioread8(p + i); | 54 | if (ioread8(p + i) != i) |
55 | ++errs[0]; | ||
56 | |||
32 | for (i = 1024; i < (5 * 1024); i += 2) | 57 | for (i = 1024; i < (5 * 1024); i += 2) |
33 | ioread16(p + i); | 58 | if (ioread16(p + i) != v16(i)) |
59 | ++errs[1]; | ||
60 | |||
34 | for (i = (5 * 1024); i < (16 * 1024); i += 4) | 61 | for (i = (5 * 1024); i < (16 * 1024); i += 4) |
35 | ioread32(p + i); | 62 | if (ioread32(p + i) != v32(i)) |
63 | ++errs[2]; | ||
64 | |||
65 | mmiotrace_printk("Read errors: 8-bit %d, 16-bit %d, 32-bit %d.\n", | ||
66 | errs[0], errs[1], errs[2]); | ||
36 | } | 67 | } |
37 | 68 | ||
38 | static void do_test(void) | 69 | static void do_read_far_test(void __iomem *p) |
39 | { | 70 | { |
40 | void __iomem *p = ioremap_nocache(mmio_address, 0x4000); | 71 | pr_info(MODULE_NAME ": read far test.\n"); |
72 | mmiotrace_printk("Read far test.\n"); | ||
73 | |||
74 | ioread32(p + read_far); | ||
75 | } | ||
76 | |||
77 | static void do_test(unsigned long size) | ||
78 | { | ||
79 | void __iomem *p = ioremap_nocache(mmio_address, size); | ||
41 | if (!p) { | 80 | if (!p) { |
42 | pr_err(MODULE_NAME ": could not ioremap, aborting.\n"); | 81 | pr_err(MODULE_NAME ": could not ioremap, aborting.\n"); |
43 | return; | 82 | return; |
@@ -45,11 +84,15 @@ static void do_test(void) | |||
45 | mmiotrace_printk("ioremap returned %p.\n", p); | 84 | mmiotrace_printk("ioremap returned %p.\n", p); |
46 | do_write_test(p); | 85 | do_write_test(p); |
47 | do_read_test(p); | 86 | do_read_test(p); |
87 | if (read_far && read_far < size - 4) | ||
88 | do_read_far_test(p); | ||
48 | iounmap(p); | 89 | iounmap(p); |
49 | } | 90 | } |
50 | 91 | ||
51 | static int __init init(void) | 92 | static int __init init(void) |
52 | { | 93 | { |
94 | unsigned long size = (read_far) ? (8 << 20) : (16 << 10); | ||
95 | |||
53 | if (mmio_address == 0) { | 96 | if (mmio_address == 0) { |
54 | pr_err(MODULE_NAME ": you have to use the module argument " | 97 | pr_err(MODULE_NAME ": you have to use the module argument " |
55 | "mmio_address.\n"); | 98 | "mmio_address.\n"); |
@@ -58,10 +101,11 @@ static int __init init(void) | |||
58 | return -ENXIO; | 101 | return -ENXIO; |
59 | } | 102 | } |
60 | 103 | ||
61 | pr_warning(MODULE_NAME ": WARNING: mapping 16 kB @ 0x%08lx " | 104 | pr_warning(MODULE_NAME ": WARNING: mapping %lu kB @ 0x%08lx in PCI " |
62 | "in PCI address space, and writing " | 105 | "address space, and writing 16 kB of rubbish in there.\n", |
63 | "rubbish in there.\n", mmio_address); | 106 | size >> 10, mmio_address); |
64 | do_test(); | 107 | do_test(size); |
108 | pr_info(MODULE_NAME ": All done.\n"); | ||
65 | return 0; | 109 | return 0; |
66 | } | 110 | } |
67 | 111 | ||
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c index e9f80c744cf3..10131fbdaada 100644 --- a/arch/x86/oprofile/op_model_ppro.c +++ b/arch/x86/oprofile/op_model_ppro.c | |||
@@ -78,8 +78,18 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs) | |||
78 | if (cpu_has_arch_perfmon) { | 78 | if (cpu_has_arch_perfmon) { |
79 | union cpuid10_eax eax; | 79 | union cpuid10_eax eax; |
80 | eax.full = cpuid_eax(0xa); | 80 | eax.full = cpuid_eax(0xa); |
81 | if (counter_width < eax.split.bit_width) | 81 | |
82 | counter_width = eax.split.bit_width; | 82 | /* |
83 | * For Core2 (family 6, model 15), don't reset the | ||
84 | * counter width: | ||
85 | */ | ||
86 | if (!(eax.split.version_id == 0 && | ||
87 | current_cpu_data.x86 == 6 && | ||
88 | current_cpu_data.x86_model == 15)) { | ||
89 | |||
90 | if (counter_width < eax.split.bit_width) | ||
91 | counter_width = eax.split.bit_width; | ||
92 | } | ||
83 | } | 93 | } |
84 | 94 | ||
85 | /* clear all counters */ | 95 | /* clear all counters */ |