From owner-p4-projects@FreeBSD.ORG Mon Apr 17 04:37:39 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 457D216A404; Mon, 17 Apr 2006 04:37:39 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0BDC416A401 for ; Mon, 17 Apr 2006 04:37:39 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC76143D55 for ; Mon, 17 Apr 2006 04:37:38 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k3H4bcRH080405 for ; Mon, 17 Apr 2006 04:37:38 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k3H4bcFX080399 for perforce@freebsd.org; Mon, 17 Apr 2006 04:37:38 GMT (envelope-from kmacy@freebsd.org) Date: Mon, 17 Apr 2006 04:37:38 GMT Message-Id: <200604170437.k3H4bcFX080399@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 95411 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Apr 2006 04:37:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=95411 Change 95411 by kmacy@kmacy_storage:sun4v_rwbuf on 2006/04/17 04:37:20 ack IPIs Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/interrupt.S#6 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/interrupt.S#6 (text+ko) ==== @@ -36,9 +36,14 @@ #include "assym.s" + +#define PUTCHAR(x) \ + mov x, %o0 ; \ + mov CONS_WRITE, %o5 ; \ + ta FAST_TRAP + ENTRY(intr_fast) save %sp, -CCFSZ, %sp - 1: ldx [PCPU(IRHEAD)], %l0 brnz,a,pt %l0, 2f nop @@ -143,7 +148,7 @@ ! %g5 PC for fasttrap TL>0 handler ! %g1 arg 1 ! %g2 arg 2 - ! %g3 queue base VA + ! %g3 queue base RA, ackmask ! %g4 queue size mask ! %g6 head ptr mov CPU_MONDO_QUEUE_HEAD, %g1 @@ -152,7 +157,7 @@ ldxa [%g2]ASI_QUEUE, %g4 ! %g4 = tail ptr cmp %g6, %g4 be,pn %xcc, 0f ! head == tail - nop + nop /* * Get the address of the current CPU and index into @@ -179,24 +184,26 @@ ldxa [%g3 + %g6]ASI_REAL, %g1 ! read data word 1 add %g6, 0x8, %g6 ! inc head 8 bytes ldxa [%g3 + %g6]ASI_REAL, %g2 ! read data word 2 - add %g6, (INTR_REPORT_SIZE - 16) , %g6 - ! inc head to next record + add %g6, 0x8, %g6 ! inc head 8 bytes + ldxa [%g3 + %g6]ASI_REAL, %g7 ! read data word 3 + add %g6, (INTR_REPORT_SIZE - 24) , %g6 ! inc head to next record and %g6, %g4, %g6 ! and size mask for wrap around mov CPU_MONDO_QUEUE_HEAD, %g3 stxa %g6, [%g3]ASI_QUEUE ! store head pointer membar #Sync - + + mov %g7, %g3 ! ackmask /* * For now catch invalid PC being passed via cpu_mondo queue */ set KERNBASE, %g4 cmp %g5, %g4 bl,a,pn %xcc, 1f ! branch if bad %pc - nop + nop jmp %g5 ! jump to traphandler - nop + nop 1: ! invalid trap handler, discard it for now set cpu_mondo_invalid, %g4 @@ -236,6 +243,12 @@ * %g4 queue size mask * %g6 head ptr */ + mov %o0, %g1 + mov %o5, %g6 +! PUTCHAR(0x2b) + mov %g1, %o0 + mov %g6, %o5 + mov DEV_MONDO_QUEUE_HEAD, %g1 ldxa [%g1]ASI_QUEUE, %g6 ! %g6 = head ptr mov DEV_MONDO_QUEUE_TAIL, %g2 @@ -345,7 +358,7 @@ #endif /* lint */ ENTRY(tl_invlctx) - mov %o0, %g3 + mov %o0, %g2 mov %o1, %g4 mov %o2, %g5 mov %o3, %g6 @@ -361,19 +374,21 @@ ba panic_bad_hcall mov MMU_DEMAP_CTX, %o1 1: - mov %g3, %o0 + mov %g2, %o0 mov %g4, %o1 mov %g5, %o2 mov %g6, %o3 mov %g7, %o5 - retry + + ba,a,pt %xcc, set_ackmask + nop END(tl_invlctx) ENTRY(tl_invltlb) mov %o0, %g1 mov %o1, %g2 - mov %o2, %g3 - mov %o5, %g4 + mov %o2, %g4 + mov %o5, %g5 mov %g0, %o0 mov %g0, %o1 @@ -383,12 +398,15 @@ brz,pt %o0, 1f nop ba panic_bad_hcall + mov MMU_DEMAP_ALL, %o1 1: mov %g1, %o0 mov %g2, %o1 - mov %g3, %o2 - mov %g4, %o5 - retry + mov %g4, %o2 + mov %g5, %o5 + + ba,a,pt %xcc, set_ackmask + nop END(tl_invltlb) ENTRY(tl_invlpg) @@ -402,6 +420,21 @@ mov %g5, %o0 mov %g6, %o1 mov %g7, %o2 - retry + ba,a,pt %xcc, set_ackmask + nop END(tl_invlpg) - + +ENTRY(set_ackmask) + MAGIC_TRAP_ON + GET_PCPU_SCRATCH + ld [%g3], %g1 + ld [PCPU(CPUMASK)], %g4 +1: or %g1, %g4, %g2 + cas [%g3], %g1, %g2 + cmp %g1, %g2 + bne,pn %icc, 1b + mov %g2, %g1 + MAGIC_TRAP_OFF + ba,a,pt %xcc, cpu_mondo + nop +END(set_ackmask)