Skip to content

Commit d6bdceb

Browse files
author
Peter Zijlstra
committed
powerpc64: Break asm/percpu.h vs spinlock_types.h dependency
In order to use <asm/percpu.h> in lockdep.h, we need to make sure asm/percpu.h does not itself depend on lockdep. The below seems to make that so and builds powerpc64-defconfig + PROVE_LOCKING. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Ingo Molnar <[email protected]> https://lkml.kernel.org/r/[email protected]
1 parent 48017e5 commit d6bdceb

File tree

9 files changed

+60
-45
lines changed

9 files changed

+60
-45
lines changed

arch/powerpc/include/asm/dtl.h

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#ifndef _ASM_POWERPC_DTL_H
2+
#define _ASM_POWERPC_DTL_H
3+
4+
#include <asm/lppaca.h>
5+
#include <linux/spinlock_types.h>
6+
7+
/*
8+
* Layout of entries in the hypervisor's dispatch trace log buffer.
9+
*/
10+
struct dtl_entry {
11+
u8 dispatch_reason;
12+
u8 preempt_reason;
13+
__be16 processor_id;
14+
__be32 enqueue_to_dispatch_time;
15+
__be32 ready_to_enqueue_time;
16+
__be32 waiting_to_ready_time;
17+
__be64 timebase;
18+
__be64 fault_addr;
19+
__be64 srr0;
20+
__be64 srr1;
21+
};
22+
23+
#define DISPATCH_LOG_BYTES 4096 /* bytes per cpu */
24+
#define N_DISPATCH_LOG (DISPATCH_LOG_BYTES / sizeof(struct dtl_entry))
25+
26+
/*
27+
* Dispatch trace log event enable mask:
28+
* 0x1: voluntary virtual processor waits
29+
* 0x2: time-slice preempts
30+
* 0x4: virtual partition memory page faults
31+
*/
32+
#define DTL_LOG_CEDE 0x1
33+
#define DTL_LOG_PREEMPT 0x2
34+
#define DTL_LOG_FAULT 0x4
35+
#define DTL_LOG_ALL (DTL_LOG_CEDE | DTL_LOG_PREEMPT | DTL_LOG_FAULT)
36+
37+
extern struct kmem_cache *dtl_cache;
38+
extern rwlock_t dtl_access_lock;
39+
40+
/*
41+
* When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE = y, the cpu accounting code controls
42+
* reading from the dispatch trace log. If other code wants to consume
43+
* DTL entries, it can set this pointer to a function that will get
44+
* called once for each DTL entry that gets processed.
45+
*/
46+
extern void (*dtl_consumer)(struct dtl_entry *entry, u64 index);
47+
48+
extern void register_dtl_buffer(int cpu);
49+
extern void alloc_dtl_buffers(unsigned long *time_limit);
50+
extern long hcall_vphn(unsigned long cpu, u64 flags, __be32 *associativity);
51+
52+
#endif /* _ASM_POWERPC_DTL_H */

arch/powerpc/include/asm/lppaca.h

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
*/
4343
#include <linux/cache.h>
4444
#include <linux/threads.h>
45-
#include <linux/spinlock_types.h>
4645
#include <asm/types.h>
4746
#include <asm/mmu.h>
4847
#include <asm/firmware.h>
@@ -146,49 +145,6 @@ struct slb_shadow {
146145
} save_area[SLB_NUM_BOLTED];
147146
} ____cacheline_aligned;
148147

149-
/*
150-
* Layout of entries in the hypervisor's dispatch trace log buffer.
151-
*/
152-
struct dtl_entry {
153-
u8 dispatch_reason;
154-
u8 preempt_reason;
155-
__be16 processor_id;
156-
__be32 enqueue_to_dispatch_time;
157-
__be32 ready_to_enqueue_time;
158-
__be32 waiting_to_ready_time;
159-
__be64 timebase;
160-
__be64 fault_addr;
161-
__be64 srr0;
162-
__be64 srr1;
163-
};
164-
165-
#define DISPATCH_LOG_BYTES 4096 /* bytes per cpu */
166-
#define N_DISPATCH_LOG (DISPATCH_LOG_BYTES / sizeof(struct dtl_entry))
167-
168-
/*
169-
* Dispatch trace log event enable mask:
170-
* 0x1: voluntary virtual processor waits
171-
* 0x2: time-slice preempts
172-
* 0x4: virtual partition memory page faults
173-
*/
174-
#define DTL_LOG_CEDE 0x1
175-
#define DTL_LOG_PREEMPT 0x2
176-
#define DTL_LOG_FAULT 0x4
177-
#define DTL_LOG_ALL (DTL_LOG_CEDE | DTL_LOG_PREEMPT | DTL_LOG_FAULT)
178-
179-
extern struct kmem_cache *dtl_cache;
180-
extern rwlock_t dtl_access_lock;
181-
182-
/*
183-
* When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE = y, the cpu accounting code controls
184-
* reading from the dispatch trace log. If other code wants to consume
185-
* DTL entries, it can set this pointer to a function that will get
186-
* called once for each DTL entry that gets processed.
187-
*/
188-
extern void (*dtl_consumer)(struct dtl_entry *entry, u64 index);
189-
190-
extern void register_dtl_buffer(int cpu);
191-
extern void alloc_dtl_buffers(unsigned long *time_limit);
192148
extern long hcall_vphn(unsigned long cpu, u64 flags, __be32 *associativity);
193149

194150
#endif /* CONFIG_PPC_BOOK3S */

arch/powerpc/include/asm/paca.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <asm/hmi.h>
3030
#include <asm/cpuidle.h>
3131
#include <asm/atomic.h>
32-
#include <asm/rtas-types.h>
3332

3433
#include <asm-generic/mmiowb_types.h>
3534

@@ -53,6 +52,7 @@ extern unsigned int debug_smp_processor_id(void); /* from linux/smp.h */
5352
#define get_slb_shadow() (get_paca()->slb_shadow_ptr)
5453

5554
struct task_struct;
55+
struct rtas_args;
5656

5757
/*
5858
* Defines the layout of the paca.

arch/powerpc/kernel/time.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ static inline unsigned long read_spurr(unsigned long tb)
183183

184184
#ifdef CONFIG_PPC_SPLPAR
185185

186+
#include <asm/dtl.h>
187+
186188
/*
187189
* Scan the dispatch trace log and count up the stolen time.
188190
* Should be called with interrupts disabled.

arch/powerpc/kvm/book3s_hv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
#include <asm/hw_breakpoint.h>
7575
#include <asm/kvm_book3s_uvmem.h>
7676
#include <asm/ultravisor.h>
77+
#include <asm/dtl.h>
7778

7879
#include "book3s.h"
7980

arch/powerpc/platforms/pseries/dtl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <asm/smp.h>
1313
#include <linux/uaccess.h>
1414
#include <asm/firmware.h>
15+
#include <asm/dtl.h>
1516
#include <asm/lppaca.h>
1617
#include <asm/debugfs.h>
1718
#include <asm/plpar_wrappers.h>

arch/powerpc/platforms/pseries/lpar.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <asm/fadump.h>
4141
#include <asm/asm-prototypes.h>
4242
#include <asm/debugfs.h>
43+
#include <asm/dtl.h>
4344

4445
#include "pseries.h"
4546

arch/powerpc/platforms/pseries/setup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#include <asm/idle.h>
7171
#include <asm/swiotlb.h>
7272
#include <asm/svm.h>
73+
#include <asm/dtl.h>
7374

7475
#include "pseries.h"
7576
#include "../../../../drivers/pci/pci.h"

arch/powerpc/platforms/pseries/svm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <asm/svm.h>
1212
#include <asm/swiotlb.h>
1313
#include <asm/ultravisor.h>
14+
#include <asm/dtl.h>
1415

1516
static int __init init_svm(void)
1617
{

0 commit comments

Comments
 (0)