Try the attached patch.  If this doesn't work, I'll back out
the last i386/isa/ipl_funcs.c change.

Alan
Index: i386/i386/swtch.s
===================================================================
RCS file: /home/ncvs/src/sys/i386/i386/swtch.s,v
retrieving revision 1.82
diff -c -r1.82 swtch.s
*** swtch.s     1999/06/01 18:19:45     1.82
--- swtch.s     1999/06/30 07:50:54
***************
*** 311,317 ****
         * XXX: we had damn well better be sure we had it before doing this!
         */
        CPL_LOCK                        /* XXX */
!       andl    $~SWI_AST_MASK, _ipending                       /* XXX */
        movl    $0, _cpl        /* XXX Allow ASTs on other CPU */
        CPL_UNLOCK                      /* XXX */
        movl    $FREE_LOCK, %eax
--- 311,317 ----
         * XXX: we had damn well better be sure we had it before doing this!
         */
        CPL_LOCK                        /* XXX */
!       MPLOCKED andl   $~SWI_AST_MASK, _ipending                       /* XXX */
        movl    $0, _cpl        /* XXX Allow ASTs on other CPU */
        CPL_UNLOCK                      /* XXX */
        movl    $FREE_LOCK, %eax
Index: i386/isa/apic_ipl.s
===================================================================
RCS file: /home/ncvs/src/sys/i386/isa/apic_ipl.s,v
retrieving revision 1.23
diff -c -r1.23 apic_ipl.s
*** apic_ipl.s  1999/04/10 19:22:17     1.23
--- apic_ipl.s  1999/06/30 07:43:55
***************
*** 116,121 ****
--- 116,122 ----
        ALIGN_TEXT
  splz_unpend:
        bsfl    %ecx,%ecx
+       lock
        btrl    %ecx,_ipending
        jnc     splz_next
        cmpl    $NHWI,%ecx
Index: i386/isa/apic_vector.s
===================================================================
RCS file: /home/ncvs/src/sys/i386/isa/apic_vector.s,v
retrieving revision 1.40
diff -c -r1.40 apic_vector.s
*** apic_vector.s       1999/06/16 03:53:52     1.40
--- apic_vector.s       1999/06/30 07:35:32
***************
*** 398,403 ****
--- 398,404 ----
        MASK_IRQ(irq_num) ;                                             \
        EOI_IRQ(irq_num) ;                                              \
        AVCPL_LOCK ;                            /* MP-safe */           \
+       lock ;                                                          \
        orl     $IRQ_BIT(irq_num), _ipending ;                          \
        AVCPL_UNLOCK ;                                                  \
        lock ;                                                          \
***************
*** 409,414 ****
--- 410,416 ----
        ALIGN_TEXT ;                                                    \
  2: ;                                          /* masked by cpl|cml */ \
        APIC_ITRACE(apic_itrace_masked, irq_num, APIC_ITRACE_MASKED) ;  \
+       lock ;                                                          \
        orl     $IRQ_BIT(irq_num), _ipending ;                          \
        AVCPL_UNLOCK ;                                                  \
        DELOCK ;                /* XXX this is going away... */         \
***************
*** 418,423 ****
--- 420,426 ----
  3: ;                  /* other cpu has isr lock */                    \
        APIC_ITRACE(apic_itrace_noisrlock, irq_num, APIC_ITRACE_NOISRLOCK) ;\
        AVCPL_LOCK ;                            /* MP-safe */           \
+       lock ;                                                          \
        orl     $IRQ_BIT(irq_num), _ipending ;                          \
        testl   $IRQ_BIT(irq_num), _cpl ;                               \
        jne     4f ;                            /* this INT masked */   \
***************
*** 485,490 ****
--- 488,494 ----
        pushl   %eax ;                                                  \
        orl     _intr_mask + (irq_num) * 4, %eax ;                      \
        movl    %eax, _cpl ;                                            \
+       lock ;                                                          \
        andl    $~IRQ_BIT(irq_num), _ipending ;                         \
        AVCPL_UNLOCK ;                                                  \
  ;                                                                     \
***************
*** 508,513 ****
--- 512,518 ----
        MASK_IRQ(irq_num) ;                                             \
        EOI_IRQ(irq_num) ;                                              \
        AVCPL_LOCK ;                            /* MP-safe */           \
+       lock ;                                                          \
        orl     $IRQ_BIT(irq_num), _ipending ;                          \
        AVCPL_UNLOCK ;                                                  \
        lock ;                                                          \
***************
*** 518,523 ****
--- 523,529 ----
        ALIGN_TEXT ;                                                    \
  2: ;                          /* masked by cpl, leave iactive set */  \
        APIC_ITRACE(apic_itrace_masked, irq_num, APIC_ITRACE_MASKED) ;  \
+       lock ;                                                          \
        orl     $IRQ_BIT(irq_num), _ipending ;                          \
        AVCPL_UNLOCK ;                                                  \
        ISR_RELLOCK ;           /* XXX this is going away... */         \
***************
*** 527,532 ****
--- 533,539 ----
  3: ;                  /* other cpu has isr lock */                    \
        APIC_ITRACE(apic_itrace_noisrlock, irq_num, APIC_ITRACE_NOISRLOCK) ;\
        AVCPL_LOCK ;                            /* MP-safe */           \
+       lock ;                                                          \
        orl     $IRQ_BIT(irq_num), _ipending ;                          \
        testl   $IRQ_BIT(irq_num), _cpl ;                               \
        jne     4f ;                            /* this INT masked */   \
***************
*** 698,703 ****
--- 705,711 ----
        movl    _cpl, %eax
  #endif
        pushl   %eax
+       lock
        orl     $SWI_AST_PENDING, _ipending
        AVCPL_UNLOCK
        lock
Index: i386/isa/ipl.s
===================================================================
RCS file: /home/ncvs/src/sys/i386/isa/ipl.s,v
retrieving revision 1.28
diff -c -r1.28 ipl.s
*** ipl.s       1999/06/01 18:20:15     1.28
--- ipl.s       1999/06/30 07:46:33
***************
*** 236,241 ****
--- 236,242 ----
        TEST_CIL
        /* we enter with cpl locked */
        bsfl    %ecx, %ecx              /* slow, but not worth optimizing */
+       lock
        btrl    %ecx, _ipending
        jnc     doreti_next2            /* some intr cleared memory copy */
        cmpl    $NHWI, %ecx
***************
*** 377,383 ****
         */
        cli
        ICPL_LOCK
!       orl $SWI_AST_PENDING, _ipending
        /* cpl is unlocked in doreti_exit */
        subl    %eax,%eax
  #ifdef CPL_AND_CML
--- 378,384 ----
         */
        cli
        ICPL_LOCK
!       MPLOCKED orl $SWI_AST_PENDING, _ipending
        /* cpl is unlocked in doreti_exit */
        subl    %eax,%eax
  #ifdef CPL_AND_CML

Reply via email to