Commit a1339d63 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents a527a2b3 41131a5e
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -103,6 +103,8 @@ int gettimeofday_fallback(struct __kernel_old_timeval *_tv, struct timezone *_tz
	return do_syscall_2(__NR_gettimeofday, (unsigned long)_tv, (unsigned long)_tz);
}

#ifdef __powerpc64__

static __always_inline
int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
{
@@ -115,10 +117,22 @@ int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
	return do_syscall_2(__NR_clock_getres, _clkid, (unsigned long)_ts);
}

#ifdef CONFIG_VDSO32
#else

#define BUILD_VDSO32		1

static __always_inline
int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
{
	return do_syscall_2(__NR_clock_gettime64, _clkid, (unsigned long)_ts);
}

static __always_inline
int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
{
	return do_syscall_2(__NR_clock_getres_time64, _clkid, (unsigned long)_ts);
}

static __always_inline
int clock_gettime32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
{
+8 −0
Original line number Diff line number Diff line
@@ -187,6 +187,12 @@ SECTIONS
	.init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
		_sinittext = .;
		INIT_TEXT

		/*
		 *.init.text might be RO so we must ensure this section ends on
		 * a page boundary.
		 */
		. = ALIGN(PAGE_SIZE);
		_einittext = .;
#ifdef CONFIG_PPC64
		*(.tramp.ftrace.init);
@@ -200,6 +206,8 @@ SECTIONS
		EXIT_TEXT
	}

	. = ALIGN(PAGE_SIZE);

	INIT_DATA_SECTION(16)

	. = ALIGN(8);