From patchwork Tue Mar 29 13:44:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joao Martins X-Patchwork-Id: 8687301 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5A658C0553 for ; Tue, 29 Mar 2016 13:47:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A37E0202F8 for ; Tue, 29 Mar 2016 13:47:15 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CCE6F20154 for ; Tue, 29 Mar 2016 13:47:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aktwZ-0007P7-6u; Tue, 29 Mar 2016 13:44:27 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aktwY-0007P1-DZ for xen-devel@lists.xen.org; Tue, 29 Mar 2016 13:44:26 +0000 Received: from [85.158.143.35] by server-1.bemta-6.messagelabs.com id 72/6D-29237-9B68AF65; Tue, 29 Mar 2016 13:44:25 +0000 X-Env-Sender: joao.m.martins@oracle.com X-Msg-Ref: server-3.tower-21.messagelabs.com!1459259064!5881811!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 2324 invoked from network); 29 Mar 2016 13:44:25 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-3.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 29 Mar 2016 13:44:25 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u2TDiKxR003504 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 29 Mar 2016 13:44:21 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u2TDiKNM012601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 29 Mar 2016 13:44:20 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u2TDiJWu007712; Tue, 29 Mar 2016 13:44:19 GMT Received: from localhost.localdomain (/193.126.154.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 29 Mar 2016 06:44:18 -0700 From: Joao Martins To: xen-devel@lists.xen.org Date: Tue, 29 Mar 2016 14:44:06 +0100 Message-Id: <1459259051-4943-2-git-send-email-joao.m.martins@oracle.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1459259051-4943-1-git-send-email-joao.m.martins@oracle.com> References: <1459259051-4943-1-git-send-email-joao.m.martins@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: Keir Fraser , Joao Martins , Ian Jackson , Jan Beulich , Tim Deegan Subject: [Xen-devel] [PATCH v2 1/6] public/xen.h: add flags field to vcpu_time_info X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This field has two possible flags (as of latest pvclock ABI shared with KVM). flags: bits in this field indicate extended capabilities coordinated between the guest and the hypervisor. Specifically on KVM, availability of specific flags has to be checked in 0x40000001 cpuid leaf. On Xen, we don't have that but we can still check some of the flags after registering the time info page since a force_update_vcpu_system_time is performed. Current flags are: flag bit | cpuid bit | meaning ------------------------------------------------------------- | | time measures taken across 0 | 24 | multiple cpus are guaranteed to | | be monotonic ------------------------------------------------------------- | | guest vcpu has been paused by 1 | N/A | the host | | ------------------------------------------------------------- Signed-off-by: Joao Martins Acked-by: Jan Beulich --- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan Changes since v1: - flags and pad are both uint8_t. - fix indentation with the other fields in the struct. --- xen/include/public/xen.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index 64ba7ab..b263fe3 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -614,10 +614,14 @@ struct vcpu_time_info { */ uint32_t tsc_to_system_mul; int8_t tsc_shift; - int8_t pad1[3]; + uint8_t flags; + uint8_t pad1[2]; }; /* 32 bytes */ typedef struct vcpu_time_info vcpu_time_info_t; +#define PVCLOCK_TSC_STABLE_BIT (1 << 0) +#define PVCLOCK_GUEST_STOPPED (1 << 1) + struct vcpu_info { /* * 'evtchn_upcall_pending' is written non-zero by Xen to indicate