Wessel, Jason wrote:

>>    It is not limited to KGDBoE.

> You are correct.  This is a generic problem with kgdbwait on x86_64.

>>>Perhaps you can experiment a bit further, and report back as I do not 
>>>have your exact setup with SMP on x86_64 at the moment?

>>    Well, this would explain why this has gone unnoticed so far. :-)

> I setup a an SMP x86_64 system and yes indeed there is a significant
> problem there.

    I have verified that in non -rt kernel it's even worse -- kernel just 
locks up instead of giving BUG trace -- yet somehow I was sure it worked for 
me before. :-/

> I further tested the patches I created, and they fix both cases for
> kgdbwait.  On x86_64 the rs232 automatically becomes a late init device

    Good to know -- I haven't gotten around to testing them myself... :-/

> because it requires the exception stack be available to issue a
> breakpoint().  Another way to make a change that is KGDB specific for
> this arch if early init is still truly needed for the rs232 is to add
> kgdb specific code right after the place that the exception stack is
> initialized.

>>> kernel/kgdb.c |   23 +++++++++++------------
>>> 1 file changed, 11 insertions(+), 12 deletions(-)

>>>Index: linux-2.6.21-standard/kernel/kgdb.c
>>>===================================================================
>>>--- linux-2.6.21-standard.orig/kernel/kgdb.c
>>>+++ linux-2.6.21-standard/kernel/kgdb.c
>>>@@ -1788,17 +1788,6 @@ late_initcall(kgdb_late_entry);
>>>  */
>>> void breakpoint(void)
>>> {
>>>-    if (kgdb_initialized != 1) {
>>>-            kgdb_early_entry();
>>>-            if (kgdb_initialized == 1)
>>>-                    printk(KERN_CRIT "Waiting for connection from remote "
>>>-                           "gdb...\n");
>>>-            else {
>>>-                    printk(KERN_CRIT "KGDB cannot initialize I/O yet.\n");
>>>-                    return;
>>>-            }
>>>-    }
>>>-
>>>     atomic_set(&kgdb_setting_breakpoint, 1);
>>>     wmb();
>>>     BREAKPOINT();
>>>@@ -1883,7 +1872,17 @@ static int __init opt_kgdb_enter(char *s
>>>     if (kgdb_initialized)
>>>             return 0;
>>> 
>>>-    /* Call breakpoint() which will take care of init. */
>>>+    if (kgdb_initialized != 1) {
>>>+            kgdb_early_entry();
>>>+            if (kgdb_initialized == 1)
>>>+                    printk(KERN_CRIT "Waiting for connection from remote "
>>>+                           "gdb...\n");
>>>+            else {
>>>+                    printk(KERN_CRIT "KGDB cannot initialize I/O yet.\n");
>>>+                    return;
>>>+            }
>>>+    }
>>>+
>>>     breakpoint();
>>
>>    I don't see how this might help.

> This patch does directly have to do with the problem however it does fix

    Did you mean "doesn't have to do"?

> a problem where breakpoint() references a function which is in the
> .init_text and this generates a warning with the latest rc kernels.
> Also moving the function into the early init makes for the situation
> where the low level initialization can only get called one time as a
> part of the init sequence.

>>> kernel/kgdb.c |   11 ++++++-----
>>> 1 file changed, 6 insertions(+), 5 deletions(-)

>>>Index: linux-2.6.21-standard/kernel/kgdb.c
>>>===================================================================
>>>--- linux-2.6.21-standard.orig/kernel/kgdb.c
>>>+++ linux-2.6.21-standard/kernel/kgdb.c
>>>@@ -1682,20 +1682,21 @@ DECLARE_TASKLET(kgdb_tasklet_breakpoint,
>>>  */
>>> static void __init kgdb_early_entry(void)  {
>>>+    /* Let the architecture do any setup that it needs to. */
>>>+    kgdb_arch_init();
>>>+
>>>     /*
>>>      * Don't try and do anything until the architecture is able to
>>>      * setup the exception stack.  In this case, it is up to the
>>>      * architecture to hook in and look at us when they are ready.
>>>      */
>>>+
>>>     if(!CHECK_EXCEPTION_STACK()) {

    Worth fixing if stmt style while at it. :-)

>>>             kgdb_initialized = -1;
>>>-            tasklet_schedule(&kgdb_tasklet_breakpoint);
>>>+            /* any kind of break point is deferred to late_init */
>>>             return;

> Note I removed the tasklet and it is put into a late breakpoint() call.
> I had tried out both kgdb over rs232 and kgdboe on the x86_64 SMP with
> kgdbwait and it works now with no hang at boot.

    Oops, I have indeed managed to overlook this particular change. :-<

> Jason.

Thanks,
Sergei

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to