Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp108683lqj; Wed, 10 Apr 2024 05:43:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUTvXkpqvOX7M+kfUBV71mOqU932iBT/2ehnU9C76q6WSHs0Q6Tek/Xlof7ZK6OWkBSXFFFm2aRHC19hmKy6+r+vguqLyG7nNkAW+3PhQ== X-Google-Smtp-Source: AGHT+IFVfZlb1GPqNE0xMXZpBSezJqFRPkxoKg3UzjzqTyXBtg6r4Da/g9uLAh/NLe3rwMVl/m45 X-Received: by 2002:a17:907:86a8:b0:a51:aec8:eae9 with SMTP id qa40-20020a17090786a800b00a51aec8eae9mr1908882ejc.10.1712753038972; Wed, 10 Apr 2024 05:43:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712753038; cv=pass; d=google.com; s=arc-20160816; b=OdEwWcFVhlpmKQZ8gygtBabFJrvkGO5NnPAHs7QzGWQg8ZMNp/MwvRyb78sx3t3KP/ 8OxwA0LQufmdoo3PZAPOBitm/1qXo5aWq5YNsTxV1zoCdivSbGnNgrL53h2B60CRox3K q1xwrjw6Aozet6Pq0r43n3ClY/ffieFIHHJ46gSz8ujrZVqzd49K1BdTJ/WQEauRHseL 15uj89ry+sEt6ugJ0nrM4VlLxUQmhEtQzqfKnZqjYafdrLg1T0H40s1olaDJlEzZn2Kc CN6gYDmyRfSdPZ9neHA9QexZktUMooZpbaTDE6+GFRmG5qCMYz3K5E7ZidTAXQ3qCjau kZIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:content-language :references:cc:to:subject:reply-to:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :from:dkim-signature; bh=s6W3q2bOeGE0BrRwL1fG865Gcw8RNsxpT6lmBauL/5w=; fh=LmxTKQdLXOuQgAFdT/U2SH/5W/fxyukrGOULVUp4iMY=; b=QPn3ebcnzEylGdVR9dgIpvyxRKesAxhTG/0Nrxne9R1YYSd4+FU6eg7qbMmOzs76vz ONOlatuk8x5XioOlIS5zWYIiTTi7eL9jjuCveoA8UvFn1dD5N/Bx+pmkzhNWdao9l/xN sBv6SXhZx/DGNmizPN6xlGrwHDfbbSROi5/nS3apCqOjT5FIK6mZatpXCWFB5Ecg7aEn yzq3e38L0bpjAf+B4AUwctNs+EJYQ+JYe9pYGMRrBf15gk+ltphxTZYZVZVRwYtnvpnc /RXHkzy4porPu1d4fYEz7N6A3F0Y5PyDSbmWwOkxxzw8uybG+Arvg01/aLeqmCmzmCq2 mLmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Np/w1Nmi"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-138519-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138519-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id jv1-20020a170907768100b00a4737ad5b74si5566207ejc.544.2024.04.10.05.43.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 05:43:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138519-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Np/w1Nmi"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-138519-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138519-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CD8691F21DF1 for ; Wed, 10 Apr 2024 12:43:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2596D15D5D4; Wed, 10 Apr 2024 12:43:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Np/w1Nmi" Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C052912EBEF; Wed, 10 Apr 2024 12:43:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712753011; cv=none; b=NdTenrI6Y2LyaDsEZGd2mP2/J3hbV57QHNrYaKEMgSvZRQGY1CTmXYQaEl5J1o3KtnxW2N0EtJsLmp0yK5Ba00p7UMEweea1PQGHX+Rsc0s4caWeWvw0aNgjsfdbPLLB2HNVkHiTp3/93yJJ9IWsUBJX1otnsnpBT9ZqRC//ops= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712753011; c=relaxed/simple; bh=ZIAOmvrnl59E0qA8D129ku06QXp/t0U+yZH7OIQvevA=; h=From:Message-ID:Date:MIME-Version:Subject:To:Cc:References: In-Reply-To:Content-Type; b=KwXu6epO1LlSL7VqUZUZk73pX537lJcF3DZud60UWpgOfX1tA0VGvxFkPa7RwARuGoJd9l3Qy1e+myyVYn06najZ0FUYe9VtwkFkwNM0hSsQErIZWuAbgQfhVwqTaT7QjQFTSbQKI5OEvWg4dcN/Zul4gtKSONwj35MdwQzZg/g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Np/w1Nmi; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4166d6dab3dso23328025e9.0; Wed, 10 Apr 2024 05:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712753008; x=1713357808; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:organization:content-language :references:cc:to:subject:reply-to:user-agent:mime-version:date :message-id:from:from:to:cc:subject:date:message-id:reply-to; bh=s6W3q2bOeGE0BrRwL1fG865Gcw8RNsxpT6lmBauL/5w=; b=Np/w1NmirFF4XcdCjJTrl8BuE1EdJXqSEaXVeczwbIjKJcbdHTm/E9RSXswwqi3qCm RL18G3TKu0ntrPGZbKgpEet/RrZ3p+v8ja/juMHKx4njL2TsXnOAvvtpcGUM7GIbZwtf 7nq0RYshnvYftaRuUy4zTZ4X7iRBX9N0x22rD4tuWahJ82390wknPcMSjj+vGDBP9jCT ueIwvL8xcdclm/i1Po9R8aC932VIETd5tg3CGpoWpMEAd0TYssxazcskL/L+XrslCB5l +HXMSiJ/54EM8EBKxWAxFRh9802HLj0a94iAzZTrUTw0crUkYx0OQbC/F/52CnrCTSAD eJeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712753008; x=1713357808; h=content-transfer-encoding:in-reply-to:organization:content-language :references:cc:to:subject:reply-to:user-agent:mime-version:date :message-id:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=s6W3q2bOeGE0BrRwL1fG865Gcw8RNsxpT6lmBauL/5w=; b=nSVe2+T3aHMlO2b2mWeCZWCJQw+C5gLLzYXmILzHHJ6vXotoOrFXU6jShq/+jogclD vw+IaUQoDMsggkvtI5phGOWTGcTV+unaDUatyQpdhZUTPhjcpKe3z/K2LGt0XwEqmSJK xQNzgw6+nYY6PNqN9CKRlgUI6SbPHjSlGf3xBzS4gD00A4QQP7IfAg5NV5Yn7LMJoYFo Ffz388bLToszsaChNac99e1iIy/SyCACI+RACpXMWefdNcCvI/H2yQdF93pSNkPrl06q vEVzNNhUGNfUcEqyUziYon2q2umlOztmwL7cPSt0dS+MZRmCtbzAAA2+l1t7337wzlOO JTSw== X-Forwarded-Encrypted: i=1; AJvYcCU3cNxS7QwEkgey7RsRzAIL6eYtP4c12E7MwUbgb41ZZaYb74ltrfadVj4x0eqKU1OOnGGRHugfg3wSfriG5tk59x+Av6+7QaSBsqU384ln2GB/+5qSrjBU9Gs9N/9wpr8ridF/b+jwANhb6UxpD+F2Ws9W/3Yh1vI3i/bX X-Gm-Message-State: AOJu0YzUtKPTB4rv5KVCWRgOwnvzuk6X7XN9I7KC8aFV1QQeVyFSOxhB eGZL5JmvumgvwceoqAnPdWB4pa1OhiPQMyluIYrXXViN5LholQoN X-Received: by 2002:a05:600c:4e88:b0:414:93df:bef1 with SMTP id f8-20020a05600c4e8800b0041493dfbef1mr1751654wmq.39.1712753007855; Wed, 10 Apr 2024 05:43:27 -0700 (PDT) Received: from [192.168.12.203] (54-240-197-228.amazon.com. [54.240.197.228]) by smtp.gmail.com with ESMTPSA id n15-20020a05600c500f00b00417c0fa4b82sm729506wmr.25.2024.04.10.05.43.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Apr 2024 05:43:27 -0700 (PDT) From: Paul Durrant X-Google-Original-From: Paul Durrant Message-ID: <26bfe5ec-e583-458d-8e43-e5ecdc5883cc@xen.org> Date: Wed, 10 Apr 2024 13:43:25 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: paul@xen.org Subject: Re: [PATCH v2 1/2] KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for accurate KVM clock migration To: David Woodhouse , Paul Durrant , Jack Allister Cc: bp@alien8.de, corbet@lwn.net, dave.hansen@linux.intel.com, hpa@zytor.com, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, pbonzini@redhat.com, seanjc@google.com, tglx@linutronix.de, x86@kernel.org, Dongli Zhang References: <20240408220705.7637-1-jalliste@amazon.com> <20240410095244.77109-1-jalliste@amazon.com> <20240410095244.77109-2-jalliste@amazon.com> <005911c5-7f9d-4397-8145-a1ad4494484d@xen.org> Content-Language: en-US Organization: Xen Project In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/04/2024 13:09, David Woodhouse wrote: > On 10 April 2024 11:29:13 BST, Paul Durrant wrote: >> On 10/04/2024 10:52, Jack Allister wrote: >>> + * It's possible that this vCPU doesn't have a HVCLOCK configured >>> + * but the other vCPUs may. If this is the case calculate based >>> + * upon the time gathered in the seqcount but do not update the >>> + * vCPU specific PVTI. If we have one, then use that. >> >> Given this is a per-vCPU ioctl, why not fail in the case the vCPU doesn't have HVCLOCK configured? Or is your intention that a GET/SET should always work if TSC is stable? > > It definitely needs to work for SET even when the vCPU hasn't been run yet (and doesn't have a hvclock in vcpu->arch.hv_clock). So would it make sense to set up hvclock earlier?