History

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon: "This addresses a couple of issues found with RT, a broken initrd message in the console log and a simple performance fix for some MMC workloads. Summary: - A couple of locking fixes for RT kernels - Avoid printing bogus initrd warnings when initrd isn't present - Performance fix for random mmap file readahead - Typo fix" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: replace read_lock to rcu lock in call_break_hook arm64: Don't relocate non-existent initrd arm64: convert patch_lock to raw lock arm64: readahead: fault retry breaks mmap file read random detection arm64: debug: Fix typo in debug-monitors.c

Linus Torvalds committed 11 years ago

Commit c6fa8e62 parents e82fa92 62c6c614 files · +18 −14Browse files

Unified · Split

4 files
  1. arch/arm64/kernel/debug-monitors.c +12 −11
  2. arch/arm64/kernel/insn.c +3 −3
  3. arch/arm64/kernel/setup.c +2 −0
  4. arch/arm64/mm/fault.c +1 −0
arch/arm64/kernel/debug-monitors.c+12−11
@@ -201,7 +201,7 @@ void unregister_step_hook(struct step_hook *hook) · 200 unmodified lines
201}201}
202 202
203/*203/*
204 * Call registered single step handers204 * Call registered single step handlers
205 * There is no Syndrome info to check for determining the handler.205 * There is no Syndrome info to check for determining the handler.
206 * So we call all the registered handlers, until the right handler is206 * So we call all the registered handlers, until the right handler is
207 * found which returns zero.207 * found which returns zero.
@@ -271,20 +271,21 @@ static int single_step_handler(unsigned long addr, unsigned int esr, · 63 unmodified lines
271 * Use reader/writer locks instead of plain spinlock.271 * Use reader/writer locks instead of plain spinlock.
272 */272 */
273static LIST_HEAD(break_hook);273static LIST_HEAD(break_hook);
274static DEFINE_RWLOCK(break_hook_lock);274static DEFINE_SPINLOCK(break_hook_lock);
275 275
276void register_break_hook(struct break_hook *hook)276void register_break_hook(struct break_hook *hook)
277{277{
278 write_lock(&break_hook_lock);278 spin_lock(&break_hook_lock);
279 list_add(&hook->node, &break_hook);279 list_add_rcu(&hook->node, &break_hook);
280 write_unlock(&break_hook_lock);280 spin_unlock(&break_hook_lock);
281}281}
282 282
283void unregister_break_hook(struct break_hook *hook)283void unregister_break_hook(struct break_hook *hook)
284{284{
285 write_lock(&break_hook_lock);285 spin_lock(&break_hook_lock);
286 list_del(&hook->node);286 list_del_rcu(&hook->node);
287 write_unlock(&break_hook_lock);287 spin_unlock(&break_hook_lock);
288 synchronize_rcu();
288}289}
289 290
290static int call_break_hook(struct pt_regs *regs, unsigned int esr)291static int call_break_hook(struct pt_regs *regs, unsigned int esr)
@@ -292,11 +293,11 @@ static int call_break_hook(struct pt_regs *regs, unsigned int esr) · 1 unmodified line
292 struct break_hook *hook;293 struct break_hook *hook;
293 int (*fn)(struct pt_regs *regs, unsigned int esr) = NULL;294 int (*fn)(struct pt_regs *regs, unsigned int esr) = NULL;
294 295
295 read_lock(&break_hook_lock);296 rcu_read_lock();
296 list_for_each_entry(hook, &break_hook, node)297 list_for_each_entry_rcu(hook, &break_hook, node)
297 if ((esr & hook->esr_mask) == hook->esr_val)298 if ((esr & hook->esr_mask) == hook->esr_val)
298 fn = hook->fn;299 fn = hook->fn;
299 read_unlock(&break_hook_lock);300 rcu_read_unlock();
300 301
301 return fn ? fn(regs, esr) : DBG_HOOK_ERROR;302 return fn ? fn(regs, esr) : DBG_HOOK_ERROR;
302}303}
arch/arm64/kernel/insn.c+3−3
@@ -85,7 +85,7 @@ bool aarch64_insn_is_branch_imm(u32 insn) · 84 unmodified lines
85 aarch64_insn_is_bcond(insn));85 aarch64_insn_is_bcond(insn));
86}86}
87 87
88static DEFINE_SPINLOCK(patch_lock);88static DEFINE_RAW_SPINLOCK(patch_lock);
89 89
90static void __kprobes *patch_map(void *addr, int fixmap)90static void __kprobes *patch_map(void *addr, int fixmap)
91{91{
@@ -131,13 +131,13 @@ static int __kprobes __aarch64_insn_write(void *addr, u32 insn) · 39 unmodified lines
131 unsigned long flags = 0;131 unsigned long flags = 0;
132 int ret;132 int ret;
133 133
134 spin_lock_irqsave(&patch_lock, flags);134 raw_spin_lock_irqsave(&patch_lock, flags);
135 waddr = patch_map(addr, FIX_TEXT_POKE0);135 waddr = patch_map(addr, FIX_TEXT_POKE0);
136 136
137 ret = probe_kernel_write(waddr, &insn, AARCH64_INSN_SIZE);137 ret = probe_kernel_write(waddr, &insn, AARCH64_INSN_SIZE);
138 138
139 patch_unmap(FIX_TEXT_POKE0);139 patch_unmap(FIX_TEXT_POKE0);
140 spin_unlock_irqrestore(&patch_lock, flags);140 raw_spin_unlock_irqrestore(&patch_lock, flags);
141 141
142 return ret;142 return ret;
143}143}
arch/arm64/kernel/setup.c+2−0
@@ -364,6 +364,8 @@ static void __init relocate_initrd(void) · 363 unmodified lines
364 to_free = ram_end - orig_start;364 to_free = ram_end - orig_start;
365 365
366 size = orig_end - orig_start;366 size = orig_end - orig_start;
367 if (!size)
368 return;
367 369
368 /* initrd needs to be relocated completely inside linear mapping */370 /* initrd needs to be relocated completely inside linear mapping */
369 new_start = memblock_find_in_range(0, PFN_PHYS(max_pfn),371 new_start = memblock_find_in_range(0, PFN_PHYS(max_pfn),
arch/arm64/mm/fault.c+1−0
@@ -287,6 +287,7 @@ retry: · 286 unmodified lines
287 * starvation.287 * starvation.
288 */288 */
289 mm_flags &= ~FAULT_FLAG_ALLOW_RETRY;289 mm_flags &= ~FAULT_FLAG_ALLOW_RETRY;
290 mm_flags |= FAULT_FLAG_TRIED;
290 goto retry;291 goto retry;
291 }292 }
292 }293 }