Skip to content

Commit

Permalink
PK trace fixes and ppe42 optimizations
Browse files Browse the repository at this point in the history
Change-Id: Icc162f3511a965490885dc31615fd552ec430a36
RTC: 167247
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42141
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Reviewed-by: BRIAN D. VICTOR <brian.d.victor1@ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42155
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
  • Loading branch information
dgilbert999 authored and sgupta2m committed Jun 22, 2017
1 parent 4bdd931 commit 1e5d0ee
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_msr.h
Expand Up @@ -74,8 +74,8 @@
/// Move From MSR

#define mfmsr() \
({volatile uint32_t __msr; \
asm volatile ("mfmsr %0" : "=r" (__msr)); \
({uint32_t __msr; \
asm volatile ("mfmsr %0" : "=r" (__msr) : : "memory"); \
__msr;})


Expand Down
10 changes: 5 additions & 5 deletions src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_spr.h
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -134,8 +134,8 @@ typedef union
/// Note that \a sprn must be a compile-time constant.

#define mfspr(sprn) \
({volatile uint32_t __value; \
asm volatile ("mfspr %0, %1" : "=r" (__value) : "i" (sprn)); \
({uint32_t __value; \
asm volatile ("mfspr %0, %1" : "=r" (__value) : "i" (sprn) : "memory"); \
__value;})


Expand All @@ -144,8 +144,8 @@ typedef union
/// Note that \a sprn must be a compile-time constant.

#define mtspr(sprn, value) \
({volatile uint32_t __value = (value); \
asm volatile ("mtspr %0, %1" : : "i" (sprn), "r" (__value)); \
({uint32_t __value = (value); \
asm volatile ("mtspr %0, %1" : : "i" (sprn), "r" (__value) : "memory"); \
})


Expand Down
4 changes: 2 additions & 2 deletions src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_big.c
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -34,7 +34,7 @@
#include "pk.h"
#include "pk_trace.h"

#if (PK_TRACE_SUPPORT && PK_TIMER_SUPPORT)
#if (PK_TRACE_SUPPORT)
void pk_trace_big(uint32_t i_hash_and_count,
uint64_t i_parm1, uint64_t i_parm2)
{
Expand Down
4 changes: 2 additions & 2 deletions src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_binary.c
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -33,7 +33,7 @@
#include "pk.h"
#include "pk_trace.h"

#if (PK_TRACE_SUPPORT && PK_TIMER_SUPPORT)
#if (PK_TRACE_SUPPORT)
void pk_trace_binary(uint32_t i_hash_and_size, void* bufp)
{
PkTraceBinary footer;
Expand Down
17 changes: 10 additions & 7 deletions src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_core.c
Expand Up @@ -36,9 +36,10 @@
#include "pk.h"
#include "pk_trace.h"

void pk_trace_timer_callback(void* arg);

#if (PK_TRACE_SUPPORT && PK_TIMER_SUPPORT)
#if (PK_TRACE_SUPPORT)
#if (PK_TIMER_SUPPORT)
void pk_trace_timer_callback(void* arg);
extern PkTimer g_pk_trace_timer __attribute__((section (".sdata")));

//Static initialization of the trace timer
Expand All @@ -49,17 +50,19 @@ PkTimer g_pk_trace_timer __attribute__ ((section (".sdata"))) =
.callback = pk_trace_timer_callback,
.arg = 0,
};
#endif

//Static initialization of the pk trace buffer
PkTraceBuffer g_pk_trace_buf __attribute__ ((section (".sdata"))) =
{
.version = PK_TRACE_VERSION,
.image_str = PPE_IMG_STRING,
.hash_prefix = PK_TRACE_HASH_PREFIX,
.partial_trace_hash = trace_ppe_hash("PARTIAL TRACE ENTRY. HASH_ID = %d", PK_TRACE_HASH_PREFIX),
.partial_trace_hash =
trace_ppe_hash("PARTIAL TRACE ENTRY. HASH_ID = %d", PK_TRACE_HASH_PREFIX),
.size = PK_TRACE_SZ,
.max_time_change = PK_TRACE_MTBT,
.hz = 500000000, //default value. Actual value is set in pk_init.c
.hz = 500000000, //default. Actual is set in pk_init.c
.time_adj64 = 0,
.state.word64 = 0,
.cb = {0}
Expand Down Expand Up @@ -124,7 +127,7 @@ void pk_trace_tiny(uint32_t i_parm)
pk_critical_section_exit(&ctx);
}


#if (PK_TIMER_SUPPORT)
// This function is called periodically in order to ensure that the max ticks
// between trace entries is no more than what will fit inside a 32bit value.
#ifndef PK_TRACE_TIMER_OUTPUT
Expand All @@ -151,5 +154,5 @@ void pk_trace_set_timebase(PkTimebase timebase)
{
g_pk_trace_buf.time_adj64 = timebase - pk_timebase_get();
}

#endif
#endif // PK_TIMER_SUPPORT
#endif // PK_TRACE_SUPPORT

0 comments on commit 1e5d0ee

Please sign in to comment.