Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753929AbbFDRcS (ORCPT ); Thu, 4 Jun 2015 13:32:18 -0400 Received: from mail-am1on0100.outbound.protection.outlook.com ([157.56.112.100]:31232 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752058AbbFDRcR (ORCPT ); Thu, 4 Jun 2015 13:32:17 -0400 Authentication-Results: spf=fail (sender IP is 12.216.194.146) smtp.mailfrom=ezchip.com; ezchip.com; dkim=none (message not signed) header.d=none; From: Chris Metcalf To: CC: Chris Metcalf Subject: [PATCH] tile: vdso: use raw_read_seqcount_begin() in vdso Date: Thu, 4 Jun 2015 13:32:06 -0400 Message-ID: <1433439126-25855-1-git-send-email-cmetcalf@ezchip.com> X-Mailer: git-send-email 2.1.2 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;DB3FFO11FD053;1:9s1SKSw5/etaL9NIFm5jCpXcxeL4lukcD0FR7WN4/e3dPwKAPw5oEfsukPGQpGs9iHnZ4U2h2jQCDd9msmYRKC/nFxMfNmZWHexC3l/y+7ttu/GUOx4Uy3Je+tFWa42DhVuLWtaE/EX1DtWBlD87U94v/hoc4ED4sfndM8w6L5yTi6VqtYkUy2FPqQkYWRXHWVGIQ++0WXhi8A3mUJULxBivf8BCdB0eK0oqSiiAoTZbDXZTv8nm9HGB47BAV3UYvBbsKmO9UycRkEkge/3RNpXzrtLbHG5/R8yea5++Q9BSa1TfRtLC3aLuwFOM/rkFBLDHbC7T/BuWa1NHVwb6R3pCkV2hCubhy517ELROues= X-Forefront-Antispam-Report: CIP:12.216.194.146;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(339900001)(189002)(199003)(229853001)(50466002)(77156002)(50986999)(50226001)(86362001)(47776003)(6806004)(85426001)(87936001)(48376002)(62966003)(450100001)(36756003)(106476002)(68736005)(92566002)(81156007)(106356001)(33646002)(105606002)(104016003)(19580405001)(4001540100001)(5001830100001)(42186005)(5001860100001)(46102003)(97736004)(110136002)(189998001)(2351001)(19580395003)(106466001)(107886002)(64706001)(5001960100002)(9376004)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR02MB0775;H:ld-1.internal.tilera.com;FPR:;SPF:Fail;PTR:InfoNoRecords;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0775;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0680; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(520003)(5005006)(3002001);SRVR:DB5PR02MB0775;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0775; X-Forefront-PRVS: 0597911EE1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2015 17:32:13.6642 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3;Ip=[12.216.194.146];Helo=[ld-1.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR02MB0775 X-OriginatorOrg: ezchip.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Previously we were using read_seqcount_begin(), which works fine until lockdep is enabled in the kernel, at which point lockdep locking shows up in the vdso and userspace will take a GPV accessing a kernel-only SPR when calling gettimeofday() etc. Signed-off-by: Chris Metcalf --- arch/tile/kernel/vdso/vgettimeofday.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/tile/kernel/vdso/vgettimeofday.c b/arch/tile/kernel/vdso/vgettimeofday.c index 8bb21eda07d8..e63310c49742 100644 --- a/arch/tile/kernel/vdso/vgettimeofday.c +++ b/arch/tile/kernel/vdso/vgettimeofday.c @@ -67,7 +67,7 @@ static inline int do_realtime(struct vdso_data *vdso, struct timespec *ts) u64 ns; do { - count = read_seqcount_begin(&vdso->tb_seq); + count = raw_read_seqcount_begin(&vdso->tb_seq); ts->tv_sec = vdso->wall_time_sec; ns = vdso->wall_time_snsec; ns += vgetsns(vdso); @@ -86,7 +86,7 @@ static inline int do_monotonic(struct vdso_data *vdso, struct timespec *ts) u64 ns; do { - count = read_seqcount_begin(&vdso->tb_seq); + count = raw_read_seqcount_begin(&vdso->tb_seq); ts->tv_sec = vdso->monotonic_time_sec; ns = vdso->monotonic_time_snsec; ns += vgetsns(vdso); @@ -105,7 +105,7 @@ static inline int do_realtime_coarse(struct vdso_data *vdso, unsigned count; do { - count = read_seqcount_begin(&vdso->tb_seq); + count = raw_read_seqcount_begin(&vdso->tb_seq); ts->tv_sec = vdso->wall_time_coarse_sec; ts->tv_nsec = vdso->wall_time_coarse_nsec; } while (unlikely(read_seqcount_retry(&vdso->tb_seq, count))); @@ -119,7 +119,7 @@ static inline int do_monotonic_coarse(struct vdso_data *vdso, unsigned count; do { - count = read_seqcount_begin(&vdso->tb_seq); + count = raw_read_seqcount_begin(&vdso->tb_seq); ts->tv_sec = vdso->monotonic_time_coarse_sec; ts->tv_nsec = vdso->monotonic_time_coarse_nsec; } while (unlikely(read_seqcount_retry(&vdso->tb_seq, count))); @@ -137,7 +137,7 @@ struct syscall_return_value __vdso_gettimeofday(struct timeval *tv, /* The use of the timezone is obsolete, normally tz is NULL. */ if (unlikely(tz != NULL)) { do { - count = read_seqcount_begin(&vdso->tz_seq); + count = raw_read_seqcount_begin(&vdso->tz_seq); tz->tz_minuteswest = vdso->tz_minuteswest; tz->tz_dsttime = vdso->tz_dsttime; } while (unlikely(read_seqcount_retry(&vdso->tz_seq, count))); -- 2.1.2