Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp162521rdb; Wed, 18 Oct 2023 23:52:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtyI7s68fZDgNkvHBAD7ISSwQfxIgZSIzN2UkTFOFw/KtJxw5V5QtcJwwJbAjGGJfxCQtH X-Received: by 2002:a17:903:1c1:b0:1c9:c579:d27e with SMTP id e1-20020a17090301c100b001c9c579d27emr1718825plh.52.1697698354633; Wed, 18 Oct 2023 23:52:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697698354; cv=none; d=google.com; s=arc-20160816; b=aGphT1rt/NqY6dtGSwweur6t/S8KFnYq2NJ46m6NxifFCRwltxoZdOGT98clA48Ohj w2/joM6ifqulWFoqZ0K/LUwiyMidATOS+pV0wWpRYy/BTLdoKr7JGN53+08yZJlq19r8 cIOeK+MfM1VVGvwA/CYxuVETJbl/8VYg/G2Q352QOTujc0eXoll+KNnrB8RXqKF6mDUC u9EiowlKgnoJuL+Wx3aFIwFZsNNPc2TXHw7cF0dNB5vzVYNbSDGaUlsO3krUMT6zkB8N Gr3Qus6R32k1Kbm9BJN/qgOSQabt6G5qxWevAAY8TZn9ODYse2S4DIRkxmJhjvLxgkQi czYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mw4Ufl/cOqWrZrf06coK8u2YQD70TRL1KhrXVtvZNrw=; fh=Ov7apNK3ohZVXAP/F6yJsJRRGuK+N6Tt+gY+TPqiLfw=; b=vyJjPs6+0EWxwM791lMGykSVO32PlxYz9CfI2QFhHzXloWLyv/aadrVj8D2RoafS2z vFCYxTMYyCwtVm6lAujc1ekf9WRSB9g2RXRMQQ3LWnl4qEmYjPmd9dCDz//vY0bsH6pz EQLMs9Ih8N0KLMAFT/qikFPhsTWxiRsqJWs7HZZoyICWucojnUg3LGHMW7PYBOveFiTe 5tmOmTBVbKHM48BudOi/AyhD+bP04hBgXiw22d8C84Zsd0KC15Ad3P3LXl3bZXg40Bnp 2241nZlV8JBYxHUEDdKlJStfCTUyiuZ+Q+BQR1rdzw/j1OHPxFgtjbtPy5/TbvzrK7Tb yQuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=nsUsNCHZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id w2-20020a1709029a8200b001c9ad2bc71esi1501273plp.251.2023.10.18.23.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 23:52:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=nsUsNCHZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 5DEDC825B519; Wed, 18 Oct 2023 23:52:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232854AbjJSGwG (ORCPT + 99 others); Thu, 19 Oct 2023 02:52:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232383AbjJSGwE (ORCPT ); Thu, 19 Oct 2023 02:52:04 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B2F411B for ; Wed, 18 Oct 2023 23:51:59 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-317c3ac7339so6509176f8f.0 for ; Wed, 18 Oct 2023 23:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1697698317; x=1698303117; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mw4Ufl/cOqWrZrf06coK8u2YQD70TRL1KhrXVtvZNrw=; b=nsUsNCHZFTEW7NrHc+xLEg94MIbZEvhG0XTqLEf4/mQVG826I9Zx6/dJjVJ2XTE1dK U4ezwvNwlGi70f4bRGI5jo5RvcFWCkzz8TFj0n/ymYdItVbq7H1cbm62uSaIaRarkYDe IoYLkzdC1sMQ+OXGGAULWL11HQ+0//3zL3A614dvTxMT2+Va2XUttM3PiyWdhK0i4XU3 OqlfQhVf7tBd/itKq5ScC8o/GDuCXzQapUoCjZgWPWKKPHMLnl1loQaQ3gLlFUJiQUvi ArgyVvSZaiXH/AxQAPrzH4LgarMhNNH1zNCtqfvPXtIsdE8KtA6nUEbtaVxGmaAizjXF sMpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697698317; x=1698303117; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mw4Ufl/cOqWrZrf06coK8u2YQD70TRL1KhrXVtvZNrw=; b=RaeNQ21uzWnVPQnfh4xvuCeNFhBa3Vvc4eCDk9Qbky0MGm3iOSVsTVIrlFvA6MuyUz rx5n5iTUD88qCOxFKVtSarUjpT/Whzi51EnciqwsYfYHWvbms3DEA+tJld9cMfqR7LNb gm5dRxKULglFrEefZYREVl5MgxbX67DG3k86G/BsgKb6zozYDTb+lz3GrAjjZ+jlNYrQ 4ZWLR7pIIBorD6WCqDTMTSIT1gFO2vwqOs7dKmalncZNVyT5V3uFXV/Wd8byormkHtiE NHUQyfjhYgW0CF/81uU9ALEGQzo5yHsmtArCjBk3KaZLxSjn+t8rEnVSKe1t7Xa0A/tR ykpw== X-Gm-Message-State: AOJu0Yz1s0hqGBA1tOY5qByALD3bfVeB2brPRRTYOzJUhTjXns2VJvFe xHmkU6mSOqKulU/pAD8Pda880A== X-Received: by 2002:a5d:630d:0:b0:32d:87c8:b54e with SMTP id i13-20020a5d630d000000b0032d87c8b54emr860927wru.1.1697698317404; Wed, 18 Oct 2023 23:51:57 -0700 (PDT) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id i3-20020a5d6303000000b0032db4e660d9sm3710915wru.56.2023.10.18.23.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 23:51:56 -0700 (PDT) Date: Thu, 19 Oct 2023 08:51:55 +0200 From: Andrew Jones To: Sean Christopherson Cc: Dongli Zhang , kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, shuah@kernel.org, dwmw2@infradead.org, joe.jin@oracle.com Subject: Re: [PATCH 1/1] selftests: KVM: add test to print boottime wallclock Message-ID: <20231019-f96a45af9c235d89be644e67@orel> References: <20231006175715.105517-1-dongli.zhang@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 18 Oct 2023 23:52:31 -0700 (PDT) On Wed, Oct 18, 2023 at 12:51:55PM -0700, Sean Christopherson wrote: > On Fri, Oct 06, 2023, Dongli Zhang wrote: > > As inspired by the discussion in [1], the boottime wallclock may drift due > > to the fact that the masterclock (or host monotonic clock) and kvmclock are > > calculated based on the algorithms in different domains. > > > > This is to introduce a testcase to print the boottime wallclock > > periodically to help diagnose the wallclock drift issue in the future. > > > > The idea is to wrmsr the MSR_KVM_WALL_CLOCK_NEW, and read the boottime > > wallclock nanoseconds immediately. > > This doesn't actually test anything of interest though. IIUC, it requires a human > looking at the output for it to provide any value. And it requires a manual > cancelation, which makes it even less suitable for selftests. > > I like the idea, e.g. I bet there are more utilities that could be written that > utilize the selftests infrastructure, just not sure what to do with this (assuming > it can't be massaged into an actual test). Yes, there's definitely code overlap between selftests and [debug/test] utilities. For example, I snuck a utility into [1]. For that one, without any command line parameters it runs as a typical test. Given command line input, it behaves as a utility (which developers may use for additional platform-specific testing). It seems like we need a way to build and organize these types of things separately, i.e. a utility should probably be in tools/$DIR not tools/testing/selftests/$DIR. For [1], I don't have much of an excuse for not just splitting the two functionalities into two files, but, for KVM selftests, we'd need to find a way to share the framework. [1] https://lore.kernel.org/all/20231011135610.122850-14-ajones@ventanamicro.com/ Thanks, drew