From patchwork Mon Sep 2 18:27:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?RWR3aW4gVMO2csO2aw==?= X-Patchwork-Id: 11127003 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 5AEFF1398 for ; Mon, 2 Sep 2019 18:28:41 +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 3698621881 for ; Mon, 2 Sep 2019 18:28:41 +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="XgaxxpBJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3698621881 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 1i4r2n-0000zz-RZ; Mon, 02 Sep 2019 18:27:13 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i4r2m-0000zp-HY for xen-devel@lists.xenproject.org; Mon, 02 Sep 2019 18:27:12 +0000 X-Inumbo-ID: 46fce2c6-cdaf-11e9-aea6-12813bfff9fa Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 46fce2c6-cdaf-11e9-aea6-12813bfff9fa; Mon, 02 Sep 2019 18:27:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1567448831; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=BNbJDeL7n3GUij8kmCerF8nHYnoM5Ik1SO8rhN54eTA=; b=XgaxxpBJdZ7RomJDxVRwMOziNTFmvcWQzwjN3jdHiD2f/LDFP0yJQPiQ qjvJgr6szIKVbntrsqxjWgmw4TPEAYAgv6yD1Nry+ln1x7HCjsPdyzThv uOqSklLaxfaA0pNz6SPFXwRV8DzmsatO1dASk5OW9R7EagvV/vdU2wPgh g=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=edvin.torok@citrix.com; spf=Pass smtp.mailfrom=edvin.torok@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of edvin.torok@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="edvin.torok@citrix.com"; x-sender="edvin.torok@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of edvin.torok@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="edvin.torok@citrix.com"; x-sender="edvin.torok@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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="edvin.torok@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: CY+jcC1NA8tcoSLcGcjEDPFklu3NeiSMmsxTGX1VNuqINar7kF8UQ4ifml9DzzDKV4chcfo/22 xoLcDg5wui6PMBiKodYqTLrMEdYfMC/VTrT0YrybPqeQofrfufL5iK4JOy3ydPdSNyuZkHy6DJ dqdMg70V+KKXXhk63D4T9oWBoo2J+RG4/L8cK6IWCJqpxbELw4/sqzYk/bKM+VEcjbnsdpHD21 9EoWsQmFUpfiCSMDVwXKEIdJ50KSpL/dMzL1D0yDFqAFVKLFw95X2zqoRBW/mz48CtOuyK7cqk hZM= X-SBRS: 2.7 X-MesageID: 5212107 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,460,1559534400"; d="scan'208";a="5212107" From: =?utf-8?b?RWR3aW4gVMO2csO2aw==?= To: Date: Mon, 2 Sep 2019 19:27:06 +0100 Message-ID: X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 0/1] Avoiding RDTSC emulation due to host clock drift 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: Andrew Cooper , Wei Liu , =?utf-8?b?RWR3aW4gVMO2csO2aw==?= , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" I noticed that RDTSC emulation got turned on for a VM after a suspend/host-reboot/resume cycle. Xen currently expects an exact match between host CPU and saved guest CPU frequency in KHz, otherwise it turns on RDTSC emulation if the CPU doesn't support TSC scaling. An exact match would require ~0.4 ppm accuracy, and even on physical hardware the platform timer used for calibration is not that accurate. The best accuracy I could find that datasheets/specifications require is 100 ppm, so let Xen accept a 100 ppm difference in clock frequency as "the same" and do not turn on RDTSC emulation due to that. So far I have manually tested this on Intel(R) Xeon(R) CPU E5-2697 v3 and a Debian 9 guest, more tests pending. See the commit for more details. Edwin Török (1): x86/arch: VM resume: avoid RDTSC emulation due to host clock drift xen/arch/x86/time.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)