···365365366366 Please note that dynamic tick may affect the accuracy of367367 timekeeping on some platforms depending on the implementation.368368- Currently at least OMAP platform is known to have accurate369369- timekeeping with dynamic tick.368368+ Currently at least OMAP, PXA2xx and SA11x0 platforms are known369369+ to have accurate timekeeping with dynamic tick.370370371371config ARCH_DISCONTIGMEM_ENABLE372372 bool
···265265 str r5, [sp, #4] @ push sixth arg266266 b sys_futex267267268268+sys_arm_fadvise64_64_wrapper:269269+ str r5, [sp, #4] @ push r5 to stack270270+ b sys_arm_fadvise64_64271271+268272/*269273 * Note: off_4k (r5) is always units of 4K. If we can't do the requested270274 * offset, we return EINVAL.
+10
arch/arm/kernel/sys_arm.c
···311311 return ret;312312}313313EXPORT_SYMBOL(execve);314314+315315+/*316316+ * Since loff_t is a 64 bit type we avoid a lot of ABI hastle317317+ * with a different argument ordering.318318+ */319319+asmlinkage long sys_arm_fadvise64_64(int fd, int advice,320320+ loff_t offset, loff_t len)321321+{322322+ return sys_fadvise64_64(fd, offset, len, advice);323323+}
+55-3
arch/arm/mach-pxa/time.c
···7070 return usec;7171}72727373+#ifdef CONFIG_NO_IDLE_HZ7474+static unsigned long initial_match;7575+static int match_posponed;7676+#endif7777+7378static irqreturn_t7479pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)7580{···82778378 write_seqlock(&xtime_lock);84798080+#ifdef CONFIG_NO_IDLE_HZ8181+ if (match_posponed) {8282+ match_posponed = 0;8383+ OSMR0 = initial_match;8484+ }8585+#endif8686+8587 /* Loop until we get ahead of the free running timer.8688 * This ensures an exact clock tick count and time accuracy.8787- * IRQs are disabled inside the loop to ensure coherence between8888- * lost_ticks (updated in do_timer()) and the match reg value, so we8989- * can use do_gettimeofday() from interrupt handlers.8989+ * Since IRQs are disabled at this point, coherence between9090+ * lost_ticks(updated in do_timer()) and the match reg value is9191+ * ensured, hence we can use do_gettimeofday() from interrupt9292+ * handlers.9093 *9194 * HACK ALERT: it seems that the PXA timer regs aren't updated right9295 * away in all cases when a write occurs. We therefore compare with···139126 OSCR = 0; /* initialize free-running timer, force first match */140127}141128129129+#ifdef CONFIG_NO_IDLE_HZ130130+static int pxa_dyn_tick_enable_disable(void)131131+{132132+ /* nothing to do */133133+ return 0;134134+}135135+136136+static void pxa_dyn_tick_reprogram(unsigned long ticks)137137+{138138+ if (ticks > 1) {139139+ initial_match = OSMR0;140140+ OSMR0 = initial_match + ticks * LATCH;141141+ match_posponed = 1;142142+ }143143+}144144+145145+static irqreturn_t146146+pxa_dyn_tick_handler(int irq, void *dev_id, struct pt_regs *regs)147147+{148148+ if (match_posponed) {149149+ match_posponed = 0;150150+ OSMR0 = initial_match;151151+ if ( (signed long)(initial_match - OSCR) <= 8 )152152+ return pxa_timer_interrupt(irq, dev_id, regs);153153+ }154154+ return IRQ_NONE;155155+}156156+157157+static struct dyn_tick_timer pxa_dyn_tick = {158158+ .enable = pxa_dyn_tick_enable_disable,159159+ .disable = pxa_dyn_tick_enable_disable,160160+ .reprogram = pxa_dyn_tick_reprogram,161161+ .handler = pxa_dyn_tick_handler,162162+};163163+#endif164164+142165#ifdef CONFIG_PM143166static unsigned long osmr[4], oier;144167···210161 .suspend = pxa_timer_suspend,211162 .resume = pxa_timer_resume,212163 .offset = pxa_gettimeoffset,164164+#ifdef CONFIG_NO_IDLE_HZ165165+ .dyn_tick = &pxa_dyn_tick,166166+#endif213167};
+59-9
arch/arm/mach-sa1100/time.c
···7070 return usec;7171}72727373-/*7474- * We will be entered with IRQs enabled.7575- *7676- * Loop until we get ahead of the free running timer.7777- * This ensures an exact clock tick count and time accuracy.7878- * IRQs are disabled inside the loop to ensure coherence between7979- * lost_ticks (updated in do_timer()) and the match reg value, so we8080- * can use do_gettimeofday() from interrupt handlers.8181- */7373+#ifdef CONFIG_NO_IDLE_HZ7474+static unsigned long initial_match;7575+static int match_posponed;7676+#endif7777+8278static irqreturn_t8379sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)8480{···82868387 write_seqlock(&xtime_lock);84888989+#ifdef CONFIG_NO_IDLE_HZ9090+ if (match_posponed) {9191+ match_posponed = 0;9292+ OSMR0 = initial_match;9393+ }9494+#endif9595+9696+ /*9797+ * Loop until we get ahead of the free running timer.9898+ * This ensures an exact clock tick count and time accuracy.9999+ * Since IRQs are disabled at this point, coherence between100100+ * lost_ticks(updated in do_timer()) and the match reg value is101101+ * ensured, hence we can use do_gettimeofday() from interrupt102102+ * handlers.103103+ */85104 do {86105 timer_tick(regs);87106 OSSR = OSSR_M0; /* Clear match on timer 0 */···130119 OIER |= OIER_E0; /* enable match on timer 0 to cause interrupts */131120 OSCR = 0; /* initialize free-running timer, force first match */132121}122122+123123+#ifdef CONFIG_NO_IDLE_HZ124124+static int sa1100_dyn_tick_enable_disable(void)125125+{126126+ /* nothing to do */127127+ return 0;128128+}129129+130130+static void sa1100_dyn_tick_reprogram(unsigned long ticks)131131+{132132+ if (ticks > 1) {133133+ initial_match = OSMR0;134134+ OSMR0 = initial_match + ticks * LATCH;135135+ match_posponed = 1;136136+ }137137+}138138+139139+static irqreturn_t140140+sa1100_dyn_tick_handler(int irq, void *dev_id, struct pt_regs *regs)141141+{142142+ if (match_posponed) {143143+ match_posponed = 0;144144+ OSMR0 = initial_match;145145+ if ((signed long)(initial_match - OSCR) <= 0)146146+ return sa1100_timer_interrupt(irq, dev_id, regs);147147+ }148148+ return IRQ_NONE;149149+}150150+151151+static struct dyn_tick_timer sa1100_dyn_tick = {152152+ .enable = sa1100_dyn_tick_enable_disable,153153+ .disable = sa1100_dyn_tick_enable_disable,154154+ .reprogram = sa1100_dyn_tick_reprogram,155155+ .handler = sa1100_dyn_tick_handler,156156+};157157+#endif133158134159#ifdef CONFIG_PM135160unsigned long osmr[4], oier;···203156 .suspend = sa1100_timer_suspend,204157 .resume = sa1100_timer_resume,205158 .offset = sa1100_gettimeoffset,159159+#ifdef CONFIG_NO_IDLE_HZ160160+ .dyn_tick = &sa1100_dyn_tick,161161+#endif206162};
+11-15
arch/arm/mm/mm-armv.c
···295295 pte_t *ptep;296296297297 if (pmd_none(*pmdp)) {298298- unsigned long pmdval;299298 ptep = alloc_bootmem_low_pages(2 * PTRS_PER_PTE *300299 sizeof(pte_t));301300302302- pmdval = __pa(ptep) | prot_l1;303303- pmdp[0] = __pmd(pmdval);304304- pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));305305- flush_pmd_entry(pmdp);301301+ __pmd_populate(pmdp, __pa(ptep) | prot_l1);306302 }307303 ptep = pte_offset_kernel(pmdp, virt);308304···453457454458 for (i = 0; i < 16; i++) {455459 unsigned long v = pgprot_val(protection_map[i]);456456- v &= (~(PTE_BUFFERABLE|PTE_CACHEABLE)) | user_pgprot;460460+ v = (v & ~(PTE_BUFFERABLE|PTE_CACHEABLE)) | user_pgprot;457461 protection_map[i] = __pgprot(v);458462 }459463···577581 */578582void setup_mm_for_reboot(char mode)579583{580580- unsigned long pmdval;584584+ unsigned long base_pmdval;581585 pgd_t *pgd;582582- pmd_t *pmd;583586 int i;584584- int cpu_arch = cpu_architecture();585587586588 if (current->mm && current->mm->pgd)587589 pgd = current->mm->pgd;588590 else589591 pgd = init_mm.pgd;590592591591- for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++) {592592- pmdval = (i << PGDIR_SHIFT) |593593- PMD_SECT_AP_WRITE | PMD_SECT_AP_READ |594594- PMD_TYPE_SECT;595595- if (cpu_arch <= CPU_ARCH_ARMv5TEJ)596596- pmdval |= PMD_BIT4;593593+ base_pmdval = PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT;594594+ if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ)595595+ base_pmdval |= PMD_BIT4;596596+597597+ for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++, pgd++) {598598+ unsigned long pmdval = (i << PGDIR_SHIFT) | base_pmdval;599599+ pmd_t *pmd;600600+597601 pmd = pmd_off(pgd, i << PGDIR_SHIFT);598602 pmd[0] = __pmd(pmdval);599603 pmd[1] = __pmd(pmdval + (1 << (PGDIR_SHIFT - 1)));