Keith , i came across a problem with the CPU command in KDB. I cannot
use CPU command to switch between cpu's on a SMP system. This only
happens with machines that are configured to use clustered APIC mode [
xSeries 44X models ] . This support was added by the summit patches [
for x440 and x445 models of xSeries type ].

      When you use CPU command on these type of machines you get the
following error " Invalid CPU ID " and the kernel prints  "invalid
interrupt vector DA" for N-1 time [ N being number of CPUS ]. It so
happens that the IRQ are not masked as NMI's as is the case in normal
machines. 

The problem was with 2.4.19 kernel.

In Vanilla 2.4.19 kernel the code patch followed is 

In arch/i386/kernel/smp.c

    smp_kdb_stop ( ) ----> send_IPI_allbutself( ) --->
__send_IPI_shortcut( ) . This function sends IPI to other cpus in form
of NMI

In case of kernels with summit patch

    smp_kdb_stop( ) ----> send_IPI_allbutself( ) ----> send_IPI_mask( )
---->  send_IPI_mask_sequence( ).   This function sends IPI to other
cpus but not in the form of NMI . Hence we see the error message "
Unexpected IRQ vector da "

The following patch fixes this problem. It only applies to
arch/i386/kernel/smp.c [ send_IPI_mask_sequence( ) fun ]. 

Please let me know your comments.

Thanks
-Sachin

--------------------------------------------------------------------------------------------------------------------------------------------

--- smp.c       2003-06-27 16:50:56.000000000 +0530
+++ smp.c.new   2003-06-27 16:50:37.000000000 +0530
@@ -255,6 +255,15 @@
                         */
                        cfg = __prepare_ICR(0, vector);
 
+#ifdef CONFIG_KDB
+       if (vector == KDB_VECTOR) {
+               /*
+                * Setup KDB IPI to be delivered as an NMI
+                */
+               cfg = (cfg&~APIC_VECTOR_MASK)|APIC_DM_NMI;
+       }
+#endif /* CONFIG_KDB */
+                       
                        /*
                         * Send the IPI. The write to APIC_ICR fires
this off.

Reply via email to