diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/process.c | 5 | ||||
-rw-r--r-- | arch/arm/kernel/time.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-aaec2000/Makefile.boot | 1 | ||||
-rw-r--r-- | arch/arm/mm/init.c | 71 | ||||
-rw-r--r-- | arch/arm/mm/mm-armv.c | 87 | ||||
-rw-r--r-- | arch/arm/tools/mach-types | 69 | ||||
-rw-r--r-- | arch/i386/kernel/process.c | 29 | ||||
-rw-r--r-- | arch/i386/kernel/syscall_table.S | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/entry.S | 4 | ||||
-rw-r--r-- | arch/mips/kernel/signal.c | 2 | ||||
-rw-r--r-- | arch/ppc/kernel/misc.S | 2 | ||||
-rw-r--r-- | arch/ppc/mm/init.c | 14 | ||||
-rw-r--r-- | arch/ppc/platforms/pmac_sleep.S | 4 | ||||
-rw-r--r-- | arch/ppc/platforms/pmac_time.c | 8 | ||||
-rw-r--r-- | arch/ppc/platforms/sandpoint.c | 1 | ||||
-rw-r--r-- | arch/ppc/syslib/open_pic.c | 26 | ||||
-rw-r--r-- | arch/ppc64/kernel/ppc_ksyms.c | 1 | ||||
-rw-r--r-- | arch/ppc64/kernel/time.c | 1 | ||||
-rw-r--r-- | arch/x86_64/kernel/process.c | 29 |
19 files changed, 255 insertions, 111 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 8f146a4b4752..bbea636ff687 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <asm/leds.h> | 32 | #include <asm/leds.h> |
33 | #include <asm/processor.h> | 33 | #include <asm/processor.h> |
34 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
35 | #include <asm/mach/time.h> | ||
35 | 36 | ||
36 | extern const char *processor_modes[]; | 37 | extern const char *processor_modes[]; |
37 | extern void setup_mm_for_reboot(char mode); | 38 | extern void setup_mm_for_reboot(char mode); |
@@ -85,8 +86,10 @@ EXPORT_SYMBOL(pm_power_off); | |||
85 | void default_idle(void) | 86 | void default_idle(void) |
86 | { | 87 | { |
87 | local_irq_disable(); | 88 | local_irq_disable(); |
88 | if (!need_resched() && !hlt_counter) | 89 | if (!need_resched() && !hlt_counter) { |
90 | timer_dyn_reprogram(); | ||
89 | arch_idle(); | 91 | arch_idle(); |
92 | } | ||
90 | local_irq_enable(); | 93 | local_irq_enable(); |
91 | } | 94 | } |
92 | 95 | ||
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 06054c9ba074..1b7fcd50c3e2 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c | |||
@@ -424,15 +424,19 @@ static int timer_dyn_tick_disable(void) | |||
424 | return ret; | 424 | return ret; |
425 | } | 425 | } |
426 | 426 | ||
427 | /* | ||
428 | * Reprogram the system timer for at least the calculated time interval. | ||
429 | * This function should be called from the idle thread with IRQs disabled, | ||
430 | * immediately before sleeping. | ||
431 | */ | ||
427 | void timer_dyn_reprogram(void) | 432 | void timer_dyn_reprogram(void) |
428 | { | 433 | { |
429 | struct dyn_tick_timer *dyn_tick = system_timer->dyn_tick; | 434 | struct dyn_tick_timer *dyn_tick = system_timer->dyn_tick; |
430 | unsigned long flags; | ||
431 | 435 | ||
432 | write_seqlock_irqsave(&xtime_lock, flags); | 436 | write_seqlock(&xtime_lock); |
433 | if (dyn_tick->state & DYN_TICK_ENABLED) | 437 | if (dyn_tick->state & DYN_TICK_ENABLED) |
434 | dyn_tick->reprogram(next_timer_interrupt() - jiffies); | 438 | dyn_tick->reprogram(next_timer_interrupt() - jiffies); |
435 | write_sequnlock_irqrestore(&xtime_lock, flags); | 439 | write_sequnlock(&xtime_lock); |
436 | } | 440 | } |
437 | 441 | ||
438 | static ssize_t timer_show_dyn_tick(struct sys_device *dev, char *buf) | 442 | static ssize_t timer_show_dyn_tick(struct sys_device *dev, char *buf) |
diff --git a/arch/arm/mach-aaec2000/Makefile.boot b/arch/arm/mach-aaec2000/Makefile.boot new file mode 100644 index 000000000000..8f5a8b7c53c7 --- /dev/null +++ b/arch/arm/mach-aaec2000/Makefile.boot | |||
@@ -0,0 +1 @@ | |||
zreladdr-y := 0xf0008000 | |||
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index c08710b1ff02..6dcb23d64bf5 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -522,6 +522,69 @@ static inline void free_area(unsigned long addr, unsigned long end, char *s) | |||
522 | printk(KERN_INFO "Freeing %s memory: %dK\n", s, size); | 522 | printk(KERN_INFO "Freeing %s memory: %dK\n", s, size); |
523 | } | 523 | } |
524 | 524 | ||
525 | static inline void | ||
526 | free_memmap(int node, unsigned long start_pfn, unsigned long end_pfn) | ||
527 | { | ||
528 | struct page *start_pg, *end_pg; | ||
529 | unsigned long pg, pgend; | ||
530 | |||
531 | /* | ||
532 | * Convert start_pfn/end_pfn to a struct page pointer. | ||
533 | */ | ||
534 | start_pg = pfn_to_page(start_pfn); | ||
535 | end_pg = pfn_to_page(end_pfn); | ||
536 | |||
537 | /* | ||
538 | * Convert to physical addresses, and | ||
539 | * round start upwards and end downwards. | ||
540 | */ | ||
541 | pg = PAGE_ALIGN(__pa(start_pg)); | ||
542 | pgend = __pa(end_pg) & PAGE_MASK; | ||
543 | |||
544 | /* | ||
545 | * If there are free pages between these, | ||
546 | * free the section of the memmap array. | ||
547 | */ | ||
548 | if (pg < pgend) | ||
549 | free_bootmem_node(NODE_DATA(node), pg, pgend - pg); | ||
550 | } | ||
551 | |||
552 | /* | ||
553 | * The mem_map array can get very big. Free the unused area of the memory map. | ||
554 | */ | ||
555 | static void __init free_unused_memmap_node(int node, struct meminfo *mi) | ||
556 | { | ||
557 | unsigned long bank_start, prev_bank_end = 0; | ||
558 | unsigned int i; | ||
559 | |||
560 | /* | ||
561 | * [FIXME] This relies on each bank being in address order. This | ||
562 | * may not be the case, especially if the user has provided the | ||
563 | * information on the command line. | ||
564 | */ | ||
565 | for (i = 0; i < mi->nr_banks; i++) { | ||
566 | if (mi->bank[i].size == 0 || mi->bank[i].node != node) | ||
567 | continue; | ||
568 | |||
569 | bank_start = mi->bank[i].start >> PAGE_SHIFT; | ||
570 | if (bank_start < prev_bank_end) { | ||
571 | printk(KERN_ERR "MEM: unordered memory banks. " | ||
572 | "Not freeing memmap.\n"); | ||
573 | break; | ||
574 | } | ||
575 | |||
576 | /* | ||
577 | * If we had a previous bank, and there is a space | ||
578 | * between the current bank and the previous, free it. | ||
579 | */ | ||
580 | if (prev_bank_end && prev_bank_end != bank_start) | ||
581 | free_memmap(node, prev_bank_end, bank_start); | ||
582 | |||
583 | prev_bank_end = (mi->bank[i].start + | ||
584 | mi->bank[i].size) >> PAGE_SHIFT; | ||
585 | } | ||
586 | } | ||
587 | |||
525 | /* | 588 | /* |
526 | * mem_init() marks the free areas in the mem_map and tells us how much | 589 | * mem_init() marks the free areas in the mem_map and tells us how much |
527 | * memory is free. This is done after various parts of the system have | 590 | * memory is free. This is done after various parts of the system have |
@@ -540,16 +603,12 @@ void __init mem_init(void) | |||
540 | max_mapnr = virt_to_page(high_memory) - mem_map; | 603 | max_mapnr = virt_to_page(high_memory) - mem_map; |
541 | #endif | 604 | #endif |
542 | 605 | ||
543 | /* | ||
544 | * We may have non-contiguous memory. | ||
545 | */ | ||
546 | if (meminfo.nr_banks != 1) | ||
547 | create_memmap_holes(&meminfo); | ||
548 | |||
549 | /* this will put all unused low memory onto the freelists */ | 606 | /* this will put all unused low memory onto the freelists */ |
550 | for_each_online_node(node) { | 607 | for_each_online_node(node) { |
551 | pg_data_t *pgdat = NODE_DATA(node); | 608 | pg_data_t *pgdat = NODE_DATA(node); |
552 | 609 | ||
610 | free_unused_memmap_node(node, &meminfo); | ||
611 | |||
553 | if (pgdat->node_spanned_pages != 0) | 612 | if (pgdat->node_spanned_pages != 0) |
554 | totalram_pages += free_all_bootmem_node(pgdat); | 613 | totalram_pages += free_all_bootmem_node(pgdat); |
555 | } | 614 | } |
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c index 2c2b93d77d43..052ab443ec4e 100644 --- a/arch/arm/mm/mm-armv.c +++ b/arch/arm/mm/mm-armv.c | |||
@@ -169,7 +169,14 @@ pgd_t *get_pgd_slow(struct mm_struct *mm) | |||
169 | 169 | ||
170 | memzero(new_pgd, FIRST_KERNEL_PGD_NR * sizeof(pgd_t)); | 170 | memzero(new_pgd, FIRST_KERNEL_PGD_NR * sizeof(pgd_t)); |
171 | 171 | ||
172 | /* | ||
173 | * Copy over the kernel and IO PGD entries | ||
174 | */ | ||
172 | init_pgd = pgd_offset_k(0); | 175 | init_pgd = pgd_offset_k(0); |
176 | memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR, | ||
177 | (PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t)); | ||
178 | |||
179 | clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t)); | ||
173 | 180 | ||
174 | if (!vectors_high()) { | 181 | if (!vectors_high()) { |
175 | /* | 182 | /* |
@@ -198,14 +205,6 @@ pgd_t *get_pgd_slow(struct mm_struct *mm) | |||
198 | spin_unlock(&mm->page_table_lock); | 205 | spin_unlock(&mm->page_table_lock); |
199 | } | 206 | } |
200 | 207 | ||
201 | /* | ||
202 | * Copy over the kernel and IO PGD entries | ||
203 | */ | ||
204 | memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR, | ||
205 | (PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t)); | ||
206 | |||
207 | clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t)); | ||
208 | |||
209 | return new_pgd; | 208 | return new_pgd; |
210 | 209 | ||
211 | no_pte: | 210 | no_pte: |
@@ -698,75 +697,3 @@ void __init iotable_init(struct map_desc *io_desc, int nr) | |||
698 | for (i = 0; i < nr; i++) | 697 | for (i = 0; i < nr; i++) |
699 | create_mapping(io_desc + i); | 698 | create_mapping(io_desc + i); |
700 | } | 699 | } |
701 | |||
702 | static inline void | ||
703 | free_memmap(int node, unsigned long start_pfn, unsigned long end_pfn) | ||
704 | { | ||
705 | struct page *start_pg, *end_pg; | ||
706 | unsigned long pg, pgend; | ||
707 | |||
708 | /* | ||
709 | * Convert start_pfn/end_pfn to a struct page pointer. | ||
710 | */ | ||
711 | start_pg = pfn_to_page(start_pfn); | ||
712 | end_pg = pfn_to_page(end_pfn); | ||
713 | |||
714 | /* | ||
715 | * Convert to physical addresses, and | ||
716 | * round start upwards and end downwards. | ||
717 | */ | ||
718 | pg = PAGE_ALIGN(__pa(start_pg)); | ||
719 | pgend = __pa(end_pg) & PAGE_MASK; | ||
720 | |||
721 | /* | ||
722 | * If there are free pages between these, | ||
723 | * free the section of the memmap array. | ||
724 | */ | ||
725 | if (pg < pgend) | ||
726 | free_bootmem_node(NODE_DATA(node), pg, pgend - pg); | ||
727 | } | ||
728 | |||
729 | static inline void free_unused_memmap_node(int node, struct meminfo *mi) | ||
730 | { | ||
731 | unsigned long bank_start, prev_bank_end = 0; | ||
732 | unsigned int i; | ||
733 | |||
734 | /* | ||
735 | * [FIXME] This relies on each bank being in address order. This | ||
736 | * may not be the case, especially if the user has provided the | ||
737 | * information on the command line. | ||
738 | */ | ||
739 | for (i = 0; i < mi->nr_banks; i++) { | ||
740 | if (mi->bank[i].size == 0 || mi->bank[i].node != node) | ||
741 | continue; | ||
742 | |||
743 | bank_start = mi->bank[i].start >> PAGE_SHIFT; | ||
744 | if (bank_start < prev_bank_end) { | ||
745 | printk(KERN_ERR "MEM: unordered memory banks. " | ||
746 | "Not freeing memmap.\n"); | ||
747 | break; | ||
748 | } | ||
749 | |||
750 | /* | ||
751 | * If we had a previous bank, and there is a space | ||
752 | * between the current bank and the previous, free it. | ||
753 | */ | ||
754 | if (prev_bank_end && prev_bank_end != bank_start) | ||
755 | free_memmap(node, prev_bank_end, bank_start); | ||
756 | |||
757 | prev_bank_end = PAGE_ALIGN(mi->bank[i].start + | ||
758 | mi->bank[i].size) >> PAGE_SHIFT; | ||
759 | } | ||
760 | } | ||
761 | |||
762 | /* | ||
763 | * The mem_map array can get very big. Free | ||
764 | * the unused area of the memory map. | ||
765 | */ | ||
766 | void __init create_memmap_holes(struct meminfo *mi) | ||
767 | { | ||
768 | int node; | ||
769 | |||
770 | for_each_online_node(node) | ||
771 | free_unused_memmap_node(node, mi); | ||
772 | } | ||
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types index 30c1dfbb052f..6d3a79e5fef8 100644 --- a/arch/arm/tools/mach-types +++ b/arch/arm/tools/mach-types | |||
@@ -6,7 +6,7 @@ | |||
6 | # To add an entry into this database, please see Documentation/arm/README, | 6 | # To add an entry into this database, please see Documentation/arm/README, |
7 | # or contact rmk@arm.linux.org.uk | 7 | # or contact rmk@arm.linux.org.uk |
8 | # | 8 | # |
9 | # Last update: Thu Mar 24 14:34:50 2005 | 9 | # Last update: Thu Jun 23 20:19:33 2005 |
10 | # | 10 | # |
11 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number | 11 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number |
12 | # | 12 | # |
@@ -243,7 +243,7 @@ yoho ARCH_YOHO YOHO 231 | |||
243 | jasper ARCH_JASPER JASPER 232 | 243 | jasper ARCH_JASPER JASPER 232 |
244 | dsc25 ARCH_DSC25 DSC25 233 | 244 | dsc25 ARCH_DSC25 DSC25 233 |
245 | omap_innovator MACH_OMAP_INNOVATOR OMAP_INNOVATOR 234 | 245 | omap_innovator MACH_OMAP_INNOVATOR OMAP_INNOVATOR 234 |
246 | ramses ARCH_RAMSES RAMSES 235 | 246 | mnci ARCH_RAMSES RAMSES 235 |
247 | s28x ARCH_S28X S28X 236 | 247 | s28x ARCH_S28X S28X 236 |
248 | mport3 ARCH_MPORT3 MPORT3 237 | 248 | mport3 ARCH_MPORT3 MPORT3 237 |
249 | pxa_eagle250 ARCH_PXA_EAGLE250 PXA_EAGLE250 238 | 249 | pxa_eagle250 ARCH_PXA_EAGLE250 PXA_EAGLE250 238 |
@@ -323,7 +323,7 @@ nimbra29x ARCH_NIMBRA29X NIMBRA29X 311 | |||
323 | nimbra210 ARCH_NIMBRA210 NIMBRA210 312 | 323 | nimbra210 ARCH_NIMBRA210 NIMBRA210 312 |
324 | hhp_d95xx ARCH_HHP_D95XX HHP_D95XX 313 | 324 | hhp_d95xx ARCH_HHP_D95XX HHP_D95XX 313 |
325 | labarm ARCH_LABARM LABARM 314 | 325 | labarm ARCH_LABARM LABARM 314 |
326 | m825xx ARCH_M825XX M825XX 315 | 326 | comcerto ARCH_M825XX M825XX 315 |
327 | m7100 SA1100_M7100 M7100 316 | 327 | m7100 SA1100_M7100 M7100 316 |
328 | nipc2 ARCH_NIPC2 NIPC2 317 | 328 | nipc2 ARCH_NIPC2 NIPC2 317 |
329 | fu7202 ARCH_FU7202 FU7202 318 | 329 | fu7202 ARCH_FU7202 FU7202 318 |
@@ -724,3 +724,66 @@ lpc22xx MACH_LPC22XX LPC22XX 715 | |||
724 | omap_comet3 MACH_COMET3 COMET3 716 | 724 | omap_comet3 MACH_COMET3 COMET3 716 |
725 | omap_comet4 MACH_COMET4 COMET4 717 | 725 | omap_comet4 MACH_COMET4 COMET4 717 |
726 | csb625 MACH_CSB625 CSB625 718 | 726 | csb625 MACH_CSB625 CSB625 718 |
727 | fortunet2 MACH_FORTUNET2 FORTUNET2 719 | ||
728 | s5h2200 MACH_S5H2200 S5H2200 720 | ||
729 | optorm920 MACH_OPTORM920 OPTORM920 721 | ||
730 | adsbitsyxb MACH_ADSBITSYXB ADSBITSYXB 722 | ||
731 | adssphere MACH_ADSSPHERE ADSSPHERE 723 | ||
732 | adsportal MACH_ADSPORTAL ADSPORTAL 724 | ||
733 | ln2410sbc MACH_LN2410SBC LN2410SBC 725 | ||
734 | cb3rufc MACH_CB3RUFC CB3RUFC 726 | ||
735 | mp2usb MACH_MP2USB MP2USB 727 | ||
736 | ntnp425c MACH_NTNP425C NTNP425C 728 | ||
737 | colibri MACH_COLIBRI COLIBRI 729 | ||
738 | pcm7220 MACH_PCM7220 PCM7220 730 | ||
739 | gateway7001 MACH_GATEWAY7001 GATEWAY7001 731 | ||
740 | pcm027 MACH_PCM027 PCM027 732 | ||
741 | cmpxa MACH_CMPXA CMPXA 733 | ||
742 | anubis MACH_ANUBIS ANUBIS 734 | ||
743 | ite8152 MACH_ITE8152 ITE8152 735 | ||
744 | lpc3xxx MACH_LPC3XXX LPC3XXX 736 | ||
745 | puppeteer MACH_PUPPETEER PUPPETEER 737 | ||
746 | vt001 MACH_MACH_VADATECH MACH_VADATECH 738 | ||
747 | e570 MACH_E570 E570 739 | ||
748 | x50 MACH_X50 X50 740 | ||
749 | recon MACH_RECON RECON 741 | ||
750 | xboardgp8 MACH_XBOARDGP8 XBOARDGP8 742 | ||
751 | fpic2 MACH_FPIC2 FPIC2 743 | ||
752 | akita MACH_AKITA AKITA 744 | ||
753 | a81 MACH_A81 A81 745 | ||
754 | svm_sc25x MACH_SVM_SC25X SVM_SC25X 746 | ||
755 | vt020 MACH_VADATECH020 VADATECH020 747 | ||
756 | tli MACH_TLI TLI 748 | ||
757 | edb9315lc MACH_EDB9315LC EDB9315LC 749 | ||
758 | passec MACH_PASSEC PASSEC 750 | ||
759 | ds_tiger MACH_DS_TIGER DS_TIGER 751 | ||
760 | e310 MACH_E310 E310 752 | ||
761 | e330 MACH_E330 E330 753 | ||
762 | rt3000 MACH_RT3000 RT3000 754 | ||
763 | nokia770 MACH_NOKIA770 NOKIA770 755 | ||
764 | pnx0106 MACH_PNX0106 PNX0106 756 | ||
765 | hx21xx MACH_HX21XX HX21XX 757 | ||
766 | faraday MACH_FARADAY FARADAY 758 | ||
767 | sbc9312 MACH_SBC9312 SBC9312 759 | ||
768 | batman MACH_BATMAN BATMAN 760 | ||
769 | jpd201 MACH_JPD201 JPD201 761 | ||
770 | mipsa MACH_MIPSA MIPSA 762 | ||
771 | kacom MACH_KACOM KACOM 763 | ||
772 | swarcocpu MACH_SWARCOCPU SWARCOCPU 764 | ||
773 | swarcodsl MACH_SWARCODSL SWARCODSL 765 | ||
774 | blueangel MACH_BLUEANGEL BLUEANGEL 766 | ||
775 | hairygrama MACH_HAIRYGRAMA HAIRYGRAMA 767 | ||
776 | banff MACH_BANFF BANFF 768 | ||
777 | carmeva MACH_CARMEVA CARMEVA 769 | ||
778 | sam255 MACH_SAM255 SAM255 770 | ||
779 | ppm10 MACH_PPM10 PPM10 771 | ||
780 | edb9315a MACH_EDB9315A EDB9315A 772 | ||
781 | sunset MACH_SUNSET SUNSET 773 | ||
782 | stargate2 MACH_STARGATE2 STARGATE2 774 | ||
783 | intelmote2 MACH_INTELMOTE2 INTELMOTE2 775 | ||
784 | trizeps4 MACH_TRIZEPS4 TRIZEPS4 776 | ||
785 | mainstone2 MACH_MAINSTONE2 MAINSTONE2 777 | ||
786 | ez_ixp42x MACH_EZ_IXP42X EZ_IXP42X 778 | ||
787 | tapwave_zodiac MACH_TAPWAVE_ZODIAC TAPWAVE_ZODIAC 779 | ||
788 | universalmeter MACH_UNIVERSALMETER UNIVERSALMETER 780 | ||
789 | hicoarm9 MACH_HICOARM9 HICOARM9 781 | ||
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c index 5f8cfa6b7940..ba243a4cc119 100644 --- a/arch/i386/kernel/process.c +++ b/arch/i386/kernel/process.c | |||
@@ -617,6 +617,33 @@ handle_io_bitmap(struct thread_struct *next, struct tss_struct *tss) | |||
617 | } | 617 | } |
618 | 618 | ||
619 | /* | 619 | /* |
620 | * This function selects if the context switch from prev to next | ||
621 | * has to tweak the TSC disable bit in the cr4. | ||
622 | */ | ||
623 | static inline void disable_tsc(struct task_struct *prev_p, | ||
624 | struct task_struct *next_p) | ||
625 | { | ||
626 | struct thread_info *prev, *next; | ||
627 | |||
628 | /* | ||
629 | * gcc should eliminate the ->thread_info dereference if | ||
630 | * has_secure_computing returns 0 at compile time (SECCOMP=n). | ||
631 | */ | ||
632 | prev = prev_p->thread_info; | ||
633 | next = next_p->thread_info; | ||
634 | |||
635 | if (has_secure_computing(prev) || has_secure_computing(next)) { | ||
636 | /* slow path here */ | ||
637 | if (has_secure_computing(prev) && | ||
638 | !has_secure_computing(next)) { | ||
639 | write_cr4(read_cr4() & ~X86_CR4_TSD); | ||
640 | } else if (!has_secure_computing(prev) && | ||
641 | has_secure_computing(next)) | ||
642 | write_cr4(read_cr4() | X86_CR4_TSD); | ||
643 | } | ||
644 | } | ||
645 | |||
646 | /* | ||
620 | * switch_to(x,yn) should switch tasks from x to y. | 647 | * switch_to(x,yn) should switch tasks from x to y. |
621 | * | 648 | * |
622 | * We fsave/fwait so that an exception goes off at the right time | 649 | * We fsave/fwait so that an exception goes off at the right time |
@@ -695,6 +722,8 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas | |||
695 | if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr)) | 722 | if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr)) |
696 | handle_io_bitmap(next, tss); | 723 | handle_io_bitmap(next, tss); |
697 | 724 | ||
725 | disable_tsc(prev_p, next_p); | ||
726 | |||
698 | return prev_p; | 727 | return prev_p; |
699 | } | 728 | } |
700 | 729 | ||
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S index 442a6e937b19..3db9a04aec6e 100644 --- a/arch/i386/kernel/syscall_table.S +++ b/arch/i386/kernel/syscall_table.S | |||
@@ -289,3 +289,5 @@ ENTRY(sys_call_table) | |||
289 | .long sys_add_key | 289 | .long sys_add_key |
290 | .long sys_request_key | 290 | .long sys_request_key |
291 | .long sys_keyctl | 291 | .long sys_keyctl |
292 | .long sys_ioprio_set | ||
293 | .long sys_ioprio_get /* 290 */ | ||
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index b1d5d3d5276c..785a51b0ad8e 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -1577,8 +1577,8 @@ sys_call_table: | |||
1577 | data8 sys_add_key | 1577 | data8 sys_add_key |
1578 | data8 sys_request_key | 1578 | data8 sys_request_key |
1579 | data8 sys_keyctl | 1579 | data8 sys_keyctl |
1580 | data8 sys_ni_syscall | 1580 | data8 sys_ioprio_set |
1581 | data8 sys_ni_syscall // 1275 | 1581 | data8 sys_ioprio_get // 1275 |
1582 | data8 sys_set_zone_reclaim | 1582 | data8 sys_set_zone_reclaim |
1583 | data8 sys_ni_syscall | 1583 | data8 sys_ni_syscall |
1584 | data8 sys_ni_syscall | 1584 | data8 sys_ni_syscall |
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 508026ae5842..65ee15396ffd 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
@@ -457,7 +457,7 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs) | |||
457 | if (!user_mode(regs)) | 457 | if (!user_mode(regs)) |
458 | return 1; | 458 | return 1; |
459 | 459 | ||
460 | if (try_to_freeze(0)) | 460 | if (try_to_freeze()) |
461 | goto no_signal; | 461 | goto no_signal; |
462 | 462 | ||
463 | if (!oldset) | 463 | if (!oldset) |
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S index b6a63a49a232..191a8def3bdb 100644 --- a/arch/ppc/kernel/misc.S +++ b/arch/ppc/kernel/misc.S | |||
@@ -1449,3 +1449,5 @@ _GLOBAL(sys_call_table) | |||
1449 | .long sys_request_key /* 270 */ | 1449 | .long sys_request_key /* 270 */ |
1450 | .long sys_keyctl | 1450 | .long sys_keyctl |
1451 | .long sys_waitid | 1451 | .long sys_waitid |
1452 | .long sys_ioprio_set | ||
1453 | .long sys_ioprio_get | ||
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c index 334ef4150d92..6164a2b34733 100644 --- a/arch/ppc/mm/init.c +++ b/arch/ppc/mm/init.c | |||
@@ -606,9 +606,19 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, | |||
606 | struct page *page = pfn_to_page(pfn); | 606 | struct page *page = pfn_to_page(pfn); |
607 | if (!PageReserved(page) | 607 | if (!PageReserved(page) |
608 | && !test_bit(PG_arch_1, &page->flags)) { | 608 | && !test_bit(PG_arch_1, &page->flags)) { |
609 | if (vma->vm_mm == current->active_mm) | 609 | if (vma->vm_mm == current->active_mm) { |
610 | #ifdef CONFIG_8xx | ||
611 | /* On 8xx, cache control instructions (particularly | ||
612 | * "dcbst" from flush_dcache_icache) fault as write | ||
613 | * operation if there is an unpopulated TLB entry | ||
614 | * for the address in question. To workaround that, | ||
615 | * we invalidate the TLB here, thus avoiding dcbst | ||
616 | * misbehaviour. | ||
617 | */ | ||
618 | _tlbie(address); | ||
619 | #endif | ||
610 | __flush_dcache_icache((void *) address); | 620 | __flush_dcache_icache((void *) address); |
611 | else | 621 | } else |
612 | flush_dcache_icache_page(page); | 622 | flush_dcache_icache_page(page); |
613 | set_bit(PG_arch_1, &page->flags); | 623 | set_bit(PG_arch_1, &page->flags); |
614 | } | 624 | } |
diff --git a/arch/ppc/platforms/pmac_sleep.S b/arch/ppc/platforms/pmac_sleep.S index f459ade1bd63..016a74649155 100644 --- a/arch/ppc/platforms/pmac_sleep.S +++ b/arch/ppc/platforms/pmac_sleep.S | |||
@@ -46,7 +46,7 @@ | |||
46 | .section .text | 46 | .section .text |
47 | .align 5 | 47 | .align 5 |
48 | 48 | ||
49 | #if defined(CONFIG_PMAC_PBOOK) || defined(CONFIG_CPU_FREQ_PMAC) | 49 | #if defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ_PMAC) |
50 | 50 | ||
51 | /* This gets called by via-pmu.c late during the sleep process. | 51 | /* This gets called by via-pmu.c late during the sleep process. |
52 | * The PMU was already send the sleep command and will shut us down | 52 | * The PMU was already send the sleep command and will shut us down |
@@ -382,7 +382,7 @@ turn_on_mmu: | |||
382 | isync | 382 | isync |
383 | rfi | 383 | rfi |
384 | 384 | ||
385 | #endif /* defined(CONFIG_PMAC_PBOOK) || defined(CONFIG_CPU_FREQ) */ | 385 | #endif /* defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ) */ |
386 | 386 | ||
387 | .section .data | 387 | .section .data |
388 | .balign L1_CACHE_LINE_SIZE | 388 | .balign L1_CACHE_LINE_SIZE |
diff --git a/arch/ppc/platforms/pmac_time.c b/arch/ppc/platforms/pmac_time.c index de60ccc7db9f..778ce4fec368 100644 --- a/arch/ppc/platforms/pmac_time.c +++ b/arch/ppc/platforms/pmac_time.c | |||
@@ -206,7 +206,7 @@ via_calibrate_decr(void) | |||
206 | return 1; | 206 | return 1; |
207 | } | 207 | } |
208 | 208 | ||
209 | #ifdef CONFIG_PMAC_PBOOK | 209 | #ifdef CONFIG_PM |
210 | /* | 210 | /* |
211 | * Reset the time after a sleep. | 211 | * Reset the time after a sleep. |
212 | */ | 212 | */ |
@@ -238,7 +238,7 @@ time_sleep_notify(struct pmu_sleep_notifier *self, int when) | |||
238 | static struct pmu_sleep_notifier time_sleep_notifier __pmacdata = { | 238 | static struct pmu_sleep_notifier time_sleep_notifier __pmacdata = { |
239 | time_sleep_notify, SLEEP_LEVEL_MISC, | 239 | time_sleep_notify, SLEEP_LEVEL_MISC, |
240 | }; | 240 | }; |
241 | #endif /* CONFIG_PMAC_PBOOK */ | 241 | #endif /* CONFIG_PM */ |
242 | 242 | ||
243 | /* | 243 | /* |
244 | * Query the OF and get the decr frequency. | 244 | * Query the OF and get the decr frequency. |
@@ -251,9 +251,9 @@ pmac_calibrate_decr(void) | |||
251 | struct device_node *cpu; | 251 | struct device_node *cpu; |
252 | unsigned int freq, *fp; | 252 | unsigned int freq, *fp; |
253 | 253 | ||
254 | #ifdef CONFIG_PMAC_PBOOK | 254 | #ifdef CONFIG_PM |
255 | pmu_register_sleep_notifier(&time_sleep_notifier); | 255 | pmu_register_sleep_notifier(&time_sleep_notifier); |
256 | #endif /* CONFIG_PMAC_PBOOK */ | 256 | #endif /* CONFIG_PM */ |
257 | 257 | ||
258 | /* We assume MacRISC2 machines have correct device-tree | 258 | /* We assume MacRISC2 machines have correct device-tree |
259 | * calibration. That's better since the VIA itself seems | 259 | * calibration. That's better since the VIA itself seems |
diff --git a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c index 70e58f43f2b8..8b149c2fc54f 100644 --- a/arch/ppc/platforms/sandpoint.c +++ b/arch/ppc/platforms/sandpoint.c | |||
@@ -324,6 +324,7 @@ sandpoint_setup_arch(void) | |||
324 | pdata[1].irq = 0; | 324 | pdata[1].irq = 0; |
325 | pdata[1].mapbase = 0; | 325 | pdata[1].mapbase = 0; |
326 | } | 326 | } |
327 | } | ||
327 | 328 | ||
328 | printk(KERN_INFO "Motorola SPS Sandpoint Test Platform\n"); | 329 | printk(KERN_INFO "Motorola SPS Sandpoint Test Platform\n"); |
329 | printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n"); | 330 | printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n"); |
diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c index b45d8268bf93..ad39b86ca92c 100644 --- a/arch/ppc/syslib/open_pic.c +++ b/arch/ppc/syslib/open_pic.c | |||
@@ -370,8 +370,9 @@ void __init openpic_init(int offset) | |||
370 | /* Initialize IPI interrupts */ | 370 | /* Initialize IPI interrupts */ |
371 | if ( ppc_md.progress ) ppc_md.progress("openpic: ipi",0x3bb); | 371 | if ( ppc_md.progress ) ppc_md.progress("openpic: ipi",0x3bb); |
372 | for (i = 0; i < OPENPIC_NUM_IPI; i++) { | 372 | for (i = 0; i < OPENPIC_NUM_IPI; i++) { |
373 | /* Disabled, Priority 10..13 */ | 373 | /* Disabled, increased priorities 10..13 */ |
374 | openpic_initipi(i, 10+i, OPENPIC_VEC_IPI+i+offset); | 374 | openpic_initipi(i, OPENPIC_PRIORITY_IPI_BASE+i, |
375 | OPENPIC_VEC_IPI+i+offset); | ||
375 | /* IPIs are per-CPU */ | 376 | /* IPIs are per-CPU */ |
376 | irq_desc[OPENPIC_VEC_IPI+i+offset].status |= IRQ_PER_CPU; | 377 | irq_desc[OPENPIC_VEC_IPI+i+offset].status |= IRQ_PER_CPU; |
377 | irq_desc[OPENPIC_VEC_IPI+i+offset].handler = &open_pic_ipi; | 378 | irq_desc[OPENPIC_VEC_IPI+i+offset].handler = &open_pic_ipi; |
@@ -399,8 +400,9 @@ void __init openpic_init(int offset) | |||
399 | if (sense & IRQ_SENSE_MASK) | 400 | if (sense & IRQ_SENSE_MASK) |
400 | irq_desc[i+offset].status = IRQ_LEVEL; | 401 | irq_desc[i+offset].status = IRQ_LEVEL; |
401 | 402 | ||
402 | /* Enabled, Priority 8 */ | 403 | /* Enabled, Default priority */ |
403 | openpic_initirq(i, 8, i+offset, (sense & IRQ_POLARITY_MASK), | 404 | openpic_initirq(i, OPENPIC_PRIORITY_DEFAULT, i+offset, |
405 | (sense & IRQ_POLARITY_MASK), | ||
404 | (sense & IRQ_SENSE_MASK)); | 406 | (sense & IRQ_SENSE_MASK)); |
405 | /* Processor 0 */ | 407 | /* Processor 0 */ |
406 | openpic_mapirq(i, CPU_MASK_CPU0, CPU_MASK_NONE); | 408 | openpic_mapirq(i, CPU_MASK_CPU0, CPU_MASK_NONE); |
@@ -656,6 +658,18 @@ static void __init openpic_maptimer(u_int timer, cpumask_t cpumask) | |||
656 | } | 658 | } |
657 | 659 | ||
658 | /* | 660 | /* |
661 | * Change the priority of an interrupt | ||
662 | */ | ||
663 | void __init | ||
664 | openpic_set_irq_priority(u_int irq, u_int pri) | ||
665 | { | ||
666 | check_arg_irq(irq); | ||
667 | openpic_safe_writefield(&ISR[irq - open_pic_irq_offset]->Vector_Priority, | ||
668 | OPENPIC_PRIORITY_MASK, | ||
669 | pri << OPENPIC_PRIORITY_SHIFT); | ||
670 | } | ||
671 | |||
672 | /* | ||
659 | * Initalize the interrupt source which will generate an NMI. | 673 | * Initalize the interrupt source which will generate an NMI. |
660 | * This raises the interrupt's priority from 8 to 9. | 674 | * This raises the interrupt's priority from 8 to 9. |
661 | * | 675 | * |
@@ -665,9 +679,7 @@ void __init | |||
665 | openpic_init_nmi_irq(u_int irq) | 679 | openpic_init_nmi_irq(u_int irq) |
666 | { | 680 | { |
667 | check_arg_irq(irq); | 681 | check_arg_irq(irq); |
668 | openpic_safe_writefield(&ISR[irq - open_pic_irq_offset]->Vector_Priority, | 682 | openpic_set_irq_priority(irq, OPENPIC_PRIORITY_NMI); |
669 | OPENPIC_PRIORITY_MASK, | ||
670 | 9 << OPENPIC_PRIORITY_SHIFT); | ||
671 | } | 683 | } |
672 | 684 | ||
673 | /* | 685 | /* |
diff --git a/arch/ppc64/kernel/ppc_ksyms.c b/arch/ppc64/kernel/ppc_ksyms.c index b230a63fe4c8..705742f4eec6 100644 --- a/arch/ppc64/kernel/ppc_ksyms.c +++ b/arch/ppc64/kernel/ppc_ksyms.c | |||
@@ -75,6 +75,7 @@ EXPORT_SYMBOL(giveup_fpu); | |||
75 | EXPORT_SYMBOL(giveup_altivec); | 75 | EXPORT_SYMBOL(giveup_altivec); |
76 | #endif | 76 | #endif |
77 | EXPORT_SYMBOL(__flush_icache_range); | 77 | EXPORT_SYMBOL(__flush_icache_range); |
78 | EXPORT_SYMBOL(flush_dcache_range); | ||
78 | 79 | ||
79 | #ifdef CONFIG_SMP | 80 | #ifdef CONFIG_SMP |
80 | #ifdef CONFIG_PPC_ISERIES | 81 | #ifdef CONFIG_PPC_ISERIES |
diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c index 2348a75e050d..2a532db9138a 100644 --- a/arch/ppc64/kernel/time.c +++ b/arch/ppc64/kernel/time.c | |||
@@ -91,6 +91,7 @@ unsigned long tb_to_xs; | |||
91 | unsigned tb_to_us; | 91 | unsigned tb_to_us; |
92 | unsigned long processor_freq; | 92 | unsigned long processor_freq; |
93 | DEFINE_SPINLOCK(rtc_lock); | 93 | DEFINE_SPINLOCK(rtc_lock); |
94 | EXPORT_SYMBOL_GPL(rtc_lock); | ||
94 | 95 | ||
95 | unsigned long tb_to_ns_scale; | 96 | unsigned long tb_to_ns_scale; |
96 | unsigned long tb_to_ns_shift; | 97 | unsigned long tb_to_ns_shift; |
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c index 1d91271796e5..7577f9d7a75d 100644 --- a/arch/x86_64/kernel/process.c +++ b/arch/x86_64/kernel/process.c | |||
@@ -482,6 +482,33 @@ out: | |||
482 | } | 482 | } |
483 | 483 | ||
484 | /* | 484 | /* |
485 | * This function selects if the context switch from prev to next | ||
486 | * has to tweak the TSC disable bit in the cr4. | ||
487 | */ | ||
488 | static inline void disable_tsc(struct task_struct *prev_p, | ||
489 | struct task_struct *next_p) | ||
490 | { | ||
491 | struct thread_info *prev, *next; | ||
492 | |||
493 | /* | ||
494 | * gcc should eliminate the ->thread_info dereference if | ||
495 | * has_secure_computing returns 0 at compile time (SECCOMP=n). | ||
496 | */ | ||
497 | prev = prev_p->thread_info; | ||
498 | next = next_p->thread_info; | ||
499 | |||
500 | if (has_secure_computing(prev) || has_secure_computing(next)) { | ||
501 | /* slow path here */ | ||
502 | if (has_secure_computing(prev) && | ||
503 | !has_secure_computing(next)) { | ||
504 | write_cr4(read_cr4() & ~X86_CR4_TSD); | ||
505 | } else if (!has_secure_computing(prev) && | ||
506 | has_secure_computing(next)) | ||
507 | write_cr4(read_cr4() | X86_CR4_TSD); | ||
508 | } | ||
509 | } | ||
510 | |||
511 | /* | ||
485 | * This special macro can be used to load a debugging register | 512 | * This special macro can be used to load a debugging register |
486 | */ | 513 | */ |
487 | #define loaddebug(thread,r) set_debug(thread->debugreg ## r, r) | 514 | #define loaddebug(thread,r) set_debug(thread->debugreg ## r, r) |
@@ -599,6 +626,8 @@ struct task_struct *__switch_to(struct task_struct *prev_p, struct task_struct * | |||
599 | } | 626 | } |
600 | } | 627 | } |
601 | 628 | ||
629 | disable_tsc(prev_p, next_p); | ||
630 | |||
602 | return prev_p; | 631 | return prev_p; |
603 | } | 632 | } |
604 | 633 | ||