Skip to content

Commit a1339d6

Browse files
committed
Merge tag 'powerpc-5.11-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "One fix for a lack of alignment in our linker script, that can lead to crashes depending on configuration etc. One fix for the 32-bit VDSO after the C VDSO conversion. Thanks to Andreas Schwab, Ariel Marcovitch, and Christophe Leroy" * tag 'powerpc-5.11-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/vdso: Fix clock_gettime_fallback for vdso32 powerpc: Fix alignment bug within the init sections
2 parents a527a2b + 41131a5 commit a1339d6

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

arch/powerpc/include/asm/vdso/gettimeofday.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ int gettimeofday_fallback(struct __kernel_old_timeval *_tv, struct timezone *_tz
103103
return do_syscall_2(__NR_gettimeofday, (unsigned long)_tv, (unsigned long)_tz);
104104
}
105105

106+
#ifdef __powerpc64__
107+
106108
static __always_inline
107109
int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
108110
{
@@ -115,10 +117,22 @@ int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
115117
return do_syscall_2(__NR_clock_getres, _clkid, (unsigned long)_ts);
116118
}
117119

118-
#ifdef CONFIG_VDSO32
120+
#else
119121

120122
#define BUILD_VDSO32 1
121123

124+
static __always_inline
125+
int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
126+
{
127+
return do_syscall_2(__NR_clock_gettime64, _clkid, (unsigned long)_ts);
128+
}
129+
130+
static __always_inline
131+
int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
132+
{
133+
return do_syscall_2(__NR_clock_getres_time64, _clkid, (unsigned long)_ts);
134+
}
135+
122136
static __always_inline
123137
int clock_gettime32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
124138
{

arch/powerpc/kernel/vmlinux.lds.S

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ SECTIONS
187187
.init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
188188
_sinittext = .;
189189
INIT_TEXT
190+
191+
/*
192+
*.init.text might be RO so we must ensure this section ends on
193+
* a page boundary.
194+
*/
195+
. = ALIGN(PAGE_SIZE);
190196
_einittext = .;
191197
#ifdef CONFIG_PPC64
192198
*(.tramp.ftrace.init);
@@ -200,6 +206,8 @@ SECTIONS
200206
EXIT_TEXT
201207
}
202208

209+
. = ALIGN(PAGE_SIZE);
210+
203211
INIT_DATA_SECTION(16)
204212

205213
. = ALIGN(8);

0 commit comments

Comments
 (0)