Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp21162imm; Thu, 4 Oct 2018 14:47:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV62k6KVMd+B2KC5hezumNSv1oy9VDU5Ybd3fY82eN8V5k0Fn1KXkqxekelbssg/IdeXqHG3E X-Received: by 2002:a17:902:830b:: with SMTP id bd11-v6mr8226122plb.249.1538689676652; Thu, 04 Oct 2018 14:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538689676; cv=none; d=google.com; s=arc-20160816; b=y7Phe+l/eTtXvGPE6wHbhBKTbcjyund9/srm/9T48tdChSLXK5xLsLVweQEKV9g8Sx x6zumXdm8zmtHL2FoszlFPcjdkA2wVry9+heboEVxOfN5PAj7eqZ5Bs4KNy7Fyk3+V6B FmGESbfWMw69ig1/6EXJqtP+KQH+4xpNVgiO4HHhniOD7TnGNZ1qE4RaLQiz1C0GcOvd 9wpS8BKcI0k6ledIaCbB0T/Z3t0AXe9CkFZKmbhqRDjqz9+B3J7dCtMnegbg9EQULf5R 6NrX860IzI2ttTK3xjo3e6yqymc1/B55kt/lVkw+ZpTigC0N5VnusHem45ruQt7fnqPE GbUg== 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:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=xDaEhZtT9LSkcHxtj2lSV+LctuPAqc/QoLC0/k70KPQ=; b=I6GVDke3Q7x4spBZbga/KW1oMbf2Uqz4wRlhJLaujPxnJdrqIHVYpN/NckP9K18n4G x/p2FCd7vguNbuTV82MC9xTuhmVMM2p5LTHLQB03x3T1SfERN7Dr8uPHiRJkwCWmHEWf lg64Y4kpHttoizdKUpj+Rol6oe5yeoCSzlEoYYETDIKFiLUVe/W6Lk5FPW+vVBrbBdiZ Fe2K6DPYuDK0FptEuqGUj8pz+sFeFzkWH2DsyGcq+WgtKNt2vR018sib/Q/lPJr1Yyr2 /+U4TbyZ3TarUN812iR8XJxIruupeX90uxkEx8Jh07dkPuBvXJ9zW8/v/4ksGmINrKDJ oi4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vjRv+KZP; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d38-v6si5351217pgb.30.2018.10.04.14.47.41; Thu, 04 Oct 2018 14:47:56 -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=@kernel.org header.s=default header.b=vjRv+KZP; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728076AbeJEEkm (ORCPT + 99 others); Fri, 5 Oct 2018 00:40:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:38826 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726570AbeJEEkm (ORCPT ); Fri, 5 Oct 2018 00:40:42 -0400 Received: from localhost (unknown [198.217.64.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 064042084D; Thu, 4 Oct 2018 21:45:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1538689524; bh=InnsUdNwXqlAxLJplMNU2wpUq83rkSw/pIrdNPKH5TI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=vjRv+KZPcs8g/HZVkhiNpiiUiOJmpAm1778Kc74mlwFuV+G/Hdntb6myBLuhcsAQN o55VuHGgXsnIn7kEpj7znDLTmfr+BVrKZ64xFFsVYFkk9BfCGD90ZnelnfG/08toBE E8lqyUfNDENVnz3Ii24wcyYDUPy8uxq42Ix0fi7Y= From: Andy Lutomirski To: x86@kernel.org Cc: LKML , Andy Lutomirski Subject: [PATCH 3/3] x86/vdso: Document vgtod_ts better Date: Thu, 4 Oct 2018 14:44:45 -0700 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After reading do_hres() and do_course() and scratching my head a bit, I figured out why the arithmetic is strange. Document it. Signed-off-by: Andy Lutomirski --- arch/x86/include/asm/vgtod.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h index d17b092b9f1b..69d05c6d47f5 100644 --- a/arch/x86/include/asm/vgtod.h +++ b/arch/x86/include/asm/vgtod.h @@ -13,6 +13,15 @@ typedef u64 gtod_long_t; typedef unsigned long gtod_long_t; #endif +/* + * There is one of these objects in the vvar page for each + * vDSO-accelerated clockid. For high-resolution clocks, this encodes + * the time corresponding to vsyscall_gtod_data.cycle_last. For coarse + * clocks, this encodes the actual time. + * + * To confuse the reader, for high-resolution clocks, nsec is left-shifted + * by vsyscall_gtod_data.shift. + */ struct vgtod_ts { u64 sec; u64 nsec; -- 2.17.1