Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2965431ybh; Mon, 5 Aug 2019 09:41:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpJvuV46AiT+SlJxYub6fmhoHBesC4D6JPHeFBFSGCjAy9aUCkUCnSiBHOc/xQaUqoLVac X-Received: by 2002:a65:5082:: with SMTP id r2mr110413602pgp.170.1565023311133; Mon, 05 Aug 2019 09:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565023311; cv=none; d=google.com; s=arc-20160816; b=E8X0vIbpFiuPechr09xdnP3gy8O5OLMJbHYMf9u0puf+TuoKZzJMDIFbdCWiCcUblR zs82k0DwFfBD4/4CbuJVmZWl9ZuC/CtCh7VOyvg8yX0ZplzcrqPFEZlMrTNIJWVuBuQt +TzSNtgv/Ze+YsCW74CopvzlioR39KuzuVkEMb3vgETPDLSGuukB6pEStFAPPHTeduzY 2D3LdF7/spuWyMj1wChSdiyrKm2zwoPgMbB86HEY6geyDnD0q7GAhLOOk/btr/5TM0jG MIqqJi0JcUPww9iWEBXulylbAm85SvxZyoja0RlMiMQBcl6O17Hpb9ik4h5wXhLSnBDy gg2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:date:in-reply-to:message-id :subject:cc:to:user-agent:references:from:dkim-signature; bh=ABajkI5eExlI/xSitmeiji8gDOSYLzGBroq8lVBwkdg=; b=TbtuYD3Hivx3NNVu251G28wi1kRlf58GauNWU5wzK9qs96LvPmlZF7tvN4H7yszerN lDB/vcYfQEhjX9PDVGsPNjI9mmhpLF1C/n+pBRj9TEPqyFl6X+NoTydfOxGDHVUq09vP BrljPEHUxfaGzfjWabzbhRp4IObptJWmsHlzCniZohVDwgp8JAZwMmsjd5yJ+9n2++mS 9TdhC/N54qKKv/QWVkf9fWduvygrB+cbia7asdJi1gBrsKv2YhgREMt0CGby29cb5qPT olmiq5G5PVjM37KRB+WZ3rfAXZ8Pg08ek97UE0UDYMA5C3iXX+vyLPQeYjSBZHOJA60n fjtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Jf1TsCUn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si45286375pgr.172.2019.08.05.09.41.35; Mon, 05 Aug 2019 09:41:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Jf1TsCUn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728830AbfHEQlC (ORCPT + 99 others); Mon, 5 Aug 2019 12:41:02 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40564 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726559AbfHEQlC (ORCPT ); Mon, 5 Aug 2019 12:41:02 -0400 Received: by mail-wr1-f65.google.com with SMTP id r1so85034968wrl.7; Mon, 05 Aug 2019 09:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:references:user-agent:to:cc:subject:message-id:in-reply-to :date:mime-version; bh=ABajkI5eExlI/xSitmeiji8gDOSYLzGBroq8lVBwkdg=; b=Jf1TsCUn3vg9vZIttQpRDxQyLLdSkih/m9y3kA3yWVwK1tHBcluvzb64DtQ25oH1/V xc+QogvPb9pckGM5vfsy43/UEaWPZWupWkE5UPXHzZT5A7/7Ma3dw/KrHAyWf+SIQ5pr Dcvq5iH0eSbCNiujtHHwUJZ240xv7Qi/eds7T8oztvpIBx2XrJ5va7rgiLI/SzDbk43Q Z9ORvjpxuJo5BgjdcSStKB849ChK0G8vPO2yzLZGaqzz0g6WR36X48+GBvCQz9Tay6xs czQE6+3WjSb7nz9cH1JuMb4iiT+97q5c2zuu/BUbeRroBVjCzNGInLsmtjQPkR05iWcK 8OZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:references:user-agent:to:cc:subject :message-id:in-reply-to:date:mime-version; bh=ABajkI5eExlI/xSitmeiji8gDOSYLzGBroq8lVBwkdg=; b=ja333Nqtw20Mg9p87EzOhrEgYcG7GmjPnXLyAE4NJqb8hLRY9yagT4GFUZuohHJ2iR SAmnNigQGyxIXTdBfVu1ZmiFSDyC6AneB1xemr2cNDqdrSWKVN7wIHvKnAQbW87i3zL5 2yhFktPRlmgHyb+QfCQ9uOSWZs4O/b6z1deXeokbgBny6NOEFGBO3n25sHdGA2wA1+KA m4GALRztMhorwE0gqrRmO3FSmuWBup1q8j2x7eyTIqjnQOSEnKNiYUL7HQBeEJEQ4IAn 1Mr64JLB9LZNDW4q9FGYPZ3+PywIqfx2Q6j4YtdSh3rvHuSYYyy6/Fswk4l+xi6ykduS NKhg== X-Gm-Message-State: APjAAAVKtD726JUIa1WAiplMkkuru1+L8SojAzp9AdVuxovPwFYEwhzT ndKL1hSyrCfEkuxXvSgtEVL3KSef2ck= X-Received: by 2002:adf:f050:: with SMTP id t16mr791943wro.99.1565023259727; Mon, 05 Aug 2019 09:40:59 -0700 (PDT) Received: from ptitpuce ([2a01:e35:8b6a:1220:5461:8d4f:b809:4bf8]) by smtp.gmail.com with ESMTPSA id i12sm99839220wrx.61.2019.08.05.09.40.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 09:40:59 -0700 (PDT) From: Christophe de Dinechin X-Google-Original-From: Christophe de Dinechin References: <20190802145017.42543-1-steven.price@arm.com> <20190802145017.42543-2-steven.price@arm.com> User-agent: mu4e 1.3.2; emacs 26.2 To: Steven Price Cc: Catalin Marinas , Marc Zyngier , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Russell King , Will Deacon , James Morse , Julien Thierry , Suzuki K Pouloze , kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/9] KVM: arm64: Document PV-time interface Message-ID: In-reply-to: <20190802145017.42543-2-steven.price@arm.com> Date: Mon, 05 Aug 2019 18:40:54 +0200 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Steven Price writes: > Introduce a paravirtualization interface for KVM/arm64 based on the > "Arm Paravirtualized Time for Arm-Base Systems" specification DEN 0057A. > > This only adds the details about "Stolen Time" as the details of "Live > Physical Time" have not been fully agreed. > [...] > + > +Stolen Time > +----------- > + > +The structure pointed to by the PV_TIME_ST hypercall is as follows: > + > + Field | Byte Length | Byte Offset | Description > + ----------- | ----------- | ----------- | -------------------------- > + Revision | 4 | 0 | Must be 0 for version 0.1 > + Attributes | 4 | 4 | Must be 0 > + Stolen time | 8 | 8 | Stolen time in unsigned > + | | | nanoseconds indicating how > + | | | much time this VCPU thread > + | | | was involuntarily not > + | | | running on a physical CPU. I know very little about the topic, but I don't understand how the spec as proposed allows an accurate reading of the relation between physical time and stolen time simultaneously. In other words, could you draw Figure 1 of the spec from within the guest? Or is it a non-objective? For example, if you read the stolen time before you read CNTVCT_EL0, isn't it possible for a lengthy event like a migration to occur between the two reads, causing the stolen time to be obsolete and off by seconds? -- Cheers, Christophe de Dinechin (IRC c3d)