Skip to content

Commit 0704bf4

Browse files
t-8chKAGA-KOKO
authored andcommitted
vdso: Introduce vdso/cache.h
The vDSO implementation can only include headers from the vdso/ namespace. To enable the usage of ____cacheline_aligned from the vDSO, move it and its dependencies into a new header vdso/cache.h. Keep compatibility by including vdso/cache.h from linux/cache.h. Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 8770a91 commit 0704bf4

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

include/linux/cache.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
#define __LINUX_CACHE_H
44

55
#include <uapi/linux/kernel.h>
6+
#include <vdso/cache.h>
67
#include <asm/cache.h>
78

89
#ifndef L1_CACHE_ALIGN
910
#define L1_CACHE_ALIGN(x) __ALIGN_KERNEL(x, L1_CACHE_BYTES)
1011
#endif
1112

12-
#ifndef SMP_CACHE_BYTES
13-
#define SMP_CACHE_BYTES L1_CACHE_BYTES
14-
#endif
15-
1613
/**
1714
* SMP_CACHE_ALIGN - align a value to the L2 cacheline size
1815
* @x: value to align
@@ -63,10 +60,6 @@
6360
#define __ro_after_init __section(".data..ro_after_init")
6461
#endif
6562

66-
#ifndef ____cacheline_aligned
67-
#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
68-
#endif
69-
7063
#ifndef ____cacheline_aligned_in_smp
7164
#ifdef CONFIG_SMP
7265
#define ____cacheline_aligned_in_smp ____cacheline_aligned

include/vdso/cache.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef __VDSO_CACHE_H
3+
#define __VDSO_CACHE_H
4+
5+
#include <asm/cache.h>
6+
7+
#ifndef SMP_CACHE_BYTES
8+
#define SMP_CACHE_BYTES L1_CACHE_BYTES
9+
#endif
10+
11+
#ifndef ____cacheline_aligned
12+
#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
13+
#endif
14+
15+
#endif /* __VDSO_ALIGN_H */

0 commit comments

Comments
 (0)