Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4036425imm; Mon, 18 Jun 2018 08:09:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIK6YtlKUMPxCiCfetLQFT70x+qhKFSYGaDHIzNiTIxT0MD/OiR8+atsBuAwN0s7oMTqeWg X-Received: by 2002:a17:902:8b8c:: with SMTP id ay12-v6mr14510635plb.74.1529334549203; Mon, 18 Jun 2018 08:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529334549; cv=none; d=google.com; s=arc-20160816; b=b9NrfD3qBWKdJEKHFMraQC8SQ5jOPKAOx/d3t+/LfpnMTfDFG1tgHhN9iekXVOKJBB ujTeQM6hXAhkbMHJxuCUmb/bg4njB7Y8MhUOADXbNKDCoDwxKdZWjiTy+8xHCp8H3rtZ 9borhIljEUQ2PVxDCrGbqvAWqOkpuP2maU7hGzvw9AymS6bNJ+et3uQkfuQecCSoEvRG 2vt1SjlRIVqNXCIclbj1B0u0Zmn/wN89j71TRNpDILYtM/G2hJaFLpFzPy4hTMKnqS2m 6Hde3se5vkW/moIBLi9bCUPW9UGkSjp7Z7y1kWL8z0LPGatmfqX3JnllpIgvvB3JfVpw vzUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=PsEKIth0yuD0OAInqjn4dCvytZqYsNPOy0i7kE2wFdY=; b=lR5MQ1qll/cUOpbojzvMszFKZYQ3dnmowy3cAgQls7KkOna0ZG5XX+ncnkXoTf0Kgm YaYgCHxCIYwXahedj4mJ7lc7gCMCQBqbbaWpmTpN5ACps/2YrJdxt2T0VKTbN7uYgNJ7 tn7dQetnAGKT4wPxGB+x4y5JEVqjGE/LaCk2SNcVkRUQ9X7pX6yBaWxNv5TPsOijK9MK sNF5c5C4rudN51pOk1gjgGDT4R3zWLgAM+QN5bzRl5ZoU6GgL3xYTui7vt3h6TLq2EfH 1wfELiRH2lK+TOms8AVeKbiEPCbReLa9qa2iUSUSpAoVvdxVCjonsm/b0WbWBEFcu/SI zHsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=SW2qgV9g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=android.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2-v6si15198281pfm.26.2018.06.18.08.08.54; Mon, 18 Jun 2018 08:09:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=SW2qgV9g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=android.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935515AbeFRPHi (ORCPT + 99 others); Mon, 18 Jun 2018 11:07:38 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36721 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964863AbeFRPHf (ORCPT ); Mon, 18 Jun 2018 11:07:35 -0400 Received: by mail-pf0-f193.google.com with SMTP id a12-v6so8331772pfi.3 for ; Mon, 18 Jun 2018 08:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PsEKIth0yuD0OAInqjn4dCvytZqYsNPOy0i7kE2wFdY=; b=SW2qgV9gUxmDo8BceOqZTHEWjBg/suiS5a7jTJo/EWYcUC0OXUYjrZPfen1kCnkc26 dp9GczJ8UAZ3dmOI9uq32bjuFwAPY9cNLr00O83I6cPq3/yOlQ9izrm637Wahvj2WVsM 3L+7F/+Peqi58miC4BzumJdEtvKrL9dkDGmBMrN3VHTtEcymtGISCZVL6Bqrq1fekZ8e iZAm3quaThXyLy52QnoZ0N7U3hl89LXM8S71mEpIJEqJjz62RlVjX0YLHZ9eS3MbnDR7 zrFX6jjALPmGjp3ImIvw+HCF/QavxrAyVyYilK0WhkUZNzVLSL5PLnmEyDxaEHxaszah gvjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PsEKIth0yuD0OAInqjn4dCvytZqYsNPOy0i7kE2wFdY=; b=BhnGUZrhMM4WzUK4tbcEqTghihwX24XM5E1n+7rMZim86T/O3/ljAa1BiKW8IDkT9+ eap+stYo4+s1ryNLpVx5eJzuKrBs3JpaH/S7AQwP48S6ur6gbsQyNrU29hrET5Qrot/h TszvVsZYktTSlSqXUl5/ZglM18HjlCVvaCOmUCJoWbYDG83Y7bdxlopPjzszH94asI1U tgQ/vJ6ytBzdytW4lDSeNP89BC46muEUmhI+cG7fJkL+EiF09a/e6YPb8zdT4Dd/Y6NP +nakVXblLDBnbQVIrqIPrdvJQh4cbMOULw7TqxaP3tbjAcx/jV6hSGT0ecIUZUpYGRFS DvSg== X-Gm-Message-State: APt69E24ch8ITRMUXeZqkMBYCxboaOfd5qd4jNlFKtz2JfBOTdufMITG PFtrqix1NQvx/53mznnE/ehwR1/GDyg= X-Received: by 2002:a63:ba56:: with SMTP id l22-v6mr11398232pgu.161.1529334454265; Mon, 18 Jun 2018 08:07:34 -0700 (PDT) Received: from nebulus.mtv.corp.google.com ([2620:0:1000:1611:6077:8eec:bc7e:d0f4]) by smtp.gmail.com with ESMTPSA id i7-v6sm54830660pfa.34.2018.06.18.08.07.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jun 2018 08:07:33 -0700 (PDT) From: Mark Salyzyn To: linux-kernel@vger.kernel.org Cc: Mark Salyzyn , James Morse , Russell King , Catalin Marinas , Will Deacon , Andy Lutomirski , Dmitry Safonov , John Stultz , Mark Rutland , Laura Abbott , Kees Cook , Ard Biesheuvel , Andy Gross , Kevin Brodsky , Andrew Pinski , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Jeremy Linton , Ingo Molnar , "Paul E. McKenney" Subject: RESEND [PATCH v5 08/12] arm: vdso: Add ARCH_CLOCK_FIXED_MASK Date: Mon, 18 Jun 2018 08:05:54 -0700 Message-Id: <20180618150613.10322-9-salyzyn@android.com> X-Mailer: git-send-email 2.18.0.rc1.244.gcf134e6275-goog In-Reply-To: <20180618150613.10322-1-salyzyn@android.com> References: <20180618150613.10322-1-salyzyn@android.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Take an effort to recode the arm64 vdso code from assembler to C previously submitted by Andrew Pinski , rework it for use in both arm and arm64, overlapping any optimizations for each architecture. But instead of landing it in arm64, land the result into lib/vdso and unify both implementations to simplify future maintenance. Add ARCH_CLOCK_FIXED_MASK as an efficiency since arm64 has no purpose for cs_mask vdso_data variable. Signed-off-by: Mark Salyzyn Cc: James Morse Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Andy Lutomirski Cc: Dmitry Safonov Cc: John Stultz Cc: Mark Rutland Cc: Laura Abbott Cc: Kees Cook Cc: Ard Biesheuvel Cc: Andy Gross Cc: Kevin Brodsky Cc: Andrew Pinski Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: Jeremy Linton v4: - New in series, split off from earlier. v5: - rebase --- arch/arm/vdso/vgettimeofday.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm/vdso/vgettimeofday.c b/arch/arm/vdso/vgettimeofday.c index a354586f8a65..3005479efbe8 100644 --- a/arch/arm/vdso/vgettimeofday.c +++ b/arch/arm/vdso/vgettimeofday.c @@ -128,7 +128,11 @@ static notrace int do_realtime(const struct vdso_data *vd, struct timespec *ts) { u32 seq, mult, shift; u64 nsec, cycle_last; +#ifdef ARCH_CLOCK_FIXED_MASK + static const u64 mask = ARCH_CLOCK_FIXED_MASK; +#else u64 mask; +#endif vdso_xtime_clock_sec_t sec; do { @@ -141,7 +145,9 @@ static notrace int do_realtime(const struct vdso_data *vd, struct timespec *ts) mult = vd->cs_mono_mult; shift = vd->cs_shift; +#ifndef ARCH_CLOCK_FIXED_MASK mask = vd->cs_mask; +#endif sec = vd->xtime_clock_sec; nsec = vd->xtime_clock_snsec; @@ -161,7 +167,11 @@ static notrace int do_monotonic(const struct vdso_data *vd, struct timespec *ts) { u32 seq, mult, shift; u64 nsec, cycle_last; +#ifdef ARCH_CLOCK_FIXED_MASK + static const u64 mask = ARCH_CLOCK_FIXED_MASK; +#else u64 mask; +#endif vdso_wtm_clock_nsec_t wtm_nsec; __kernel_time_t sec; @@ -175,7 +185,9 @@ static notrace int do_monotonic(const struct vdso_data *vd, struct timespec *ts) mult = vd->cs_mono_mult; shift = vd->cs_shift; +#ifndef ARCH_CLOCK_FIXED_MASK mask = vd->cs_mask; +#endif sec = vd->xtime_clock_sec; nsec = vd->xtime_clock_snsec; @@ -200,7 +212,11 @@ static notrace int do_monotonic_raw(const struct vdso_data *vd, { u32 seq, mult, shift; u64 nsec, cycle_last; +#ifdef ARCH_CLOCK_FIXED_MASK + static const u64 mask = ARCH_CLOCK_FIXED_MASK; +#else u64 mask; +#endif vdso_raw_time_sec_t sec; do { @@ -213,7 +229,9 @@ static notrace int do_monotonic_raw(const struct vdso_data *vd, mult = vd->cs_raw_mult; shift = vd->cs_shift; +#ifndef ARCH_CLOCK_FIXED_MASK mask = vd->cs_mask; +#endif sec = vd->raw_time_sec; nsec = vd->raw_time_nsec; -- 2.18.0.rc1.244.gcf134e6275-goog