Skip to content

Commit 1e5d0ee

Browse files
dgilbert999sgupta2m
authored andcommitted
PK trace fixes and ppe42 optimizations
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>
1 parent 4bdd931 commit 1e5d0ee

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_msr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
/// Move From MSR
7575

7676
#define mfmsr() \
77-
({volatile uint32_t __msr; \
78-
asm volatile ("mfmsr %0" : "=r" (__msr)); \
77+
({uint32_t __msr; \
78+
asm volatile ("mfmsr %0" : "=r" (__msr) : : "memory"); \
7979
__msr;})
8080

8181

src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_spr.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER sbe Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
8+
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -134,8 +134,8 @@ typedef union
134134
/// Note that \a sprn must be a compile-time constant.
135135

136136
#define mfspr(sprn) \
137-
({volatile uint32_t __value; \
138-
asm volatile ("mfspr %0, %1" : "=r" (__value) : "i" (sprn)); \
137+
({uint32_t __value; \
138+
asm volatile ("mfspr %0, %1" : "=r" (__value) : "i" (sprn) : "memory"); \
139139
__value;})
140140

141141

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

146146
#define mtspr(sprn, value) \
147-
({volatile uint32_t __value = (value); \
148-
asm volatile ("mtspr %0, %1" : : "i" (sprn), "r" (__value)); \
147+
({uint32_t __value = (value); \
148+
asm volatile ("mtspr %0, %1" : : "i" (sprn), "r" (__value) : "memory"); \
149149
})
150150

151151

src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_big.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER sbe Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
8+
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -34,7 +34,7 @@
3434
#include "pk.h"
3535
#include "pk_trace.h"
3636

37-
#if (PK_TRACE_SUPPORT && PK_TIMER_SUPPORT)
37+
#if (PK_TRACE_SUPPORT)
3838
void pk_trace_big(uint32_t i_hash_and_count,
3939
uint64_t i_parm1, uint64_t i_parm2)
4040
{

src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_binary.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER sbe Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
8+
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -33,7 +33,7 @@
3333
#include "pk.h"
3434
#include "pk_trace.h"
3535

36-
#if (PK_TRACE_SUPPORT && PK_TIMER_SUPPORT)
36+
#if (PK_TRACE_SUPPORT)
3737
void pk_trace_binary(uint32_t i_hash_and_size, void* bufp)
3838
{
3939
PkTraceBinary footer;

src/import/chips/p9/procedures/ppe/pk/trace/pk_trace_core.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@
3636
#include "pk.h"
3737
#include "pk_trace.h"
3838

39-
void pk_trace_timer_callback(void* arg);
4039

41-
#if (PK_TRACE_SUPPORT && PK_TIMER_SUPPORT)
40+
#if (PK_TRACE_SUPPORT)
41+
#if (PK_TIMER_SUPPORT)
42+
void pk_trace_timer_callback(void* arg);
4243
extern PkTimer g_pk_trace_timer __attribute__((section (".sdata")));
4344

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

5355
//Static initialization of the pk trace buffer
5456
PkTraceBuffer g_pk_trace_buf __attribute__ ((section (".sdata"))) =
5557
{
5658
.version = PK_TRACE_VERSION,
5759
.image_str = PPE_IMG_STRING,
5860
.hash_prefix = PK_TRACE_HASH_PREFIX,
59-
.partial_trace_hash = trace_ppe_hash("PARTIAL TRACE ENTRY. HASH_ID = %d", PK_TRACE_HASH_PREFIX),
61+
.partial_trace_hash =
62+
trace_ppe_hash("PARTIAL TRACE ENTRY. HASH_ID = %d", PK_TRACE_HASH_PREFIX),
6063
.size = PK_TRACE_SZ,
6164
.max_time_change = PK_TRACE_MTBT,
62-
.hz = 500000000, //default value. Actual value is set in pk_init.c
65+
.hz = 500000000, //default. Actual is set in pk_init.c
6366
.time_adj64 = 0,
6467
.state.word64 = 0,
6568
.cb = {0}
@@ -124,7 +127,7 @@ void pk_trace_tiny(uint32_t i_parm)
124127
pk_critical_section_exit(&ctx);
125128
}
126129

127-
130+
#if (PK_TIMER_SUPPORT)
128131
// This function is called periodically in order to ensure that the max ticks
129132
// between trace entries is no more than what will fit inside a 32bit value.
130133
#ifndef PK_TRACE_TIMER_OUTPUT
@@ -151,5 +154,5 @@ void pk_trace_set_timebase(PkTimebase timebase)
151154
{
152155
g_pk_trace_buf.time_adj64 = timebase - pk_timebase_get();
153156
}
154-
155-
#endif
157+
#endif // PK_TIMER_SUPPORT
158+
#endif // PK_TRACE_SUPPORT

0 commit comments

Comments
 (0)