diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 18:17:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 18:17:40 -0400 |
commit | e533b227055598b1f7dc8503a3b4f36b14b9da8a (patch) | |
tree | 28fec4125eac45c8e2fac75b3d10ff5cd987d2f6 | |
parent | 0999d978dcdcf59350dafa25afd70def9f924eee (diff) | |
parent | 6b2ada82101a08e2830fb29d7dc9b858be637dd4 (diff) |
Merge branch 'core-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
do_generic_file_read: s/EINTR/EIO/ if lock_page_killable() fails
softirq, warning fix: correct a format to avoid a warning
softirqs, debug: preemption check
x86, pci-hotplug, calgary / rio: fix EBDA ioremap()
IO resources, x86: ioremap sanity check to catch mapping requests exceeding, fix
IO resources, x86: ioremap sanity check to catch mapping requests exceeding the BAR sizes
softlockup: Documentation/sysctl/kernel.txt: fix softlockup_thresh description
dmi scan: warn about too early calls to dmi_check_system()
generic: redefine resource_size_t as phys_addr_t
generic: make PFN_PHYS explicitly return phys_addr_t
generic: add phys_addr_t for holding physical addresses
softirq: allocate less vectors
IO resources: fix/remove printk
printk: robustify printk, update comment
printk: robustify printk, fix #2
printk: robustify printk, fix
printk: robustify printk
Fixed up conflicts in:
arch/powerpc/include/asm/types.h
arch/powerpc/platforms/Kconfig.cputype
manually.
-rw-r--r-- | arch/m32r/mm/discontig.c | 4 | ||||
-rw-r--r-- | arch/powerpc/Kconfig | 3 | ||||
-rw-r--r-- | arch/powerpc/include/asm/types.h | 7 | ||||
-rw-r--r-- | arch/powerpc/platforms/Kconfig.cputype | 1 | ||||
-rw-r--r-- | arch/powerpc/sysdev/ppc4xx_pci.c | 16 | ||||
-rw-r--r-- | arch/x86/Kconfig | 4 | ||||
-rw-r--r-- | arch/x86/kernel/e820.c | 4 | ||||
-rw-r--r-- | arch/x86/mm/ioremap.c | 6 | ||||
-rw-r--r-- | drivers/firmware/dmi_scan.c | 22 | ||||
-rw-r--r-- | drivers/pci/hotplug/ibmphp_ebda.c | 2 | ||||
-rw-r--r-- | drivers/pci/setup-bus.c | 9 | ||||
-rw-r--r-- | include/asm-x86/page_32.h | 2 | ||||
-rw-r--r-- | include/asm-x86/page_64.h | 1 | ||||
-rw-r--r-- | include/asm-x86/xen/page.h | 4 | ||||
-rw-r--r-- | include/linux/interrupt.h | 2 | ||||
-rw-r--r-- | include/linux/ioport.h | 1 | ||||
-rw-r--r-- | include/linux/kernel.h | 3 | ||||
-rw-r--r-- | include/linux/pfn.h | 6 | ||||
-rw-r--r-- | include/linux/types.h | 8 | ||||
-rw-r--r-- | kernel/printk.c | 22 | ||||
-rw-r--r-- | kernel/resource.c | 51 | ||||
-rw-r--r-- | kernel/softirq.c | 13 | ||||
-rw-r--r-- | kernel/time/tick-sched.c | 2 | ||||
-rw-r--r-- | kernel/timer.c | 1 | ||||
-rw-r--r-- | mm/Kconfig | 3 | ||||
-rw-r--r-- | mm/filemap.c | 15 |
26 files changed, 144 insertions, 68 deletions
diff --git a/arch/m32r/mm/discontig.c b/arch/m32r/mm/discontig.c index cbc3c4c54566..7daf897292cf 100644 --- a/arch/m32r/mm/discontig.c +++ b/arch/m32r/mm/discontig.c | |||
@@ -111,9 +111,9 @@ unsigned long __init setup_memory(void) | |||
111 | initrd_start, INITRD_SIZE); | 111 | initrd_start, INITRD_SIZE); |
112 | } else { | 112 | } else { |
113 | printk("initrd extends beyond end of memory " | 113 | printk("initrd extends beyond end of memory " |
114 | "(0x%08lx > 0x%08lx)\ndisabling initrd\n", | 114 | "(0x%08lx > 0x%08llx)\ndisabling initrd\n", |
115 | INITRD_START + INITRD_SIZE, | 115 | INITRD_START + INITRD_SIZE, |
116 | PFN_PHYS(max_low_pfn)); | 116 | (unsigned long long)PFN_PHYS(max_low_pfn)); |
117 | 117 | ||
118 | initrd_start = 0; | 118 | initrd_start = 0; |
119 | } | 119 | } |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index c171f5bcf258..380baa1780e9 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -22,6 +22,9 @@ config WORD_SIZE | |||
22 | config PPC_MERGE | 22 | config PPC_MERGE |
23 | def_bool y | 23 | def_bool y |
24 | 24 | ||
25 | config ARCH_PHYS_ADDR_T_64BIT | ||
26 | def_bool PPC64 || PHYS_64BIT | ||
27 | |||
25 | config MMU | 28 | config MMU |
26 | bool | 29 | bool |
27 | default y | 30 | default y |
diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h index a9a9262e84a3..c004c13f291e 100644 --- a/arch/powerpc/include/asm/types.h +++ b/arch/powerpc/include/asm/types.h | |||
@@ -48,13 +48,6 @@ typedef struct { | |||
48 | 48 | ||
49 | typedef __vector128 vector128; | 49 | typedef __vector128 vector128; |
50 | 50 | ||
51 | /* Physical address used by some IO functions */ | ||
52 | #if defined(CONFIG_PPC64) || defined(CONFIG_PHYS_64BIT) | ||
53 | typedef u64 phys_addr_t; | ||
54 | #else | ||
55 | typedef u32 phys_addr_t; | ||
56 | #endif | ||
57 | |||
58 | #if defined(__powerpc64__) || defined(CONFIG_PHYS_64BIT) | 51 | #if defined(__powerpc64__) || defined(CONFIG_PHYS_64BIT) |
59 | typedef u64 dma_addr_t; | 52 | typedef u64 dma_addr_t; |
60 | #else | 53 | #else |
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 439c5ba34ecf..548efa55c8fe 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype | |||
@@ -135,7 +135,6 @@ config PTE_64BIT | |||
135 | config PHYS_64BIT | 135 | config PHYS_64BIT |
136 | bool 'Large physical address support' if E500 || PPC_86xx | 136 | bool 'Large physical address support' if E500 || PPC_86xx |
137 | depends on (44x || E500 || PPC_86xx) && !PPC_83xx && !PPC_82xx | 137 | depends on (44x || E500 || PPC_86xx) && !PPC_83xx && !PPC_82xx |
138 | select RESOURCES_64BIT | ||
139 | ---help--- | 138 | ---help--- |
140 | This option enables kernel support for larger than 32-bit physical | 139 | This option enables kernel support for larger than 32-bit physical |
141 | addresses. This feature may not be available on all cores. | 140 | addresses. This feature may not be available on all cores. |
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c index 9f6f73d584d6..d3e4d61030b5 100644 --- a/arch/powerpc/sysdev/ppc4xx_pci.c +++ b/arch/powerpc/sysdev/ppc4xx_pci.c | |||
@@ -39,13 +39,10 @@ static int dma_offset_set; | |||
39 | #define U64_TO_U32_LOW(val) ((u32)((val) & 0x00000000ffffffffULL)) | 39 | #define U64_TO_U32_LOW(val) ((u32)((val) & 0x00000000ffffffffULL)) |
40 | #define U64_TO_U32_HIGH(val) ((u32)((val) >> 32)) | 40 | #define U64_TO_U32_HIGH(val) ((u32)((val) >> 32)) |
41 | 41 | ||
42 | #ifdef CONFIG_RESOURCES_64BIT | 42 | #define RES_TO_U32_LOW(val) \ |
43 | #define RES_TO_U32_LOW(val) U64_TO_U32_LOW(val) | 43 | ((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_LOW(val) : (val)) |
44 | #define RES_TO_U32_HIGH(val) U64_TO_U32_HIGH(val) | 44 | #define RES_TO_U32_HIGH(val) \ |
45 | #else | 45 | ((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_HIGH(val) : (0)) |
46 | #define RES_TO_U32_LOW(val) (val) | ||
47 | #define RES_TO_U32_HIGH(val) (0) | ||
48 | #endif | ||
49 | 46 | ||
50 | static inline int ppc440spe_revA(void) | 47 | static inline int ppc440spe_revA(void) |
51 | { | 48 | { |
@@ -144,12 +141,11 @@ static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose, | |||
144 | 141 | ||
145 | /* Use that */ | 142 | /* Use that */ |
146 | res->start = pci_addr; | 143 | res->start = pci_addr; |
147 | #ifndef CONFIG_RESOURCES_64BIT | ||
148 | /* Beware of 32 bits resources */ | 144 | /* Beware of 32 bits resources */ |
149 | if ((pci_addr + size) > 0x100000000ull) | 145 | if (sizeof(resource_size_t) == sizeof(u32) && |
146 | (pci_addr + size) > 0x100000000ull) | ||
150 | res->end = 0xffffffff; | 147 | res->end = 0xffffffff; |
151 | else | 148 | else |
152 | #endif | ||
153 | res->end = res->start + size - 1; | 149 | res->end = res->start + size - 1; |
154 | break; | 150 | break; |
155 | } | 151 | } |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 7ccb6e60e60c..bd3c2c53873e 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -935,13 +935,15 @@ config HIGHMEM | |||
935 | config X86_PAE | 935 | config X86_PAE |
936 | bool "PAE (Physical Address Extension) Support" | 936 | bool "PAE (Physical Address Extension) Support" |
937 | depends on X86_32 && !HIGHMEM4G | 937 | depends on X86_32 && !HIGHMEM4G |
938 | select RESOURCES_64BIT | ||
939 | help | 938 | help |
940 | PAE is required for NX support, and furthermore enables | 939 | PAE is required for NX support, and furthermore enables |
941 | larger swapspace support for non-overcommit purposes. It | 940 | larger swapspace support for non-overcommit purposes. It |
942 | has the cost of more pagetable lookup overhead, and also | 941 | has the cost of more pagetable lookup overhead, and also |
943 | consumes more pagetable space per process. | 942 | consumes more pagetable space per process. |
944 | 943 | ||
944 | config ARCH_PHYS_ADDR_T_64BIT | ||
945 | def_bool X86_64 || X86_PAE | ||
946 | |||
945 | # Common NUMA Features | 947 | # Common NUMA Features |
946 | config NUMA | 948 | config NUMA |
947 | bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)" | 949 | bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)" |
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 78e642feac30..ce97bf3bed12 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -1282,12 +1282,10 @@ void __init e820_reserve_resources(void) | |||
1282 | e820_res = res; | 1282 | e820_res = res; |
1283 | for (i = 0; i < e820.nr_map; i++) { | 1283 | for (i = 0; i < e820.nr_map; i++) { |
1284 | end = e820.map[i].addr + e820.map[i].size - 1; | 1284 | end = e820.map[i].addr + e820.map[i].size - 1; |
1285 | #ifndef CONFIG_RESOURCES_64BIT | 1285 | if (end != (resource_size_t)end) { |
1286 | if (end > 0x100000000ULL) { | ||
1287 | res++; | 1286 | res++; |
1288 | continue; | 1287 | continue; |
1289 | } | 1288 | } |
1290 | #endif | ||
1291 | res->name = e820_type_to_string(e820.map[i].type); | 1289 | res->name = e820_type_to_string(e820.map[i].type); |
1292 | res->start = e820.map[i].addr; | 1290 | res->start = e820.map[i].addr; |
1293 | res->end = end; | 1291 | res->end = end; |
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index e4c43ec71b29..ae71e11eb3e5 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -220,6 +220,12 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, | |||
220 | return (__force void __iomem *)phys_to_virt(phys_addr); | 220 | return (__force void __iomem *)phys_to_virt(phys_addr); |
221 | 221 | ||
222 | /* | 222 | /* |
223 | * Check if the request spans more than any BAR in the iomem resource | ||
224 | * tree. | ||
225 | */ | ||
226 | WARN_ON(iomem_map_sanity_check(phys_addr, size)); | ||
227 | |||
228 | /* | ||
223 | * Don't allow anybody to remap normal RAM that we're using.. | 229 | * Don't allow anybody to remap normal RAM that we're using.. |
224 | */ | 230 | */ |
225 | for (pfn = phys_addr >> PAGE_SHIFT; | 231 | for (pfn = phys_addr >> PAGE_SHIFT; |
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 455575be3560..3e526b6d00cb 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c | |||
@@ -15,6 +15,11 @@ | |||
15 | */ | 15 | */ |
16 | static char dmi_empty_string[] = " "; | 16 | static char dmi_empty_string[] = " "; |
17 | 17 | ||
18 | /* | ||
19 | * Catch too early calls to dmi_check_system(): | ||
20 | */ | ||
21 | static int dmi_initialized; | ||
22 | |||
18 | static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s) | 23 | static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s) |
19 | { | 24 | { |
20 | const u8 *bp = ((u8 *) dm) + dm->length; | 25 | const u8 *bp = ((u8 *) dm) + dm->length; |
@@ -366,7 +371,7 @@ void __init dmi_scan_machine(void) | |||
366 | 371 | ||
367 | if (efi_enabled) { | 372 | if (efi_enabled) { |
368 | if (efi.smbios == EFI_INVALID_TABLE_ADDR) | 373 | if (efi.smbios == EFI_INVALID_TABLE_ADDR) |
369 | goto out; | 374 | goto error; |
370 | 375 | ||
371 | /* This is called as a core_initcall() because it isn't | 376 | /* This is called as a core_initcall() because it isn't |
372 | * needed during early boot. This also means we can | 377 | * needed during early boot. This also means we can |
@@ -374,13 +379,13 @@ void __init dmi_scan_machine(void) | |||
374 | */ | 379 | */ |
375 | p = dmi_ioremap(efi.smbios, 32); | 380 | p = dmi_ioremap(efi.smbios, 32); |
376 | if (p == NULL) | 381 | if (p == NULL) |
377 | goto out; | 382 | goto error; |
378 | 383 | ||
379 | rc = dmi_present(p + 0x10); /* offset of _DMI_ string */ | 384 | rc = dmi_present(p + 0x10); /* offset of _DMI_ string */ |
380 | dmi_iounmap(p, 32); | 385 | dmi_iounmap(p, 32); |
381 | if (!rc) { | 386 | if (!rc) { |
382 | dmi_available = 1; | 387 | dmi_available = 1; |
383 | return; | 388 | goto out; |
384 | } | 389 | } |
385 | } | 390 | } |
386 | else { | 391 | else { |
@@ -391,19 +396,22 @@ void __init dmi_scan_machine(void) | |||
391 | */ | 396 | */ |
392 | p = dmi_ioremap(0xF0000, 0x10000); | 397 | p = dmi_ioremap(0xF0000, 0x10000); |
393 | if (p == NULL) | 398 | if (p == NULL) |
394 | goto out; | 399 | goto error; |
395 | 400 | ||
396 | for (q = p; q < p + 0x10000; q += 16) { | 401 | for (q = p; q < p + 0x10000; q += 16) { |
397 | rc = dmi_present(q); | 402 | rc = dmi_present(q); |
398 | if (!rc) { | 403 | if (!rc) { |
399 | dmi_available = 1; | 404 | dmi_available = 1; |
400 | dmi_iounmap(p, 0x10000); | 405 | dmi_iounmap(p, 0x10000); |
401 | return; | 406 | goto out; |
402 | } | 407 | } |
403 | } | 408 | } |
404 | dmi_iounmap(p, 0x10000); | 409 | dmi_iounmap(p, 0x10000); |
405 | } | 410 | } |
406 | out: printk(KERN_INFO "DMI not present or invalid.\n"); | 411 | error: |
412 | printk(KERN_INFO "DMI not present or invalid.\n"); | ||
413 | out: | ||
414 | dmi_initialized = 1; | ||
407 | } | 415 | } |
408 | 416 | ||
409 | /** | 417 | /** |
@@ -424,6 +432,8 @@ int dmi_check_system(const struct dmi_system_id *list) | |||
424 | int i, count = 0; | 432 | int i, count = 0; |
425 | const struct dmi_system_id *d = list; | 433 | const struct dmi_system_id *d = list; |
426 | 434 | ||
435 | WARN(!dmi_initialized, KERN_ERR "dmi check: not initialized yet.\n"); | ||
436 | |||
427 | while (d->ident) { | 437 | while (d->ident) { |
428 | for (i = 0; i < ARRAY_SIZE(d->matches); i++) { | 438 | for (i = 0; i < ARRAY_SIZE(d->matches); i++) { |
429 | int s = d->matches[i].slot; | 439 | int s = d->matches[i].slot; |
diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c index 8467d0287325..7d27631e6e62 100644 --- a/drivers/pci/hotplug/ibmphp_ebda.c +++ b/drivers/pci/hotplug/ibmphp_ebda.c | |||
@@ -276,7 +276,7 @@ int __init ibmphp_access_ebda (void) | |||
276 | iounmap (io_mem); | 276 | iounmap (io_mem); |
277 | debug ("returned ebda segment: %x\n", ebda_seg); | 277 | debug ("returned ebda segment: %x\n", ebda_seg); |
278 | 278 | ||
279 | io_mem = ioremap (ebda_seg<<4, 65000); | 279 | io_mem = ioremap(ebda_seg<<4, 1024); |
280 | if (!io_mem ) | 280 | if (!io_mem ) |
281 | return -ENOMEM; | 281 | return -ENOMEM; |
282 | next_offset = 0x180; | 282 | next_offset = 0x180; |
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 3abbfad9ddab..d5e2106760f8 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -378,11 +378,10 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long | |||
378 | align = 0; | 378 | align = 0; |
379 | min_align = 0; | 379 | min_align = 0; |
380 | for (order = 0; order <= max_order; order++) { | 380 | for (order = 0; order <= max_order; order++) { |
381 | #ifdef CONFIG_RESOURCES_64BIT | 381 | resource_size_t align1 = 1; |
382 | resource_size_t align1 = 1ULL << (order + 20); | 382 | |
383 | #else | 383 | align1 <<= (order + 20); |
384 | resource_size_t align1 = 1U << (order + 20); | 384 | |
385 | #endif | ||
386 | if (!align) | 385 | if (!align) |
387 | min_align = align1; | 386 | min_align = align1; |
388 | else if (ALIGN(align + min_align, min_align) < align1) | 387 | else if (ALIGN(align + min_align, min_align) < align1) |
diff --git a/include/asm-x86/page_32.h b/include/asm-x86/page_32.h index e8d80d1de237..bdf5dba4cfb0 100644 --- a/include/asm-x86/page_32.h +++ b/include/asm-x86/page_32.h | |||
@@ -39,7 +39,6 @@ typedef u64 pmdval_t; | |||
39 | typedef u64 pudval_t; | 39 | typedef u64 pudval_t; |
40 | typedef u64 pgdval_t; | 40 | typedef u64 pgdval_t; |
41 | typedef u64 pgprotval_t; | 41 | typedef u64 pgprotval_t; |
42 | typedef u64 phys_addr_t; | ||
43 | 42 | ||
44 | typedef union { | 43 | typedef union { |
45 | struct { | 44 | struct { |
@@ -60,7 +59,6 @@ typedef unsigned long pmdval_t; | |||
60 | typedef unsigned long pudval_t; | 59 | typedef unsigned long pudval_t; |
61 | typedef unsigned long pgdval_t; | 60 | typedef unsigned long pgdval_t; |
62 | typedef unsigned long pgprotval_t; | 61 | typedef unsigned long pgprotval_t; |
63 | typedef unsigned long phys_addr_t; | ||
64 | 62 | ||
65 | typedef union { | 63 | typedef union { |
66 | pteval_t pte; | 64 | pteval_t pte; |
diff --git a/include/asm-x86/page_64.h b/include/asm-x86/page_64.h index 5e64acfed0a4..49380b8c7e25 100644 --- a/include/asm-x86/page_64.h +++ b/include/asm-x86/page_64.h | |||
@@ -79,7 +79,6 @@ typedef unsigned long pmdval_t; | |||
79 | typedef unsigned long pudval_t; | 79 | typedef unsigned long pudval_t; |
80 | typedef unsigned long pgdval_t; | 80 | typedef unsigned long pgdval_t; |
81 | typedef unsigned long pgprotval_t; | 81 | typedef unsigned long pgprotval_t; |
82 | typedef unsigned long phys_addr_t; | ||
83 | 82 | ||
84 | typedef struct page *pgtable_t; | 83 | typedef struct page *pgtable_t; |
85 | 84 | ||
diff --git a/include/asm-x86/xen/page.h b/include/asm-x86/xen/page.h index c50185dccec1..d5eada0a48d9 100644 --- a/include/asm-x86/xen/page.h +++ b/include/asm-x86/xen/page.h | |||
@@ -76,13 +76,13 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn) | |||
76 | static inline xmaddr_t phys_to_machine(xpaddr_t phys) | 76 | static inline xmaddr_t phys_to_machine(xpaddr_t phys) |
77 | { | 77 | { |
78 | unsigned offset = phys.paddr & ~PAGE_MASK; | 78 | unsigned offset = phys.paddr & ~PAGE_MASK; |
79 | return XMADDR(PFN_PHYS((u64)pfn_to_mfn(PFN_DOWN(phys.paddr))) | offset); | 79 | return XMADDR(PFN_PHYS(pfn_to_mfn(PFN_DOWN(phys.paddr))) | offset); |
80 | } | 80 | } |
81 | 81 | ||
82 | static inline xpaddr_t machine_to_phys(xmaddr_t machine) | 82 | static inline xpaddr_t machine_to_phys(xmaddr_t machine) |
83 | { | 83 | { |
84 | unsigned offset = machine.maddr & ~PAGE_MASK; | 84 | unsigned offset = machine.maddr & ~PAGE_MASK; |
85 | return XPADDR(PFN_PHYS((u64)mfn_to_pfn(PFN_DOWN(machine.maddr))) | offset); | 85 | return XPADDR(PFN_PHYS(mfn_to_pfn(PFN_DOWN(machine.maddr))) | offset); |
86 | } | 86 | } |
87 | 87 | ||
88 | /* | 88 | /* |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 58ff4e74b2f3..54b3623434ec 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -252,6 +252,8 @@ enum | |||
252 | HRTIMER_SOFTIRQ, | 252 | HRTIMER_SOFTIRQ, |
253 | #endif | 253 | #endif |
254 | RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */ | 254 | RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */ |
255 | |||
256 | NR_SOFTIRQS | ||
255 | }; | 257 | }; |
256 | 258 | ||
257 | /* softirq mask and active fields moved to irq_cpustat_t in | 259 | /* softirq mask and active fields moved to irq_cpustat_t in |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 0dde77272d7a..041e95aac2bf 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -174,6 +174,7 @@ extern struct resource * __devm_request_region(struct device *dev, | |||
174 | 174 | ||
175 | extern void __devm_release_region(struct device *dev, struct resource *parent, | 175 | extern void __devm_release_region(struct device *dev, struct resource *parent, |
176 | resource_size_t start, resource_size_t n); | 176 | resource_size_t start, resource_size_t n); |
177 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); | ||
177 | 178 | ||
178 | #endif /* __ASSEMBLY__ */ | 179 | #endif /* __ASSEMBLY__ */ |
179 | #endif /* _LINUX_IOPORT_H */ | 180 | #endif /* _LINUX_IOPORT_H */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 1f3cd8ad0523..6803318fa2ea 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -214,6 +214,9 @@ static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | |||
214 | { return false; } | 214 | { return false; } |
215 | #endif | 215 | #endif |
216 | 216 | ||
217 | extern int printk_needs_cpu(int cpu); | ||
218 | extern void printk_tick(void); | ||
219 | |||
217 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | 220 | extern void asmlinkage __attribute__((format(printf, 1, 2))) |
218 | early_printk(const char *fmt, ...); | 221 | early_printk(const char *fmt, ...); |
219 | 222 | ||
diff --git a/include/linux/pfn.h b/include/linux/pfn.h index bb01f8b92b56..7646637221f3 100644 --- a/include/linux/pfn.h +++ b/include/linux/pfn.h | |||
@@ -1,9 +1,13 @@ | |||
1 | #ifndef _LINUX_PFN_H_ | 1 | #ifndef _LINUX_PFN_H_ |
2 | #define _LINUX_PFN_H_ | 2 | #define _LINUX_PFN_H_ |
3 | 3 | ||
4 | #ifndef __ASSEMBLY__ | ||
5 | #include <linux/types.h> | ||
6 | #endif | ||
7 | |||
4 | #define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) | 8 | #define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) |
5 | #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) | 9 | #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) |
6 | #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) | 10 | #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) |
7 | #define PFN_PHYS(x) ((x) << PAGE_SHIFT) | 11 | #define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT) |
8 | 12 | ||
9 | #endif | 13 | #endif |
diff --git a/include/linux/types.h b/include/linux/types.h index d4a9ce6e2760..f24f7beb47df 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -191,12 +191,14 @@ typedef __u32 __bitwise __wsum; | |||
191 | #ifdef __KERNEL__ | 191 | #ifdef __KERNEL__ |
192 | typedef unsigned __bitwise__ gfp_t; | 192 | typedef unsigned __bitwise__ gfp_t; |
193 | 193 | ||
194 | #ifdef CONFIG_RESOURCES_64BIT | 194 | #ifdef CONFIG_PHYS_ADDR_T_64BIT |
195 | typedef u64 resource_size_t; | 195 | typedef u64 phys_addr_t; |
196 | #else | 196 | #else |
197 | typedef u32 resource_size_t; | 197 | typedef u32 phys_addr_t; |
198 | #endif | 198 | #endif |
199 | 199 | ||
200 | typedef phys_addr_t resource_size_t; | ||
201 | |||
200 | struct ustat { | 202 | struct ustat { |
201 | __kernel_daddr_t f_tfree; | 203 | __kernel_daddr_t f_tfree; |
202 | __kernel_ino_t f_tinode; | 204 | __kernel_ino_t f_tinode; |
diff --git a/kernel/printk.c b/kernel/printk.c index fbd94bdaa74f..6341af77eb65 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -577,9 +577,6 @@ static int have_callable_console(void) | |||
577 | * @fmt: format string | 577 | * @fmt: format string |
578 | * | 578 | * |
579 | * This is printk(). It can be called from any context. We want it to work. | 579 | * This is printk(). It can be called from any context. We want it to work. |
580 | * Be aware of the fact that if oops_in_progress is not set, we might try to | ||
581 | * wake klogd up which could deadlock on runqueue lock if printk() is called | ||
582 | * from scheduler code. | ||
583 | * | 580 | * |
584 | * We try to grab the console_sem. If we succeed, it's easy - we log the output and | 581 | * We try to grab the console_sem. If we succeed, it's easy - we log the output and |
585 | * call the console drivers. If we fail to get the semaphore we place the output | 582 | * call the console drivers. If we fail to get the semaphore we place the output |
@@ -984,10 +981,25 @@ int is_console_locked(void) | |||
984 | return console_locked; | 981 | return console_locked; |
985 | } | 982 | } |
986 | 983 | ||
987 | void wake_up_klogd(void) | 984 | static DEFINE_PER_CPU(int, printk_pending); |
985 | |||
986 | void printk_tick(void) | ||
988 | { | 987 | { |
989 | if (!oops_in_progress && waitqueue_active(&log_wait)) | 988 | if (__get_cpu_var(printk_pending)) { |
989 | __get_cpu_var(printk_pending) = 0; | ||
990 | wake_up_interruptible(&log_wait); | 990 | wake_up_interruptible(&log_wait); |
991 | } | ||
992 | } | ||
993 | |||
994 | int printk_needs_cpu(int cpu) | ||
995 | { | ||
996 | return per_cpu(printk_pending, cpu); | ||
997 | } | ||
998 | |||
999 | void wake_up_klogd(void) | ||
1000 | { | ||
1001 | if (waitqueue_active(&log_wait)) | ||
1002 | __raw_get_cpu_var(printk_pending) = 1; | ||
991 | } | 1003 | } |
992 | 1004 | ||
993 | /** | 1005 | /** |
diff --git a/kernel/resource.c b/kernel/resource.c index f193d6e3ded2..4089d12af6e0 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -38,10 +38,6 @@ EXPORT_SYMBOL(iomem_resource); | |||
38 | 38 | ||
39 | static DEFINE_RWLOCK(resource_lock); | 39 | static DEFINE_RWLOCK(resource_lock); |
40 | 40 | ||
41 | #ifdef CONFIG_PROC_FS | ||
42 | |||
43 | enum { MAX_IORES_LEVEL = 5 }; | ||
44 | |||
45 | static void *r_next(struct seq_file *m, void *v, loff_t *pos) | 41 | static void *r_next(struct seq_file *m, void *v, loff_t *pos) |
46 | { | 42 | { |
47 | struct resource *p = v; | 43 | struct resource *p = v; |
@@ -53,6 +49,10 @@ static void *r_next(struct seq_file *m, void *v, loff_t *pos) | |||
53 | return p->sibling; | 49 | return p->sibling; |
54 | } | 50 | } |
55 | 51 | ||
52 | #ifdef CONFIG_PROC_FS | ||
53 | |||
54 | enum { MAX_IORES_LEVEL = 5 }; | ||
55 | |||
56 | static void *r_start(struct seq_file *m, loff_t *pos) | 56 | static void *r_start(struct seq_file *m, loff_t *pos) |
57 | __acquires(resource_lock) | 57 | __acquires(resource_lock) |
58 | { | 58 | { |
@@ -549,13 +549,9 @@ static void __init __reserve_region_with_split(struct resource *root, | |||
549 | } | 549 | } |
550 | 550 | ||
551 | if (!res) { | 551 | if (!res) { |
552 | printk(KERN_DEBUG " __reserve_region_with_split: (%s) [%llx, %llx], res: (%s) [%llx, %llx]\n", | ||
553 | conflict->name, conflict->start, conflict->end, | ||
554 | name, start, end); | ||
555 | |||
556 | /* failed, split and try again */ | 552 | /* failed, split and try again */ |
557 | 553 | ||
558 | /* conflict coverred whole area */ | 554 | /* conflict covered whole area */ |
559 | if (conflict->start <= start && conflict->end >= end) | 555 | if (conflict->start <= start && conflict->end >= end) |
560 | return; | 556 | return; |
561 | 557 | ||
@@ -832,3 +828,40 @@ static int __init reserve_setup(char *str) | |||
832 | } | 828 | } |
833 | 829 | ||
834 | __setup("reserve=", reserve_setup); | 830 | __setup("reserve=", reserve_setup); |
831 | |||
832 | /* | ||
833 | * Check if the requested addr and size spans more than any slot in the | ||
834 | * iomem resource tree. | ||
835 | */ | ||
836 | int iomem_map_sanity_check(resource_size_t addr, unsigned long size) | ||
837 | { | ||
838 | struct resource *p = &iomem_resource; | ||
839 | int err = 0; | ||
840 | loff_t l; | ||
841 | |||
842 | read_lock(&resource_lock); | ||
843 | for (p = p->child; p ; p = r_next(NULL, p, &l)) { | ||
844 | /* | ||
845 | * We can probably skip the resources without | ||
846 | * IORESOURCE_IO attribute? | ||
847 | */ | ||
848 | if (p->start >= addr + size) | ||
849 | continue; | ||
850 | if (p->end < addr) | ||
851 | continue; | ||
852 | if (p->start <= addr && (p->end >= addr + size - 1)) | ||
853 | continue; | ||
854 | printk(KERN_WARNING "resource map sanity check conflict: " | ||
855 | "0x%llx 0x%llx 0x%llx 0x%llx %s\n", | ||
856 | (unsigned long long)addr, | ||
857 | (unsigned long long)(addr + size - 1), | ||
858 | (unsigned long long)p->start, | ||
859 | (unsigned long long)p->end, | ||
860 | p->name); | ||
861 | err = -1; | ||
862 | break; | ||
863 | } | ||
864 | read_unlock(&resource_lock); | ||
865 | |||
866 | return err; | ||
867 | } | ||
diff --git a/kernel/softirq.c b/kernel/softirq.c index c506f266a6b9..be7a8292f992 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -46,7 +46,7 @@ irq_cpustat_t irq_stat[NR_CPUS] ____cacheline_aligned; | |||
46 | EXPORT_SYMBOL(irq_stat); | 46 | EXPORT_SYMBOL(irq_stat); |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | static struct softirq_action softirq_vec[32] __cacheline_aligned_in_smp; | 49 | static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp; |
50 | 50 | ||
51 | static DEFINE_PER_CPU(struct task_struct *, ksoftirqd); | 51 | static DEFINE_PER_CPU(struct task_struct *, ksoftirqd); |
52 | 52 | ||
@@ -205,7 +205,18 @@ restart: | |||
205 | 205 | ||
206 | do { | 206 | do { |
207 | if (pending & 1) { | 207 | if (pending & 1) { |
208 | int prev_count = preempt_count(); | ||
209 | |||
208 | h->action(h); | 210 | h->action(h); |
211 | |||
212 | if (unlikely(prev_count != preempt_count())) { | ||
213 | printk(KERN_ERR "huh, entered softirq %d %p" | ||
214 | "with preempt_count %08x," | ||
215 | " exited with %08x?\n", h - softirq_vec, | ||
216 | h->action, prev_count, preempt_count()); | ||
217 | preempt_count() = prev_count; | ||
218 | } | ||
219 | |||
209 | rcu_bh_qsctr_inc(cpu); | 220 | rcu_bh_qsctr_inc(cpu); |
210 | } | 221 | } |
211 | h++; | 222 | h++; |
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index a4d219398167..b711ffcb106c 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -270,7 +270,7 @@ void tick_nohz_stop_sched_tick(int inidle) | |||
270 | next_jiffies = get_next_timer_interrupt(last_jiffies); | 270 | next_jiffies = get_next_timer_interrupt(last_jiffies); |
271 | delta_jiffies = next_jiffies - last_jiffies; | 271 | delta_jiffies = next_jiffies - last_jiffies; |
272 | 272 | ||
273 | if (rcu_needs_cpu(cpu)) | 273 | if (rcu_needs_cpu(cpu) || printk_needs_cpu(cpu)) |
274 | delta_jiffies = 1; | 274 | delta_jiffies = 1; |
275 | /* | 275 | /* |
276 | * Do not stop the tick, if we are only one off | 276 | * Do not stop the tick, if we are only one off |
diff --git a/kernel/timer.c b/kernel/timer.c index 03bc7f1f1593..510fe69351ca 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -978,6 +978,7 @@ void update_process_times(int user_tick) | |||
978 | run_local_timers(); | 978 | run_local_timers(); |
979 | if (rcu_pending(cpu)) | 979 | if (rcu_pending(cpu)) |
980 | rcu_check_callbacks(cpu, user_tick); | 980 | rcu_check_callbacks(cpu, user_tick); |
981 | printk_tick(); | ||
981 | scheduler_tick(); | 982 | scheduler_tick(); |
982 | run_posix_cpu_timers(p); | 983 | run_posix_cpu_timers(p); |
983 | } | 984 | } |
diff --git a/mm/Kconfig b/mm/Kconfig index 5585f1293593..1a501a4de95c 100644 --- a/mm/Kconfig +++ b/mm/Kconfig | |||
@@ -187,6 +187,9 @@ config RESOURCES_64BIT | |||
187 | help | 187 | help |
188 | This option allows memory and IO resources to be 64 bit. | 188 | This option allows memory and IO resources to be 64 bit. |
189 | 189 | ||
190 | config PHYS_ADDR_T_64BIT | ||
191 | def_bool 64BIT || ARCH_PHYS_ADDR_T_64BIT | ||
192 | |||
190 | config ZONE_DMA_FLAG | 193 | config ZONE_DMA_FLAG |
191 | int | 194 | int |
192 | default "0" if !ZONE_DMA | 195 | default "0" if !ZONE_DMA |
diff --git a/mm/filemap.c b/mm/filemap.c index bf8f9c0c7a83..903bf316912a 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -1100,8 +1100,9 @@ page_ok: | |||
1100 | 1100 | ||
1101 | page_not_up_to_date: | 1101 | page_not_up_to_date: |
1102 | /* Get exclusive access to the page ... */ | 1102 | /* Get exclusive access to the page ... */ |
1103 | if (lock_page_killable(page)) | 1103 | error = lock_page_killable(page); |
1104 | goto readpage_eio; | 1104 | if (unlikely(error)) |
1105 | goto readpage_error; | ||
1105 | 1106 | ||
1106 | page_not_up_to_date_locked: | 1107 | page_not_up_to_date_locked: |
1107 | /* Did it get truncated before we got the lock? */ | 1108 | /* Did it get truncated before we got the lock? */ |
@@ -1130,8 +1131,9 @@ readpage: | |||
1130 | } | 1131 | } |
1131 | 1132 | ||
1132 | if (!PageUptodate(page)) { | 1133 | if (!PageUptodate(page)) { |
1133 | if (lock_page_killable(page)) | 1134 | error = lock_page_killable(page); |
1134 | goto readpage_eio; | 1135 | if (unlikely(error)) |
1136 | goto readpage_error; | ||
1135 | if (!PageUptodate(page)) { | 1137 | if (!PageUptodate(page)) { |
1136 | if (page->mapping == NULL) { | 1138 | if (page->mapping == NULL) { |
1137 | /* | 1139 | /* |
@@ -1143,15 +1145,14 @@ readpage: | |||
1143 | } | 1145 | } |
1144 | unlock_page(page); | 1146 | unlock_page(page); |
1145 | shrink_readahead_size_eio(filp, ra); | 1147 | shrink_readahead_size_eio(filp, ra); |
1146 | goto readpage_eio; | 1148 | error = -EIO; |
1149 | goto readpage_error; | ||
1147 | } | 1150 | } |
1148 | unlock_page(page); | 1151 | unlock_page(page); |
1149 | } | 1152 | } |
1150 | 1153 | ||
1151 | goto page_ok; | 1154 | goto page_ok; |
1152 | 1155 | ||
1153 | readpage_eio: | ||
1154 | error = -EIO; | ||
1155 | readpage_error: | 1156 | readpage_error: |
1156 | /* UHHUH! A synchronous read error occurred. Report it */ | 1157 | /* UHHUH! A synchronous read error occurred. Report it */ |
1157 | desc->error = error; | 1158 | desc->error = error; |