[Skiboot] [PATCH 1/2] core/test/run-trace: fix on ppc64el

Stewart Smith stewart at linux.ibm.com
Thu Apr 19 15:50:58 AEST 2018


Hackish fix from benh

Suggested-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart at linux.ibm.com>
---
 core/trace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/trace.c b/core/trace.c
index 4364aea57d1d..ef7c2ca05ae1 100644
--- a/core/trace.c
+++ b/core/trace.c
@@ -127,7 +127,8 @@ void trace_add(union trace *trace, u8 type, u16 len)
 	assert(trace->hdr.type != TRACE_OVERFLOW);
 #endif
 	/* Skip traces not enabled in the debug descriptor */
-	if (!((1ul << trace->hdr.type) & debug_descriptor.trace_mask))
+	if (trace->hdr.type < (8 * sizeof(debug_descriptor.trace_mask)) &&
+	    !((1ul << trace->hdr.type) & debug_descriptor.trace_mask))
 		return;
 
 	trace->hdr.timestamp = cpu_to_be64(mftb());
-- 
2.14.3



More information about the Skiboot mailing list