Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5681719yba; Thu, 11 Apr 2019 03:32:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFeRvb2qJFxgq81zSu8blgk8oypKpuvnUMnC5h1eIM91ZNrmQZvyna7MMteBoDUNeJqB40 X-Received: by 2002:a63:ad4b:: with SMTP id y11mr44398148pgo.405.1554978759680; Thu, 11 Apr 2019 03:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554978759; cv=none; d=google.com; s=arc-20160816; b=jNO0tP0L2bVfQfLx838GGKV3XZrqwRLz1yRK7gm9HkxZz71VODVlrfyqQYyZIu+UYs i2glVSmecxi/5IsNBtoGFZGXUaCOUVPNepelMMuQqZ4U83Btp8Rr29O9/IJbwBI+7luP RUj1XM6YdHdnWt8D00+bpPR/n/nzTxFncUZzXrTB3Xa4BjWtgo9YCOJiBOlkSSqqNRpg Ex+fap4Fuk0g3DQsMn+M4Akeu+urZoAPUs5k/EsM7IS2lRWKJ3EuUd0L+WQrD61XmVh2 Clko7Bd76g5vYqiVTnheLUl4oJQebbEVLjDuN5MyzFavskmy4MakIW321lel3d7PrN3J BKqg== 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; bh=O7DkCrlKyVT3KBZM0hsKhSeSuqezOiBoBXelFKeEJtw=; b=Nuaj+MLMCgyY1RWVOnH/XX0QBeFgXRREyT9BqL67Bi6169LJKU4hZRo9YHjdI0Em1n qjQEcf2+fmFMnEwpic+2S7+jx84yX2YsxayhnywRQLt43mXj66QI3Xa//qS22C3by/d8 BkFwcniDDUbJsZFnUmPhntcOC8W1WG0HUf+Ba0Aul4gcG3jBDoh2kCRNPedQDTm1fqwY 0TT01Blb4J38HQa5ScOi1wY1ftoaZr4gT1xFHiGQuwKl2bVpTrnCl7c82NTb3c28tlEq VeP56meMPmeunFjnOc9gmuxVIRC1w01YBLK1f2tqqvJRYSNvVo/CkK2m1I7bq7yA6Stf 850A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@codeweavers.com header.s=6377696661 header.b=auYaCEDA; 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=fail (p=NONE sp=NONE dis=NONE) header.from=codeweavers.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l186si17198308pge.128.2019.04.11.03.32.23; Thu, 11 Apr 2019 03:32:39 -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=fail (test mode) header.i=@codeweavers.com header.s=6377696661 header.b=auYaCEDA; 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=fail (p=NONE sp=NONE dis=NONE) header.from=codeweavers.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726678AbfDKKas (ORCPT + 99 others); Thu, 11 Apr 2019 06:30:48 -0400 Received: from mail.codeweavers.com ([173.240.25.211]:55688 "EHLO mail.codeweavers.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726391AbfDKKas (ORCPT ); Thu, 11 Apr 2019 06:30:48 -0400 X-Greylist: delayed 1119 seconds by postgrey-1.27 at vger.kernel.org; Thu, 11 Apr 2019 06:30:47 EDT DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codeweavers.com; s=6377696661; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=O7DkCrlKyVT3KBZM0hsKhSeSuqezOiBoBXelFKeEJtw=; b=auYaCEDANdeUhA9vTduCWY5WY N7wWcbRUuLXskmxutGan44TBoS2IXAE8IbtcdPw6qrbbZiG9lay9xU7EYLV7gca3QagbGF1VCgdMj lGWEl9O4I9XI86QuGmTqCcLOrhbhiM1kGMXRO4y8qbMYVpSKzUUq6AzA6LcCQfS+VEJds=; Received: from vpn42.vpn.mn.codeweavers.com ([10.69.139.42] helo=merlot) by mail.codeweavers.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hEWgi-0000my-TY; Thu, 11 Apr 2019 05:12:10 -0500 Received: from daviesh by merlot with local (Exim 4.90_1) (envelope-from ) id 1hEWgf-0002cz-C4; Thu, 11 Apr 2019 11:12:05 +0100 From: Huw Davies To: linux kernel Cc: Thomas Gleixner , Andy Lutomirski Subject: [PATCH 3/3] x86/vdso: Add support for CLOCK_MONOTONIC_RAW in the vDSO Date: Thu, 11 Apr 2019 11:12:05 +0100 Message-Id: <20190411101205.10006-4-huw@codeweavers.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190411101205.10006-1-huw@codeweavers.com> References: <20190411101205.10006-1-huw@codeweavers.com> X-Spam-Score: -106.0 X-Spam-Report: Spam detection software, running on the system "mail.codeweavers.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This is particularly useful for Wine which needs to implement Win32 API clock functions whose values do not get adjusted by adjtimex(). Cc: Thomas Gleixner Cc: Andy Lutomirski Signed-off-by: Huw Davies --- arch/x86/entry/vsyscall/vsyscall_gtod.c | 6 ++++++ arch/x86/include/a [...] Content analysis details: (-106.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -100 USER_IN_WHITELIST From: address is in the user's white-list -6.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is particularly useful for Wine which needs to implement Win32 API clock functions whose values do not get adjusted by adjtimex(). Cc: Thomas Gleixner Cc: Andy Lutomirski Signed-off-by: Huw Davies --- arch/x86/entry/vsyscall/vsyscall_gtod.c | 6 ++++++ arch/x86/include/asm/vgtod.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/x86/entry/vsyscall/vsyscall_gtod.c b/arch/x86/entry/vsyscall/vsyscall_gtod.c index ddc6a71df87c..fe3458caf301 100644 --- a/arch/x86/entry/vsyscall/vsyscall_gtod.c +++ b/arch/x86/entry/vsyscall/vsyscall_gtod.c @@ -68,6 +68,12 @@ void update_vsyscall(struct timekeeper *tk) base->mult = tk->tkr_mono.mult; base->shift = tk->tkr_mono.shift; + base = &vdata->basetime[CLOCK_MONOTONIC_RAW]; + base->sec = tk->raw_sec; + base->nsec = tk->tkr_raw.xtime_nsec; + base->mult = tk->tkr_raw.mult; + base->shift = tk->tkr_raw.shift; + base = &vdata->basetime[CLOCK_REALTIME_COARSE]; base->sec = tk->xtime_sec; base->nsec = tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift; diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h index ae0d76491595..0b76ba884e25 100644 --- a/arch/x86/include/asm/vgtod.h +++ b/arch/x86/include/asm/vgtod.h @@ -30,7 +30,8 @@ struct vgtod_ts { }; #define VGTOD_BASES (CLOCK_TAI + 1) -#define VGTOD_HRES (BIT(CLOCK_REALTIME) | BIT(CLOCK_MONOTONIC) | BIT(CLOCK_TAI)) +#define VGTOD_HRES (BIT(CLOCK_REALTIME) | BIT(CLOCK_MONOTONIC) | \ + BIT(CLOCK_MONOTONIC_RAW) | BIT(CLOCK_TAI)) #define VGTOD_COARSE (BIT(CLOCK_REALTIME_COARSE) | BIT(CLOCK_MONOTONIC_COARSE)) /* -- 2.17.1