Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp43587lqd; Tue, 23 Apr 2024 14:03:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDWBJFZd9A63QQvVGinDaADuPX6N5ZlurZuZnZzld1rHpseKxSTjhU/DcHdD/38qycMd5Jz1/s4E9pEa3Q0ahb+RGdTuwZzHYr72rRBA== X-Google-Smtp-Source: AGHT+IE4eM2kbmijPJunUf2QY8Pb/fPsReWmVjFk5y6DZpqRKDgPxrH92ZaKwPfl1BsI44z/ydKH X-Received: by 2002:a05:622a:c7:b0:437:aca1:807e with SMTP id p7-20020a05622a00c700b00437aca1807emr671904qtw.3.1713906217913; Tue, 23 Apr 2024 14:03:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713906217; cv=pass; d=google.com; s=arc-20160816; b=eBaudxmcRxAPdzKeac632H15lQVpc0F0F9JhwRG92yDaE0ZYZnO0ryvxLSW6N88Nsn tbJvmePPhp1o3Gt6zdHtEa07BzwFXQSsWX7hu01ZXZxSvipFwcpcv2E5oZQRY6ovfZHZ rsoLfVkknRFw9L+EyivSeXhscWE87+wtk/Ei0LXrgj6eJHHOFcxldPae1lvw6FlJxdvv klFnstmB/TvRi5w4+uVqhr/3WKZgghpG0vJ1wgR5ObLaazbcIfH7cjwTzvf8JXek7tLL DCqsyxnm8Q+6thoQ4DeIv3+uQkjtrO4630EazE2M+Oms+U+T2SSPZTwJhZIjdJMlh1lS SYkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:references:in-reply-to :user-agent:subject:cc:to:from:date:dkim-signature; bh=tm6Oa9JrF8vq5JJCyPEdQCE1KB7eUtQwFdacLQMRUU4=; fh=J5pW6WJHWec2ONVwStzzB82ingpCTyWaBAcdYhTTvQE=; b=KvsVEItlU9RYJVVIX47egHq4RaTJX/4hsnZFsM4HGDO8D+otHdRI1R0ZF+qSEugjXs 0l5XcpOAKUzgZ9No6JFlWSU4CIiWv8qiIxOc6SWcRACM5+LdFdPejbNIcmhgNDK+LHr3 BJr6ez7fmf6pUkIB7X03Nx1yNz7STXgtWvbibP31HSUQxn4p7wGXTDzOayWJak6Rvqb6 smyOTqOF+ZEE+xmZ+JywCkJywLZt9gm+2kzLT90EAcDcjpJKw+1q2KCIuVOpCLuh+TS9 R5Ol5wHO0Ca/r7FJmDUmAKzKUbUNuXoKPfhLUaSRDXA/m0hzTCT2wz/oG+dLMxjj/sCx O77Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=glaQdr8G; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-155902-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155902-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ha13-20020a05622a2b0d00b004317c934af8si12345972qtb.561.2024.04.23.14.03.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 14:03:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155902-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=glaQdr8G; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-155902-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155902-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9B8141C21E3E for ; Tue, 23 Apr 2024 21:03:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F40D143878; Tue, 23 Apr 2024 21:03:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="glaQdr8G" Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08A2C20B3E; Tue, 23 Apr 2024 21:03:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713906207; cv=none; b=kB/P2xCUmpnd9JQ2tIP5PzsS7525yQIjebJ2P0zfHyQDAJ4hyk7fWyvug/NGvEipw6W3Tosxb/zJPzPKz+PAUSUetWprXa+eyBdcZ3IwIpYITLdYDyMTmiDaw4FsLyfb6h5ITqfPluoPuGMxR8AWKOTFPeHPHigHB/+7+VNDX6c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713906207; c=relaxed/simple; bh=LWHJaT9ULgmFemasW8hgm+EMXbfzWFdJb6VuWLCVjcA=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=h+2pAz6e1269wHiDNcWEGbL+Awpq009zSTxjnGklA0hPDmwbbVXZaFi4rMbf6Yom1MfKnN7oGLzEFx4m87S0xC0JEsHyRPlr+bH10/llK1nbZP2JjegmZEOVWPi8T1GGqNmergEOqrjSEiu/A993N1oDPw3fxNGJhUKq+RqIQpc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=desiato.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=glaQdr8G; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=desiato.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:Message-ID:References:In-Reply-To:Subject:CC:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=tm6Oa9JrF8vq5JJCyPEdQCE1KB7eUtQwFdacLQMRUU4=; b=glaQdr8GIBbuFASx3fr/TrxaAR kIOAFOr2dmnrg0LXJ1uopS2+bQiNO4/ejMmf+KQQ3EFvS150PyqGycOl1fr89QK0vrR02vl/SZA+2 RywBqYpUXeIahUWsNTeeaZ7fV1ICmNHzcm/ehJ6+o7VLFPyd7Gvl5UqevLVu1crxX1CCBk5FNMOC6 XuYdUufhzLGRAIRq7sEll2u2TBBC1hiWCpaNgSln9xrB4VT9g0hhtVcfOpFkQZ6S6qJhmGR357L7l 0VmBfNFwnSM72UFXfu6YQNG40DPz4U1GEze6G0BFIdevFkDupHrTiQCSKSiLqrvx3wVPzVccIT++W WpzvdZTw==; Received: from [2001:8b0:10b:5:2012:a1ec:9b77:d880] (helo=[IPv6:::1]) by desiato.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzNHj-0000000EA4L-37FM; Tue, 23 Apr 2024 21:02:41 +0000 Date: Tue, 23 Apr 2024 22:02:40 +0100 From: David Woodhouse To: "Chen, Zide" , Jack Allister , Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Shuah Khan CC: Paul Durrant , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_2/2=5D_KVM=3A_selftests=3A_Add_KVM/PV_c?= =?US-ASCII?Q?lock_selftest_to_prove_timer_drift_correction?= User-Agent: K-9 Mail for Android In-Reply-To: References: <20240408220705.7637-1-jalliste@amazon.com> <20240408220705.7637-3-jalliste@amazon.com> <3664e8ec-1fa1-48c0-a80d-546b7f6cd671@intel.com> <17F1A2E9-6BAD-40E7-ACDD-B110CFC124B3@infradead.org> <65FF4D51-05A8-42E0-9D07-6E42913CC75E@infradead.org> <6dca783b-6532-4fa7-9e04-1c0a382a00b0@intel.com> <71260288-3666-4419-8283-6565e91aaba4@intel.com> <06864883c53cc4042e1939c04ecbd5ef0f8acf3b.camel@infradead.org> Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SRS-Rewrite: SMTP reverse-path rewritten from by desiato.infradead.org. See http://www.infradead.org/rpr.html On 23 April 2024 18:59:21 BST, "Chen, Zide" wrote= : > > >On 4/23/2024 12:49 AM, David Woodhouse wrote: >>> If I restored the KVM_REQ_GLOBAL_CLOCK_UPDATE request from >>> kvm_arch_vcpu_load(), the selftest works for me, and I ran the test fo= r >>> 1000+ iterations, w/ or w/o TSC scaling, the TEST_ASSERT(delta_correct= ed >>> =C2=A0<=3D =C2=B11) never got hit=2E This is awesome! >>> >>> However, without KVM_REQ_GLOBAL_CLOCK_UPDATE, it still fails on creati= ng >>> a VM=2E Maybe the init sequence sill needs some rework=2E >>=20 >> That one confuses me=2E The crash is actually in debugfs, as it's >> registering the per-vm or per-vcpu stats=2E I can't imagine *how* that'= s >> occurring=2E Or see why the availability of TSC scaling would cause it = to >> show up for you and not me=2E Can I have your =2Econfig please? >>=20 >> First thought would be that there's some change in the KVM structures >> and you have some stale object files using the old struct, but then I >> realise I forgot to actually *remove* the now-unused >> kvmclock_update_work from x86's struct kvm_arch anyway=2E >>=20 >> I'll try to reproduce, as I think I want to *know* what's going on >> here, even if I am going to drop that patch as mentioned in=C2=A0 >> https://lore=2Ekernel=2Eorg/kvm/a6723ac9e0169839cb33e8022a47c2de213866a= c=2Ecamel@infradead=2Eorg >>=20 >> Are you able to load that vmlinux in gdb and >> (gdb) list *start_creating+0x80 >> (gdb) list *kvm_create_vm_debugfs+0x28b >>=20 >> Thanks again=2E > >My apologies, it turns out the KVM_REQ_GLOBAL_CLOCK_UPDATE is not >needed=2E Today I can't reproduce the issue after removing it=2E Yesterd= ay >I thought it may miss something related to pfncache=2E > >To be clear, with the above mentioned change to >kvm_scale_tsc(master_tsc_scaling_ratio), the selftest runs reliably >regardless TSC scaling is enabled or not=2E Thanks=2E That version is now in my git tree and I have tested it myself o= n Skylake=2E Then I got distracted by reverse-engineering kvm_get_time_scal= e() so I could actually add some comments to it=2E I'm still going to have to put the clock updates back though, for the non-= masterclock case=2E While I'm ripping all this up I guess I ought to rename it to "reference c= lock" too?