x86/alternatives: Add text_poke_kgdb() to not assert the lock when debugging
[linux-2.6-microblaze.git] / arch / x86 / kernel / kgdb.c
index 4ff6b4c..2b203ee 100644 (file)
@@ -759,13 +759,13 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
        if (!err)
                return err;
        /*
-        * It is safe to call text_poke() because normal kernel execution
+        * It is safe to call text_poke_kgdb() because normal kernel execution
         * is stopped on all cores, so long as the text_mutex is not locked.
         */
        if (mutex_is_locked(&text_mutex))
                return -EBUSY;
-       text_poke((void *)bpt->bpt_addr, arch_kgdb_ops.gdb_bpt_instr,
-                 BREAK_INSTR_SIZE);
+       text_poke_kgdb((void *)bpt->bpt_addr, arch_kgdb_ops.gdb_bpt_instr,
+                      BREAK_INSTR_SIZE);
        err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE);
        if (err)
                return err;
@@ -784,12 +784,13 @@ int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
        if (bpt->type != BP_POKE_BREAKPOINT)
                goto knl_write;
        /*
-        * It is safe to call text_poke() because normal kernel execution
+        * It is safe to call text_poke_kgdb() because normal kernel execution
         * is stopped on all cores, so long as the text_mutex is not locked.
         */
        if (mutex_is_locked(&text_mutex))
                goto knl_write;
-       text_poke((void *)bpt->bpt_addr, bpt->saved_instr, BREAK_INSTR_SIZE);
+       text_poke_kgdb((void *)bpt->bpt_addr, bpt->saved_instr,
+                      BREAK_INSTR_SIZE);
        err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE);
        if (err || memcmp(opc, bpt->saved_instr, BREAK_INSTR_SIZE))
                goto knl_write;