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
201201 }
202202
203203 /*
204− * Call registered single step handers
204+ * Call registered single step handlers
205205 * There is no Syndrome info to check for determining the handler.
206206 * So we call all the registered handlers, until the right handler is
207207 * found which returns zero.
@@ -271,20 +271,21 @@ static int single_step_handler(unsigned long addr, unsigned int esr, · 63 unmodified lines
271271 * Use reader/writer locks instead of plain spinlock.
272272 */
273273 static LIST_HEAD(break_hook);
274−static DEFINE_RWLOCK(break_hook_lock);
274+static DEFINE_SPINLOCK(break_hook_lock);
275275
276276 void register_break_hook(struct break_hook *hook)
277277 {
278− write_lock(&break_hook_lock);
279− list_add(&hook->node, &break_hook);
280− write_unlock(&break_hook_lock);
278+ spin_lock(&break_hook_lock);
279+ list_add_rcu(&hook->node, &break_hook);
280+ spin_unlock(&break_hook_lock);
281281 }
282282
283283 void unregister_break_hook(struct break_hook *hook)
284284 {
285− write_lock(&break_hook_lock);
286− list_del(&hook->node);
287− write_unlock(&break_hook_lock);
285+ spin_lock(&break_hook_lock);
286+ list_del_rcu(&hook->node);
287+ spin_unlock(&break_hook_lock);
288+ synchronize_rcu();
288289 }
289290
290291 static 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
292293 struct break_hook *hook;
293294 int (*fn)(struct pt_regs *regs, unsigned int esr) = NULL;
294295
295− read_lock(&break_hook_lock);
296− list_for_each_entry(hook, &break_hook, node)
296+ rcu_read_lock();
297+ list_for_each_entry_rcu(hook, &break_hook, node)
297298 if ((esr & hook->esr_mask) == hook->esr_val)
298299 fn = hook->fn;
299− read_unlock(&break_hook_lock);
300+ rcu_read_unlock();
300301
301302 return fn ? fn(regs, esr) : DBG_HOOK_ERROR;
302303 }
arch/arm64/kernel/insn.c+3−3
@@ -85,7 +85,7 @@ bool aarch64_insn_is_branch_imm(u32 insn) · 84 unmodified lines
8585 aarch64_insn_is_bcond(insn));
8686 }
8787
88−static DEFINE_SPINLOCK(patch_lock);
88+static DEFINE_RAW_SPINLOCK(patch_lock);
8989
9090 static void __kprobes *patch_map(void *addr, int fixmap)
9191 {
@@ -131,13 +131,13 @@ static int __kprobes __aarch64_insn_write(void *addr, u32 insn) · 39 unmodified lines
131131 unsigned long flags = 0;
132132 int ret;
133133
134− spin_lock_irqsave(&patch_lock, flags);
134+ raw_spin_lock_irqsave(&patch_lock, flags);
135135 waddr = patch_map(addr, FIX_TEXT_POKE0);
136136
137137 ret = probe_kernel_write(waddr, &insn, AARCH64_INSN_SIZE);
138138
139139 patch_unmap(FIX_TEXT_POKE0);
140− spin_unlock_irqrestore(&patch_lock, flags);
140+ raw_spin_unlock_irqrestore(&patch_lock, flags);
141141
142142 return ret;
143143 }
arch/arm64/kernel/setup.c+2−0
@@ -364,6 +364,8 @@ static void __init relocate_initrd(void) · 363 unmodified lines
364364 to_free = ram_end - orig_start;
365365
366366 size = orig_end - orig_start;
367+ if (!size)
368+ return;
367369
368370 /* initrd needs to be relocated completely inside linear mapping */
369371 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
287287 * starvation.
288288 */
289289 mm_flags &= ~FAULT_FLAG_ALLOW_RETRY;
290+ mm_flags |= FAULT_FLAG_TRIED;
290291 goto retry;
291292 }
292293 }