From patchwork Thu Sep 12 14:05:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11143143 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F386314ED for ; Thu, 12 Sep 2019 14:06:46 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF4A32053B for ; Thu, 12 Sep 2019 14:06:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="TJ68ZUni" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF4A32053B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i8Pig-0001Xp-PR; Thu, 12 Sep 2019 14:05:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i8Pif-0001Xk-LE for xen-devel@lists.xenproject.org; Thu, 12 Sep 2019 14:05:09 +0000 X-Inumbo-ID: 53f0fb84-d566-11e9-a337-bc764e2007e4 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 53f0fb84-d566-11e9-a337-bc764e2007e4; Thu, 12 Sep 2019 14:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1568297109; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bxBrr/55ADRJAlA6Dtm59xtV89t4GvsDQ1fFvrVoMSI=; b=TJ68ZUniEzRpV3elamKY3gHnzPZ5ZVHCDjoSQYvYffxJmq+Wm0BdYCSE 5d2/2PJZ6HJYQ5rzfRq8dARB+ct34NmsZOuIXVeGhnyLgioRw6IwgMihN 6QG3n6xoPpUSeUCDCEsme3skiGmgNPNswaU3Qp95HxQhw4WiBGbNM9OJb Q=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=paul.durrant@citrix.com; spf=Pass smtp.mailfrom=Paul.Durrant@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of paul.durrant@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of Paul.Durrant@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="Paul.Durrant@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: ryZhcppRdJ/X1oPTB3BBnxyNpicYk4PcHKc0XB5Sktesi3btt9V4f56ZibTjXY7FkR+2k5KNYe /xzKCV4j8gDXRNtx3INWV+IQMrWeqQ48LQ2poFIxc3uy9tBlV6rOPzIbEOCkekNRgjZlffjEkE 5K22Fakq746ldf2TW2gPq0xV78dV2xxctd3bxEE0Obg/X8YcxgmSEVv/UUM1BdY8XpfIAAjbqW y/64fyl5LpkN9ZlvvREmDhzuOyzlOMF+uk2Gg4tkLjK0w0PxfDLG0lcQkkGT6bmZyKC8vd6+6f 5rQ= X-SBRS: 2.7 X-MesageID: 5538842 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,497,1559534400"; d="scan'208";a="5538842" From: Paul Durrant To: Date: Thu, 12 Sep 2019 15:05:04 +0100 Message-ID: <20190912140504.40853-1-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] public/xen.h: update the comment explaining 'Wallclock time' X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Paul Durrant , Jan Beulich Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Since commit 0629adfd80e "Actually set a HVM domain's time offset when it sets the RTC", the comment in the public header has been misleading, since it claims that wallclock time is only updated by control software. Moreover, the comments stating that wc_sec and wc_nsec are seconds and nanoseconds (respectively) in UTC since the Unix epoch are bogus. Their values are adjusted by the domain's time_offset_seconds value, which is updated by a guest write to the emulated RTC and hence the wallclock timezone is under guest control. This patch attempts to bring the comment in line with reality whilst keeping it reasonably short. Signed-off-by: Paul Durrant Acked-by: Jan Beulich --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu --- xen/include/public/xen.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index cef65c38e7..2755c5ad54 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -775,12 +775,17 @@ struct shared_info { xen_ulong_t evtchn_mask[sizeof(xen_ulong_t) * 8]; /* - * Wallclock time: updated only by control software. Guests should base - * their gettimeofday() syscall on this wallclock-base value. + * Wallclock time: updated by control software or RTC emulation. + * Guests should base their gettimeofday() syscall on this + * wallclock-base value. + * The valus of wc_sec and wc_nsec are offsets from the Unix epoch + * adjusted by the domain's 'time offset' (in seconds) as set either + * by XEN_DOMCTL_settimeoffset, or adjusted via a guest write to the + * emulated RTC. */ uint32_t wc_version; /* Version counter: see vcpu_time_info_t. */ - uint32_t wc_sec; /* Secs 00:00:00 UTC, Jan 1, 1970. */ - uint32_t wc_nsec; /* Nsecs 00:00:00 UTC, Jan 1, 1970. */ + uint32_t wc_sec; + uint32_t wc_nsec; #if !defined(__i386__) uint32_t wc_sec_hi; # define xen_wc_sec_hi wc_sec_hi