From patchwork Fri Dec 20 21:21:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11306345 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 7DF9A13B6 for ; Fri, 20 Dec 2019 21:22:39 +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 56838206DA for ; Fri, 20 Dec 2019 21:22:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eVRthahO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56838206DA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org 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 1iiPhw-0004rZ-5p; Fri, 20 Dec 2019 21:21:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iiPhu-0004rU-MK for xen-devel@lists.xenproject.org; Fri, 20 Dec 2019 21:21:10 +0000 X-Inumbo-ID: a326f518-236e-11ea-a914-bc764e2007e4 Received: from mail-wm1-x341.google.com (unknown [2a00:1450:4864:20::341]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id a326f518-236e-11ea-a914-bc764e2007e4; Fri, 20 Dec 2019 21:21:08 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id d139so10360780wmd.0 for ; Fri, 20 Dec 2019 13:21:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4ffelIFJTzhSS9sw/VI5ijX/3laM20yZv6P8SPKhRj8=; b=eVRthahOHFw4grqzEG9ZnPqU4fjocBZ8ukAFYF9EwUSvs9ID9boSDoblOICvYcS5yx 2WJsSflqU9CPrt1APNsBPqmwicT6hcu68qyXruoQ5h0lgJf8vJMhlC1Gh6R7XsSOr6tU RsIxbu3o2RZmvjg2hTM4nboZHpBzR1pL2D6wDpUdtEozRHhyXsGQEk0dkjsv3ZtSihgZ qL3ahpima6eDYffqPezA92aIgPuSvFP14NClF1SZr65ERMy1WKUQRQWkVrh0ITxNRz13 YO7+OB5Tfq15ClpCQxnzuBgVtPLerjQ7GmhqyLR/0uAnX0yNCSIvSow9aQ3JAaj2v4S6 ZRIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4ffelIFJTzhSS9sw/VI5ijX/3laM20yZv6P8SPKhRj8=; b=naa5Fr/I47mLBivn3qWfkUin0ELmPFIJEVMRLCaItaWNeLlULW4SsK91bwFPuQd2zE wm4ID3EcT/bsZCObVw3B8y1H72h06rkuaPUoz2NfhIaweLxxkHu+ImFQOnn0aWB8tfHU Ho3H2IReltUWTBZFQN0v8Dsk43/Nvfwt9mPFYVqd1McuJHtlm1UoGSLX1XIxQsdYvOw9 ivysuE+QlT0oaBo+Y0dJAV2M92s/M2ugSt/smiuo+GkN/xBG3BbtBqrOEmAda18utoiC K7nSJ6k9/2QldJQB+UtogPeeHf45m2xrbA75Ob+AYV1P+vzw7P0j9vYOAxzZfunnliLN psXg== X-Gm-Message-State: APjAAAUu7HTOlH1jadkKDBhVak1m1f3xii6PBRUHFmeZqJoVWhc5gZC9 gKQ8p3TVbDrI7h6SE1LSXqs/gY6MJeU= X-Google-Smtp-Source: APXvYqxb0IctU0dgeXlvLrGhPpmZzCmyZmldE6IZc91VSgn726K8fcK/+ZU2nlyvE0TvsoFmsC+0zA== X-Received: by 2002:a1c:638a:: with SMTP id x132mr19851397wmb.43.1576876867391; Fri, 20 Dec 2019 13:21:07 -0800 (PST) Received: from debian.mshome.net (38.163.200.146.dyn.plus.net. [146.200.163.38]) by smtp.gmail.com with ESMTPSA id x6sm10703200wmi.44.2019.12.20.13.21.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2019 13:21:06 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Fri, 20 Dec 2019 21:21:03 +0000 Message-Id: <20191220212103.4192-1-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191220195135.20130-1-liuwe@microsoft.com> References: <20191220195135.20130-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 5/4] x86/viridian: drop a wrong invalid value from reference TSC implementation 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: Wei Liu , Wei Liu , Paul Durrant , Andrew Cooper , Paul Durrant , Michael Kelley , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The only invalid value mentioned in Hyper-V TLFS 5.0c is 0. Michael Kelley confirmed that 0xFFFFFFFF was never used [0]. [0] https://lists.xen.org/archives/html/xen-devel/2019-12/msg01564.html Signed-off-by: Wei Liu --- xen/arch/x86/hvm/viridian/time.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/xen/arch/x86/hvm/viridian/time.c b/xen/arch/x86/hvm/viridian/time.c index 6b2d745f3a..b8280a1a60 100644 --- a/xen/arch/x86/hvm/viridian/time.c +++ b/xen/arch/x86/hvm/viridian/time.c @@ -45,14 +45,9 @@ static void update_reference_tsc(const struct domain *d, bool initialize) if ( !host_tsc_is_safe() || d->arch.vtsc ) { /* - * The specification states that valid values of TscSequence range - * from 0 to 0xFFFFFFFE. The value 0xFFFFFFFF is used to indicate - * this mechanism is no longer a reliable source of time and that - * the VM should fall back to a different source. - * - * Server 2012 (6.2 kernel) and 2012 R2 (6.3 kernel) actually - * violate the spec. and rely on a value of 0 to indicate that this - * enlightenment should no longer be used. + * The value 0 is used to indicate this mechanism is no longer a + * reliable source of time and that the VM should fall back to a + * different source. */ p->tsc_sequence = 0; @@ -77,7 +72,7 @@ static void update_reference_tsc(const struct domain *d, bool initialize) smp_wmb(); seq = p->tsc_sequence + 1; - if ( seq == 0xFFFFFFFF || seq == 0 ) /* Avoid both 'invalid' values */ + if ( seq == 0 ) /* Avoid 'invalid' value */ seq = 1; p->tsc_sequence = seq;