diff options
| -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 587da5e0990f..f5f83ee60411 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 d3374bc865ba..c646f34c4e8b 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 | #ifdef __powerpc64__ | 51 | #ifdef __powerpc64__ |
| 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 7f6512733862..be852fd407a8 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 | 136 | bool 'Large physical address support' if E500 |
| 137 | depends on 44x || E500 | 137 | depends on 44x || E500 |
| 138 | select RESOURCES_64BIT | ||
| 139 | default y if 44x | 138 | default y if 44x |
| 140 | ---help--- | 139 | ---help--- |
| 141 | This option enables kernel support for larger than 32-bit physical | 140 | This option enables kernel support for larger than 32-bit physical |
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c index fb368dfde5d4..e8a76d9539db 100644 --- a/arch/powerpc/sysdev/ppc4xx_pci.c +++ b/arch/powerpc/sysdev/ppc4xx_pci.c | |||
| @@ -41,13 +41,10 @@ extern unsigned long total_memory; | |||
| 41 | #define U64_TO_U32_LOW(val) ((u32)((val) & 0x00000000ffffffffULL)) | 41 | #define U64_TO_U32_LOW(val) ((u32)((val) & 0x00000000ffffffffULL)) |
| 42 | #define U64_TO_U32_HIGH(val) ((u32)((val) >> 32)) | 42 | #define U64_TO_U32_HIGH(val) ((u32)((val) >> 32)) |
| 43 | 43 | ||
| 44 | #ifdef CONFIG_RESOURCES_64BIT | 44 | #define RES_TO_U32_LOW(val) \ |
| 45 | #define RES_TO_U32_LOW(val) U64_TO_U32_LOW(val) | 45 | ((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_LOW(val) : (val)) |
| 46 | #define RES_TO_U32_HIGH(val) U64_TO_U32_HIGH(val) | 46 | #define RES_TO_U32_HIGH(val) \ |
| 47 | #else | 47 | ((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_HIGH(val) : (0)) |
| 48 | #define RES_TO_U32_LOW(val) (val) | ||
| 49 | #define RES_TO_U32_HIGH(val) (0) | ||
| 50 | #endif | ||
| 51 | 48 | ||
| 52 | static inline int ppc440spe_revA(void) | 49 | static inline int ppc440spe_revA(void) |
| 53 | { | 50 | { |
| @@ -145,12 +142,11 @@ static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose, | |||
| 145 | 142 | ||
| 146 | /* Use that */ | 143 | /* Use that */ |
| 147 | res->start = pci_addr; | 144 | res->start = pci_addr; |
| 148 | #ifndef CONFIG_RESOURCES_64BIT | ||
| 149 | /* Beware of 32 bits resources */ | 145 | /* Beware of 32 bits resources */ |
| 150 | if ((pci_addr + size) > 0x100000000ull) | 146 | if (sizeof(resource_size_t) == sizeof(u32) && |
| 147 | (pci_addr + size) > 0x100000000ull) | ||
| 151 | res->end = 0xffffffff; | 148 | res->end = 0xffffffff; |
| 152 | else | 149 | else |
| 153 | #endif | ||
| 154 | res->end = res->start + size - 1; | 150 | res->end = res->start + size - 1; |
| 155 | break; | 151 | break; |
| 156 | } | 152 | } |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index f65c2744d573..837a9aae0453 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
| @@ -947,13 +947,15 @@ config X86_PAE | |||
| 947 | def_bool n | 947 | def_bool n |
| 948 | prompt "PAE (Physical Address Extension) Support" | 948 | prompt "PAE (Physical Address Extension) Support" |
| 949 | depends on X86_32 && !HIGHMEM4G | 949 | depends on X86_32 && !HIGHMEM4G |
| 950 | select RESOURCES_64BIT | ||
| 951 | help | 950 | help |
| 952 | PAE is required for NX support, and furthermore enables | 951 | PAE is required for NX support, and furthermore enables |
| 953 | larger swapspace support for non-overcommit purposes. It | 952 | larger swapspace support for non-overcommit purposes. It |
| 954 | has the cost of more pagetable lookup overhead, and also | 953 | has the cost of more pagetable lookup overhead, and also |
| 955 | consumes more pagetable space per process. | 954 | consumes more pagetable space per process. |
| 956 | 955 | ||
| 956 | config ARCH_PHYS_ADDR_T_64BIT | ||
| 957 | def_bool X86_64 || X86_PAE | ||
| 958 | |||
| 957 | # Common NUMA Features | 959 | # Common NUMA Features |
| 958 | config NUMA | 960 | config NUMA |
| 959 | bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)" | 961 | 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 ee9bcc6f32b6..e38b6aa2d40c 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
| @@ -169,6 +169,7 @@ extern struct resource * __devm_request_region(struct device *dev, | |||
| 169 | 169 | ||
| 170 | extern void __devm_release_region(struct device *dev, struct resource *parent, | 170 | extern void __devm_release_region(struct device *dev, struct resource *parent, |
| 171 | resource_size_t start, resource_size_t n); | 171 | resource_size_t start, resource_size_t n); |
| 172 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); | ||
| 172 | 173 | ||
| 173 | #endif /* __ASSEMBLY__ */ | 174 | #endif /* __ASSEMBLY__ */ |
| 174 | #endif /* _LINUX_IOPORT_H */ | 175 | #endif /* _LINUX_IOPORT_H */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 75d81f157d2e..9687491c483f 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -213,6 +213,9 @@ static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | |||
| 213 | { return false; } | 213 | { return false; } |
| 214 | #endif | 214 | #endif |
| 215 | 215 | ||
| 216 | extern int printk_needs_cpu(int cpu); | ||
| 217 | extern void printk_tick(void); | ||
| 218 | |||
| 216 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | 219 | extern void asmlinkage __attribute__((format(printf, 1, 2))) |
| 217 | early_printk(const char *fmt, ...); | 220 | early_printk(const char *fmt, ...); |
| 218 | 221 | ||
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 a430fd04008b..aee891a869a4 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 |
| @@ -982,10 +979,25 @@ int is_console_locked(void) | |||
| 982 | return console_locked; | 979 | return console_locked; |
| 983 | } | 980 | } |
| 984 | 981 | ||
| 985 | void wake_up_klogd(void) | 982 | static DEFINE_PER_CPU(int, printk_pending); |
| 983 | |||
| 984 | void printk_tick(void) | ||
| 986 | { | 985 | { |
| 987 | if (!oops_in_progress && waitqueue_active(&log_wait)) | 986 | if (__get_cpu_var(printk_pending)) { |
| 987 | __get_cpu_var(printk_pending) = 0; | ||
| 988 | wake_up_interruptible(&log_wait); | 988 | wake_up_interruptible(&log_wait); |
| 989 | } | ||
| 990 | } | ||
| 991 | |||
| 992 | int printk_needs_cpu(int cpu) | ||
| 993 | { | ||
| 994 | return per_cpu(printk_pending, cpu); | ||
| 995 | } | ||
| 996 | |||
| 997 | void wake_up_klogd(void) | ||
| 998 | { | ||
| 999 | if (waitqueue_active(&log_wait)) | ||
| 1000 | __raw_get_cpu_var(printk_pending) = 1; | ||
| 989 | } | 1001 | } |
| 990 | 1002 | ||
| 991 | /** | 1003 | /** |
diff --git a/kernel/resource.c b/kernel/resource.c index 414d6fc9131e..7797dae85b50 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 | ||
| @@ -831,3 +827,40 @@ static int __init reserve_setup(char *str) | |||
| 831 | } | 827 | } |
| 832 | 828 | ||
| 833 | __setup("reserve=", reserve_setup); | 829 | __setup("reserve=", reserve_setup); |
| 830 | |||
| 831 | /* | ||
| 832 | * Check if the requested addr and size spans more than any slot in the | ||
| 833 | * iomem resource tree. | ||
| 834 | */ | ||
| 835 | int iomem_map_sanity_check(resource_size_t addr, unsigned long size) | ||
| 836 | { | ||
| 837 | struct resource *p = &iomem_resource; | ||
| 838 | int err = 0; | ||
| 839 | loff_t l; | ||
| 840 | |||
| 841 | read_lock(&resource_lock); | ||
| 842 | for (p = p->child; p ; p = r_next(NULL, p, &l)) { | ||
| 843 | /* | ||
| 844 | * We can probably skip the resources without | ||
| 845 | * IORESOURCE_IO attribute? | ||
| 846 | */ | ||
| 847 | if (p->start >= addr + size) | ||
| 848 | continue; | ||
| 849 | if (p->end < addr) | ||
| 850 | continue; | ||
| 851 | if (p->start <= addr && (p->end >= addr + size - 1)) | ||
| 852 | continue; | ||
| 853 | printk(KERN_WARNING "resource map sanity check conflict: " | ||
| 854 | "0x%llx 0x%llx 0x%llx 0x%llx %s\n", | ||
| 855 | (unsigned long long)addr, | ||
| 856 | (unsigned long long)(addr + size - 1), | ||
| 857 | (unsigned long long)p->start, | ||
| 858 | (unsigned long long)p->end, | ||
| 859 | p->name); | ||
| 860 | err = -1; | ||
| 861 | break; | ||
| 862 | } | ||
| 863 | read_unlock(&resource_lock); | ||
| 864 | |||
| 865 | return err; | ||
| 866 | } | ||
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 0bd9c2dbb2a0..91ee3922510a 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 876bc595d0f8..494ff20b6cfa 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; |
