Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp3129932lqt; Tue, 23 Apr 2024 11:04:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbVOBBgDrtWuezGtKfnfVKEMCrK4gPrRis0l4Kppu9/k4E7YyojVp1mBd9nigUDFlLbxM2tLYWvgR8S0a4LumV6u+URzlmfukWx8ja9g== X-Google-Smtp-Source: AGHT+IFlFASQDE083i1Fnwl1E66gYWRREf/WdDVhNhvbSp8jJu5ZYIR2XOkC4aGl+HVHra1l6oxt X-Received: by 2002:a17:907:7e9c:b0:a55:b3d8:a0c8 with SMTP id qb28-20020a1709077e9c00b00a55b3d8a0c8mr67217ejc.42.1713895487993; Tue, 23 Apr 2024 11:04:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713895487; cv=pass; d=google.com; s=arc-20160816; b=fazPrPl/L3Ud7F1fbvFUT4IpfBorQOq8ESyKC41J4Bb4HwzlvMY8yNCQ30g4b531nA C9pdVAVwIo0aeLqNk/4jXYkEUizG3L57ZMKw+Bkb8e0bRz6qEJADhgEUE89g6MR3Wr9+ G7CHu8iwSnSkXH6yYB2d+Uk5aCuVkUf5za9T1jXj/6zvPK4vUpkMqe+dxn4tSG8RmW++ DrkYaF08mNO9kjWdvps/cvf4Utuee+yk+DPLj6RXjzoOi3sH5L265BBegnOEa7fSwu+k myFIRpiLW7CEWhlv0gF+gn3E5EeT2BevGDE/QjwCbEhWJOIcP1NRESk1rlot+21uzjXh WDDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=8RoB2bmr9D7cIwjXnk32HofG28lmrnGwGOkWdhfsOC4=; fh=LlTjwD/rya8ZPEYiA0iK2jGF3J5JP425njBvMSvjwQI=; b=GwTokDn0mqtbgz1OxXRCLsuP1eP3nq3SQczyxB+03e4XpOZ6QuC/a+p+suqJrW5HE9 oEHvfnhIQm8Tv0PNelMW1DHrjngPL5WDZ+mNzE190rGMtsiQxlZ1cZFoHcqpi5VpoUhf yNGV3Rs0azXMx/Xm/HDjsr8f2zHxZn/YATVK5Ai8+4jGNv6na/46TCkk6l8JDCdLXNO7 2rRUIU66wCzRiuVLVcIuS9edS0VlhiWw/GNcFPLIb4oH/EjT9ECPYeIg5lyb5o/UzmuQ JAJb3FNP5A9kerP/bZ8czuKB8rEPky984zqqJHa45BFKOQuPmU1HjmSES9Db8o+RIHrA 6W6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YIH3ZZDb; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-155720-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155720-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id hq21-20020a1709073f1500b00a5662eb2800si2195719ejc.827.2024.04.23.11.04.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 11:04:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155720-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YIH3ZZDb; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-155720-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155720-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 9D9AE1F26B8B for ; Tue, 23 Apr 2024 18:02:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE2D71448F1; Tue, 23 Apr 2024 17:59:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YIH3ZZDb" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 4BB87143891; Tue, 23 Apr 2024 17:59:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713895172; cv=none; b=VjUdEnxZN0hAiDLL411OEiyJ+T0uTkhr6OrSpF52o1iAU4i/07OBLxEq0ZmAX8OYkmapWOXwDFriYLhu526B4hO27ojEtKX0Rj483Cr99DW63h88hzo9AD0NkdetHDv76naiS4VPawLzGgNid7y3HbQ/9IzhkUBTGKzHj9mp9xI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713895172; c=relaxed/simple; bh=VBa5Uoa7nnDAfK4MeWFM8DIP6qDVEtvWS57pRdVdN+U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lETkiAob8eUdzExJL2qYu1yFAX+DhitwG3OL1H75TpNI+wDqNCswCAn2fW/i1JtCogRo0XvwgLt0rN+UjQ8WqpCCC48ZnUeqP6TBgC7/oL86S49Io1g0WfP+zir7szuhlBp/8NMNGmiGNU0Q6v8trbqOtqw7R08/bZW0vTE9e/U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=YIH3ZZDb; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713895171; x=1745431171; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=VBa5Uoa7nnDAfK4MeWFM8DIP6qDVEtvWS57pRdVdN+U=; b=YIH3ZZDbtUqDnTzkpGwzL2jScsL9pFgiXlTui11QQOnXS37gga7Z56D7 vQUO3KOZ30ovzgpJejhlJ7nCmR9wND2w5GvXjiLNUjimAQerceqKpxYkT EMfv5vIQWEQBbnu1O+G81Rj+XwVCHJ4fTtM1y7mVjTGynMrRshwbFw44h gSvr56D6vXPcgWNxHqgAnJAZp9WXxwniQzv8z9iO3ENLO/+uCkMsHowMD ASrKfXjSvrNeQnHSTu+mD3JEJA1qk37CJbWc4LANAcAv0yuYHH2LkgeQy npT6bs05PmW8MIbXVcgecTtA1nKQYNHZm7sG+2R9QmCk7PFuq9jptD2Ee A==; X-CSE-ConnectionGUID: ztWXMs/FRLS5/mSiksbcqg== X-CSE-MsgGUID: /xIv8WtpRoWcM3LfuuKBeg== X-IronPort-AV: E=McAfee;i="6600,9927,11053"; a="9370605" X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="9370605" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2024 10:59:23 -0700 X-CSE-ConnectionGUID: 88MXJqjRTQSFVr9BMJbdpg== X-CSE-MsgGUID: 771S65yCQu2CZpw3IpeGFA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="24895532" Received: from soc-cp83kr3.jf.intel.com (HELO [10.24.10.60]) ([10.24.10.60]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2024 10:59:22 -0700 Message-ID: Date: Tue, 23 Apr 2024 10:59:21 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] KVM: selftests: Add KVM/PV clock selftest to prove timer drift correction To: David Woodhouse , 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 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> Content-Language: en-US From: "Chen, Zide" In-Reply-To: <06864883c53cc4042e1939c04ecbd5ef0f8acf3b.camel@infradead.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 for >> 1000+ iterations, w/ or w/o TSC scaling, the TEST_ASSERT(delta_corrected >>  <= ±1) never got hit. This is awesome! >> >> However, without KVM_REQ_GLOBAL_CLOCK_UPDATE, it still fails on creating >> a VM. Maybe the init sequence sill needs some rework. > > That one confuses me. The crash is actually in debugfs, as it's > registering the per-vm or per-vcpu stats. I can't imagine *how* that's > occurring. Or see why the availability of TSC scaling would cause it to > show up for you and not me. Can I have your .config please? > > 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. > > 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  > https://lore.kernel.org/kvm/a6723ac9e0169839cb33e8022a47c2de213866ac.camel@infradead.org > > Are you able to load that vmlinux in gdb and > (gdb) list *start_creating+0x80 > (gdb) list *kvm_create_vm_debugfs+0x28b > > Thanks again. My apologies, it turns out the KVM_REQ_GLOBAL_CLOCK_UPDATE is not needed. Today I can't reproduce the issue after removing it. Yesterday I thought it may miss something related to pfncache. 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.