Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64 sun4v: initialize %stickcmpr properly when ...



details:   https://anonhg.NetBSD.org/src/rev/c7cb51c34508
branches:  trunk
changeset: 448763:c7cb51c34508
user:      palle <palle%NetBSD.org@localhost>
date:      Fri Feb 08 20:14:50 2019 +0000

description:
sun4v: initialize %stickcmpr properly when establishing interrupt - fixes issue seen on newer sun4v/SPARC-T5 system where the interrupt never fires.

diffstat:

 sys/arch/sparc64/include/cpu.h    |   3 ++-
 sys/arch/sparc64/sparc64/clock.c  |   5 +++--
 sys/arch/sparc64/sparc64/locore.s |  17 ++++++++++++++++-
 3 files changed, 21 insertions(+), 4 deletions(-)

diffs (74 lines):

diff -r bdc5d844d213 -r c7cb51c34508 sys/arch/sparc64/include/cpu.h
--- a/sys/arch/sparc64/include/cpu.h    Fri Feb 08 20:09:24 2019 +0000
+++ b/sys/arch/sparc64/include/cpu.h    Fri Feb 08 20:14:50 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.125 2018/08/22 01:05:23 msaitoh Exp $ */
+/*     $NetBSD: cpu.h,v 1.126 2019/02/08 20:14:50 palle Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -434,6 +434,7 @@
 void   switchtoctx_usiii(int);
 void   next_tick(long);
 void   next_stick(long);
+void   next_stick_init(void);
 /* trap.c */
 void   cpu_vmspace_exec(struct lwp *, vaddr_t, vaddr_t);
 int    rwindow_save(struct lwp *);
diff -r bdc5d844d213 -r c7cb51c34508 sys/arch/sparc64/sparc64/clock.c
--- a/sys/arch/sparc64/sparc64/clock.c  Fri Feb 08 20:09:24 2019 +0000
+++ b/sys/arch/sparc64/sparc64/clock.c  Fri Feb 08 20:14:50 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.120 2016/07/07 06:55:38 msaitoh Exp $ */
+/*     $NetBSD: clock.c,v 1.121 2019/02/08 20:14:51 palle Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.120 2016/07/07 06:55:38 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.121 2019/02/08 20:14:51 palle Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -406,6 +406,7 @@
        ci->ci_tick_increment = ci->ci_system_clockrate[0] / hz;
 
        s = intr_disable();
+       next_stick_init();
        next_stick(ci->ci_tick_increment);
        intr_restore(s);
 }
diff -r bdc5d844d213 -r c7cb51c34508 sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Fri Feb 08 20:09:24 2019 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Fri Feb 08 20:14:50 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.417 2019/02/08 19:45:24 palle Exp $       */
+/*     $NetBSD: locore.s,v 1.418 2019/02/08 20:14:51 palle Exp $       */
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -7507,6 +7507,21 @@
        retl
         wr     %o2, STICK_CMPR
 
+/*
+ * next_stick_init()
+ *
+ * Sets the %stick_cmpr register to the value retrieved from %stick so
+ * next_stick() does not spend too much time in the function when called
+ * for the first time.
+ */
+ENTRY(next_stick_init)
+       rd      STICK, %o0
+       mov     1, %o1          ! Mask off high bits of the register
+       sllx    %o1, 63, %o1
+       andn    %o0, %o1, %o0
+       retl
+        wr     %o0, STICK_CMPR
+
 ENTRY(setjmp)
        save    %sp, -CC64FSZ, %sp      ! Need a frame to return to.
        flushw



Home | Main Index | Thread Index | Old Index