From nobody Sat Feb 7 15:22:27 2026 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (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 C3E7413C8FF for ; Tue, 20 Aug 2024 04:38:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724128695; cv=none; b=U17qi89KWkButg2ttoMkpHrI3lW83SILteSM915/pP2MgOYNQ/BO8RfEmxlDJ3LeXVvXaV3GyxzMJtQxulxrduKF5eUlbQjX655P2ZadDKx3GTOrL+axd93PhW9nQ+VcWDTyR7zkbtNJvsLeUT8rRHk+vu51fwXA5BSfwu/vxao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724128695; c=relaxed/simple; bh=poG3kBQSpIW+a3CJ5/IyZwN+BzRPc6FZnR04OujsFQg=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Cc:Content-Type; b=dyYex07o7hubJwaf63th9RE2KKHA3XVQKJsItExxJlsv1BgjwTjg5maRncunMWDSESnBokIGJUvOqATcrxTdDE5weQE0O+SGFW0ywcnbtGPHIEWEgnciIA3uqkpTYeCDrT77O8944GIVngyBTb/0Ym7jy9niIin4s6wIBMy/IVA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--suleiman.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=bUC3M/fQ; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--suleiman.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bUC3M/fQ" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e0353b731b8so8234658276.2 for ; Mon, 19 Aug 2024 21:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1724128693; x=1724733493; darn=vger.kernel.org; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=FKSsf9Lzm9EYSf/AobA/jkSovK0xSmbEfKJnNNfJ50Y=; b=bUC3M/fQqZnqH1rD8fpY3F9qkrAMk0f+EUiXIqH/UVW65QGRQXTOurrRZcvnpmtu4G jgAn5BT8NEUe1al6TBJSv+qYvgV2Wte8V826LErJ96/5DUjhxG2SXsHONgzNvrnAwM95 5sGtSot3OrqbEVvWjOhJxPHNMwhLDZh3hJiBnGTmtYUfM7SAEqRA2so6E3dlNnwJce2P 65urq+d2lfGiqv7fuwGHEbSVr8a+/pjG9OQcj3j77NHRHzc3ly11ah8S3C3vBusadEcr U586u0Iqy08zMYigEKQREx02PBrxG9J2HbvoKmJsHnk7ja2PazqfvMmxCTazc1Ug7lhx /MVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724128693; x=1724733493; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FKSsf9Lzm9EYSf/AobA/jkSovK0xSmbEfKJnNNfJ50Y=; b=ikuGF8PtiGY/wO/k3aGE+GX5FAUmOvxuwXq+6UbzxiLFy3f+tvMFr7lqMxpuadYWZn ra+hphrCsuOpHBXGjeCoKyi5OM4LxT8lT6TuH9MWEvKhAJLRhNAfyCURcAXHSS4dzL5p 2YbFUSmIeskXfmkoAew5/dIuVt6h7X9a1jNBO77vBzGLp1u1/481dpO6OgEcytOKCT3v cV6B+EWjH1NKan4Wl9UMOYA1KnSvFQ3enusHOabXhTscFrQQMUHmMcH4N+gc+WRE3JZd 75qGuNb600CPV/qyR7dRMbQf2Ks+LxQq1ncW1wufoFrd4gjiHHkOdMupXE/N8po4tOix gaPQ== X-Forwarded-Encrypted: i=1; AJvYcCWYAc7GD9FF2QYSlyCQayHgW+XbvdtOMudlNmz/RuckYvVDTFP0qKnJdHcapWLYIDnVtJFBWJacI34uERc=@vger.kernel.org X-Gm-Message-State: AOJu0YzI4v8RxX/WmWoE+1LbL+dDHhSZz4+tRAzSdaOPSzjsBN2o07xC cpNb94KMv2REg7v2ICfVgwcs8/klnJb4/V6XV3OxAsFDi9tZtl/9gEKQIobX16pw1UtCgwG/MTC 1G6Y0ybt1Zw== X-Google-Smtp-Source: AGHT+IFPqwVaoVkfiG5pcO12KiFYHLAsirwex5WI2NFCnwFw7UYHoZ3jKbECokBCiiQpEVBTD1Terc8qaRFOPQ== X-Received: from suleiman1.tok.corp.google.com ([2401:fa00:8f:203:7c18:89e3:3db:64bf]) (user=suleiman job=sendgmr) by 2002:a05:6902:504:b0:e11:7105:956a with SMTP id 3f1490d57ef6-e1180e6c0d4mr23970276.3.1724128692630; Mon, 19 Aug 2024 21:38:12 -0700 (PDT) Date: Tue, 20 Aug 2024 13:35:41 +0900 In-Reply-To: <20240820043543.837914-1-suleiman@google.com> Message-Id: <20240820043543.837914-2-suleiman@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240820043543.837914-1-suleiman@google.com> X-Mailer: git-send-email 2.46.0.184.g6999bdac58-goog Subject: [PATCH v2 1/3] KVM: Introduce kvm_total_suspend_ns(). From: Suleiman Souhlal To: Paolo Bonzini , Sean Christopherson Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Chao Gao , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, ssouhlal@freebsd.org, Suleiman Souhlal Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It returns the cumulative nanoseconds that the host has been suspended. It is intended to be used for reporting host suspend time to the guest. Signed-off-by: Suleiman Souhlal Reviewed-by: Chao Gao --- include/linux/kvm_host.h | 2 ++ virt/kvm/kvm_main.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index b23c6d48392f7c..8fec37b372d8c0 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -2494,4 +2494,6 @@ long kvm_arch_vcpu_pre_fault_memory(struct kvm_vcpu *= vcpu, struct kvm_pre_fault_memory *range); #endif =20 +u64 kvm_total_suspend_ns(void); + #endif diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index cb2b78e92910fb..2235933d9247bc 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -5720,6 +5720,15 @@ static void kvm_shutdown(void) on_each_cpu(hardware_disable_nolock, NULL, 1); } =20 +static u64 last_suspend; +static u64 total_suspend_ns; + +u64 +kvm_total_suspend_ns(void) +{ + return total_suspend_ns; +} + static int kvm_suspend(void) { /* @@ -5735,6 +5744,8 @@ static int kvm_suspend(void) =20 if (kvm_usage_count) hardware_disable_nolock(NULL); + + last_suspend =3D ktime_get_boottime_ns(); return 0; } =20 @@ -5745,6 +5756,8 @@ static void kvm_resume(void) =20 if (kvm_usage_count) WARN_ON_ONCE(__hardware_enable_nolock()); + + total_suspend_ns +=3D ktime_get_boottime_ns() - last_suspend; } =20 static struct syscore_ops kvm_syscore_ops =3D { --=20 2.46.0.184.g6999bdac58-goog From nobody Sat Feb 7 15:22:27 2026 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (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 88248148FFC for ; Tue, 20 Aug 2024 04:38:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724128699; cv=none; b=ByEiONeGC0JCP7bsaUq73ugAb0+yho71LzD41KTS2vgzw8/Ln2cMYRL5IT31/dJ/YdKeD8DIm5WejIKtpH5IK6Id2v5arsa+MRZItH2Pj3VQxQdcZS9QG0h7aZkrh8y85d69FHUNrZ6fNeBEbiEYjUBUg2sU4r08VA6kJ/2DUH4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724128699; c=relaxed/simple; bh=ImKLYihAGgQNZ/oanLjd47JquPgT6FVsGy+myZKO39w=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Cc:Content-Type; b=AWKgcfdKaDttK4jF/OdBhIeo7MqJi4Kje+z/yeb+Ek1IyPN/XAIQdjONxpnHaKLCTJydaaA7/sHUkrxieWy7zg0YME2jAUZmuh+hSFupOcWr8o4vN5IyTuwmTUZ2Kvdc0pJFuz37mSzppLlAkZG3lgn81rNdOVrRpNYPUOjAG70= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--suleiman.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=10kIfqLQ; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--suleiman.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="10kIfqLQ" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e11741a4c92so6126058276.3 for ; Mon, 19 Aug 2024 21:38:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1724128696; x=1724733496; darn=vger.kernel.org; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=5TZmmuMT9WUBBRzzYYXG22ftk/TTrrT11BrmS5ZBbdU=; b=10kIfqLQes1O13GioGpSnKp+rIEBS3MZymAGGiIS4+O+JuP1efMi/3W6QTwqfIAp13 UNK3ta5A2BuNtFVZg+lZmh3EG+/XNT0qBJbqIEJEi4o/GJNtWMI2Jre68qBZ8oMywC1z 7tYlBstOF3AzD9euvPu1YLhT0hD2mgLogGEyDVRWnR7R+husIhuw9+NeOe2QTF8CCMl4 ootXaW39oCa4Egh/N1oVzPMkrdR1iIm/UtktuFizaQwvvzSX3fdoo8miDZD8xArWWphM t7hgtjps/cnAmCqWpKjBYRt7rSu7gTLc7eFj6CvLl6INXrKiG9QRb74I4/EOc2SahSZj 1Y2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724128696; x=1724733496; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5TZmmuMT9WUBBRzzYYXG22ftk/TTrrT11BrmS5ZBbdU=; b=WyHjAleHBCE7jlPK0jw6iXQ2SSe7Oy4rYd9Pw9wk5pwc+FbX933seyjprUuPcf1S0H YuNEH8p9ax+ku6+fjgPsOproYoOfkUXW9UEBRlQ9NRjjBRftoJ3IyuIzQtYL2pgEqByr Mj4HqRW8b/kLH5EC7HR/KqmWaRxVo4tHwYmpi2ZNnnU/nIfToyF3dzzv7ewlO2/SwsJE lhhde+YsFTXbw8Cze5v/OuAJPE02yZ577elfpgUYKWg3fa8d6CLbAnMr7YKCjzwuOTNw TzqZsKkOUi1DMqiL5fUPuSadEm3VbLMjnEjk5e+oxZlVr2AkGqEc+U3BB+yJMgqFTL4+ sPQQ== X-Forwarded-Encrypted: i=1; AJvYcCV8tA/dsTFOfAFO6xzuxp/hUZdpLFHDUUpzYyOyoky8FD65Cfr/NI9EFuNz3dmcCqA/OoIzE4spp8oyfJA5x2xySxiVoySNIc4X+ln/ X-Gm-Message-State: AOJu0Yymfe5nAkQJI/bwGX+eNJ3xU5RnF6xB+MK34pGj0pQe2+TxpUhS ztNkQ2iZoxqKTg/+AIt8g489fW14ZKW41gayiPGVqfKgBK+zgfeCVd8fiKNiUJzJwc2yxMl1iXC ooKAE1gXYkQ== X-Google-Smtp-Source: AGHT+IFko9TuAg/fFH2b16tsE1En7DdlM8+lW8euXc+4FXbWb9LNWhThz2XFNutJecp7dklcYDTE0EbtT0+y8g== X-Received: from suleiman1.tok.corp.google.com ([2401:fa00:8f:203:7c18:89e3:3db:64bf]) (user=suleiman job=sendgmr) by 2002:a05:6902:14d:b0:e11:7112:6b9b with SMTP id 3f1490d57ef6-e1180e625a1mr258826276.3.1724128696422; Mon, 19 Aug 2024 21:38:16 -0700 (PDT) Date: Tue, 20 Aug 2024 13:35:42 +0900 In-Reply-To: <20240820043543.837914-1-suleiman@google.com> Message-Id: <20240820043543.837914-3-suleiman@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240820043543.837914-1-suleiman@google.com> X-Mailer: git-send-email 2.46.0.184.g6999bdac58-goog Subject: [PATCH v2 2/3] KVM: x86: Include host suspended time in steal time. From: Suleiman Souhlal To: Paolo Bonzini , Sean Christopherson Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Chao Gao , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, ssouhlal@freebsd.org, Suleiman Souhlal Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When the host resumes from a suspend, the guest thinks any task that was running during the suspend ran for a long time, even though the effective run time was much shorter, which can end up having negative effects with scheduling. This can be particularly noticeable if the guest task was RT, as it can end up getting throttled for a long time. To mitigate this issue, we include the time that the host was suspended in steal time, which lets the guest subtract the duration from the tasks' runtime. Note that the case of a suspend happening during a VM migration might not be accounted. Signed-off-by: Suleiman Souhlal --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/x86.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_hos= t.h index 4a68cb3eba78f8..728798decb6d12 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -898,6 +898,7 @@ struct kvm_vcpu_arch { u8 preempted; u64 msr_val; u64 last_steal; + u64 last_suspend_ns; struct gfn_to_hva_cache cache; } st; =20 diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 70219e4069874a..104f3d318026fa 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3654,7 +3654,7 @@ static void record_steal_time(struct kvm_vcpu *vcpu) struct kvm_steal_time __user *st; struct kvm_memslots *slots; gpa_t gpa =3D vcpu->arch.st.msr_val & KVM_STEAL_VALID_BITS; - u64 steal; + u64 steal, suspend_ns; u32 version; =20 if (kvm_xen_msr_enabled(vcpu->kvm)) { @@ -3735,6 +3735,14 @@ static void record_steal_time(struct kvm_vcpu *vcpu) steal +=3D current->sched_info.run_delay - vcpu->arch.st.last_steal; vcpu->arch.st.last_steal =3D current->sched_info.run_delay; + /* + * Include the time that the host was suspended in steal time. + * Note that the case of a suspend happening during a VM migration + * might not be accounted. + */ + suspend_ns =3D kvm_total_suspend_ns(); + steal +=3D suspend_ns - vcpu->arch.st.last_suspend_ns; + vcpu->arch.st.last_suspend_ns =3D suspend_ns; unsafe_put_user(steal, &st->steal, out); =20 version +=3D 1; @@ -12280,6 +12288,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) =20 vcpu->arch.arch_capabilities =3D kvm_get_arch_capabilities(); vcpu->arch.msr_platform_info =3D MSR_PLATFORM_INFO_CPUID_FAULT; + vcpu->arch.st.last_suspend_ns =3D kvm_total_suspend_ns(); kvm_xen_init_vcpu(vcpu); vcpu_load(vcpu); kvm_set_tsc_khz(vcpu, vcpu->kvm->arch.default_tsc_khz); --=20 2.46.0.184.g6999bdac58-goog From nobody Sat Feb 7 15:22:27 2026 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 E21C614A0AA for ; Tue, 20 Aug 2024 04:38:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724128702; cv=none; b=qIeOlMPoJdeCB6cLv5AOT/mXYEXDqQxinz+Hs1y6ohs6rcwcykDwZElOjwkNFmRBgXgH4/0v0MS10RAw2h8Q37kOrhGQnRAyiesppPdy4NTnABCw6rstFLjOfuJH9tckOZa3jFeURRzAX2WooZLUOTeLT/nR7ijP7AQwOJyVjZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724128702; c=relaxed/simple; bh=KhyS8lX/LLl+hyGdd5SPZp0IVwMMSQOPguoeq4EtDCE=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Cc:Content-Type; b=VGqe3ULf6/NTtmPigCc224/ImzP+IJT6ySFzH8YR3/TzePCZZt5vKw6lfBDp80wNQB1VocO8D//E4IpB5FwMw0jY9veecdeKRZEIIGNFU7KWrafGDxMfF1yb8vfCphUkn046fupYeIZZAPQ8+hOSot2MP1SAP9SpPE7L4RAnEvA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--suleiman.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=uCCXfjgB; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--suleiman.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="uCCXfjgB" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e13c4519ed6so4116131276.0 for ; Mon, 19 Aug 2024 21:38:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1724128700; x=1724733500; darn=vger.kernel.org; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=qNDCnS5K1Pk0TOt/H51ksBrj3Ct5dgsW0PJU7Ovd3Rk=; b=uCCXfjgBzVuteMgqdMXJx92VAvJF6+8ibKqLjoU1HwfZwCmM7c9l0df1eTOVXfAvfv OYJ5hTuvWQO/Z3+po1SJ3U/lNv4MU3P/xkpzc6ncfAIihGyTD6SHhPlJeOOjUpP0yMph Tz6jsg9pOt6S64DfqAL2Nh39fcpBd8zAwphEpr4jcbYyMm+QgtmbhXNdgxstcWhjQX8E gTPsuJol+FQFM6QkneM/FQqvquPDjs00qJSuSZAXNd12+C0K9q7IjOjECKjLsX/zkFkt DAARrczHqEoxNzIjevqCMQzXK4KT+PzwJJjMNgOeIln2mcWE6ZU/M839sss/tpW3IVi8 ST8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724128700; x=1724733500; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qNDCnS5K1Pk0TOt/H51ksBrj3Ct5dgsW0PJU7Ovd3Rk=; b=izjbYYm84LNcfCXRBA6wtcpz52k5pvRyPFieWc/NP69DREMm7+baSlJxDkjgSK9+vs 8Xms3k8kNdte3XbklBsHh7H5ZxTWR5gWdQaLafuzsGrI+b67q6UJsS/qdUyKZk4p2PPP MmjJM36lQYoIHRTUHcl4j4YOLlFb6oOl8EvsctZgpFzx+FwQwibrZT32y2Ck7yThNJLx z2gzV3TzDEdMDRcIRd4iXXi4gPRYnYqvCcJEX5dEc/JE8Cq+gOBRFrnpf8ggkqxc/Cuc OYpWHbD3Xms3auNwrmNsJnT30J/6uTJtiqbPQmyn9aVihQ2Ps+4thIsBQPzXTOU/y88Y KNAQ== X-Forwarded-Encrypted: i=1; AJvYcCXXYCbWH3ddu3MKLCUSO1ooqNDB2baFTDsSZdA7qT5qgMQKdJ2q90TU6zlnmr0vSkrVZDc3byJT3LXJDio=@vger.kernel.org X-Gm-Message-State: AOJu0Yz1MYmJplOIr4HKDjdi2Mv2Fo4OqF0QBKsmTmK3isWnSPtZeAAK Xcsu4O8SwXStePI2cgSxFc1hAGkleW8KkYwUkooSBS8c+a/v1Fd3jnldHpVXiYjot8oGygf0kFW 1jx0c6rBLnA== X-Google-Smtp-Source: AGHT+IHPhKfnyXpFhVq0R4vg3+eMT/2Vl0KfVD5sy7EldgzlYqzQx5123h4uD0zjvjOy+hF0Z61eezyg0WQfwg== X-Received: from suleiman1.tok.corp.google.com ([2401:fa00:8f:203:7c18:89e3:3db:64bf]) (user=suleiman job=sendgmr) by 2002:a5b:207:0:b0:e0b:acc7:b1fd with SMTP id 3f1490d57ef6-e164a9cecccmr57101276.4.1724128700014; Mon, 19 Aug 2024 21:38:20 -0700 (PDT) Date: Tue, 20 Aug 2024 13:35:43 +0900 In-Reply-To: <20240820043543.837914-1-suleiman@google.com> Message-Id: <20240820043543.837914-4-suleiman@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240820043543.837914-1-suleiman@google.com> X-Mailer: git-send-email 2.46.0.184.g6999bdac58-goog Subject: [PATCH v2 3/3] KVM: x86: Document host suspend being included in steal time. From: Suleiman Souhlal To: Paolo Bonzini , Sean Christopherson Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Chao Gao , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, ssouhlal@freebsd.org, Suleiman Souhlal Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Steal time now includes the time that the host was suspended. Signed-off-by: Suleiman Souhlal --- Documentation/virt/kvm/x86/msr.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/virt/kvm/x86/msr.rst b/Documentation/virt/kvm/x8= 6/msr.rst index 3aecf2a70e7b43..81c17c2200ca2f 100644 --- a/Documentation/virt/kvm/x86/msr.rst +++ b/Documentation/virt/kvm/x86/msr.rst @@ -294,8 +294,10 @@ data: =20 steal: the amount of time in which this vCPU did not run, in - nanoseconds. Time during which the vcpu is idle, will not be - reported as steal time. + nanoseconds. This includes the time during which the host is + suspended. However, the case where the host suspends during a + VM migration might not be correctly accounted. Time during + which the vcpu is idle, will not be reported as steal time. =20 preempted: indicate the vCPU who owns this struct is running or --=20 2.46.0.184.g6999bdac58-goog