From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Safonov Subject: [PATCH 22/32] timens: Add align for timens_offsets Date: Wed, 6 Feb 2019 00:10:56 +0000 Message-ID: <20190206001107.16488-23-dima@arista.com> References: <20190206001107.16488-1-dima@arista.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20190206001107.16488-1-dima@arista.com> Sender: linux-kernel-owner@vger.kernel.org To: linux-kernel@vger.kernel.org Cc: Dmitry Safonov , Adrian Reber , Andrei Vagin , Andrei Vagin , Andy Lutomirski , Andy Tucker , Arnd Bergmann , Christian Brauner , Cyrill Gorcunov , Dmitry Safonov <0x7f454c46@gmail.com>, "Eric W. Biederman" , "H. Peter Anvin" , Ingo Molnar , Jeff Dike , Oleg Nesterov , Pavel Emelyanov , Shuah Khan , Thomas Gleixner , containers@lists.linux-foundation.org, criu@openvz.org, linux-api@vger.kernel.org, x86@kernel.org List-Id: linux-api@vger.kernel.org Align offsets so that time namespace will work for ia32 applications on x86_64 host. Signed-off-by: Dmitry Safonov --- include/linux/timens_offsets.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/linux/timens_offsets.h b/include/linux/timens_offsets.h index 777530c46852..f2a03d4f7a91 100644 --- a/include/linux/timens_offsets.h +++ b/include/linux/timens_offsets.h @@ -2,9 +2,17 @@ #ifndef _LINUX_TIME_OFFSETS_H #define _LINUX_TIME_OFFSETS_H +/* + * Time offsets need align as they're placed on VVAR page, + * which is used by x86_64 and ia32 VDSO code. + * On ia32 offset::tv_sec (u64) has align(4), so re-align offsets + * to the same positions as 64-bit offsets. + * On 64-bit big-endian systems VDSO should convert to timespec64 + * to timespec because of a padding occurring between the fields. + */ struct timens_offsets { - struct timespec64 monotonic_time_offset; - struct timespec64 monotonic_boottime_offset; + struct timespec64 monotonic_time_offset __aligned(8); + struct timespec64 monotonic_boottime_offset __aligned(8); }; #endif -- 2.20.1