From nobody Wed Dec 17 14:01:42 2025 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 D5BB31990A7 for ; Tue, 7 Jan 2025 04:26:03 +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=1736223965; cv=none; b=Di9INZr+/C+TFe6Cy3qZbgRwJy4Pi4/YuFhcdaLhPI6zExy3aggFNr96u2E0Q/PVo7Oo59XydCI/11ONFY/ncNUzqsxh5qRLsLFs6E7uELeu5AdWgsYdvc0HgpCuuuXt35T3RKyIhzIN9HH0fVOf5ZdWOQg+J5V+hC9mtaDJEYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736223965; c=relaxed/simple; bh=8ueD4jWvDQYZmXFbiwtcz9JxzGlg99ZnxpkF4nuFXeQ=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Cc:Content-Type; b=tBzeq2G9ilmkwk6EhgXLqx1eeUK9Q7iblf6xh7zXI7hYPk7ZDA7wQFzdefWjKCEpf9d4zo7P71lVNyXY+U4aAUkfrvVMYT0G4gaZqHcwZ45Mi0879XnatqR3XSWFG4jP1wS7FKGSlRk1TlqcoNgw/vOB7kPuhr/DbVzpAMQO/jI= 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=GuiObUEM; 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="GuiObUEM" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e535f2c8f7eso33811989276.3 for ; Mon, 06 Jan 2025 20:26:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736223963; x=1736828763; 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=NA213tAcZh4I3DpXocCWo8NBOW1Vq5W1/tV9hgW9Pn8=; b=GuiObUEMuXhsqCtqJBvJCbY7GEz/yrUmWM+UudZcSei5x6T97n2Doujt2PTmjkPBpv G6mR71BBicIOVwbtn+6Xs2u5JVMIqBfVvO4jEDvNZL5oj+5QfVgF1Uw4mUK8marFjqt6 VpjSAM8UL+00HrwEEWIenfWUEimV10v+VIuvHpOacifXfxOkMg3olsA+4Q+eOD+SOzpR Gh+f8RXKH5kialHV1IOEc6ZwFkP4q7pNhc4+4zvKLkzYxnw+3WOCS9AFW4Em5JKRyBMJ UoJ90W5vnV25QoUXcDRbuSyZq1djM35xhf/I7VTGoRl3x7cdTkWgD+hxnTpRhbrNLnUe Dh6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736223963; x=1736828763; 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=NA213tAcZh4I3DpXocCWo8NBOW1Vq5W1/tV9hgW9Pn8=; b=G1bpWSEOBUvF3WZ7BDeQikGycQP2QQnSyTDmH8U7yGNEtIVCZfA51dvmu8khCiVF3+ SB6Y7UWyaDUWyDT49gncAKtgSuPiQ1IypJoDGrAYZTYzzYBGRsQ9SmYvRSyCEEaslGzc mR3zKtB6KB0XwAPvyL/tkssyxdvDDgmt4L4WQB8h3huMYrvwVi+/q3jSxX1WtdX/4SsQ TLyquGdST9dpcUNsUm8ymQYowKqUv40AMqZmzKiDUNpNax8f2aKBaGuwbDNxqZkFnHcg wCk8PTsHng+VOLZ6YA58a+Izi+y8zNeYzk7hHoxSNMdFfeiUSuj56022vXGRwPxs4p2B uNHQ== X-Forwarded-Encrypted: i=1; AJvYcCVm2v0qDadBVl8uCWloqL7+CHPMp1yzyIjMMSsx4kMz/9OYZ3cjUnKNkLRhnou8IxTn4i3VaWYAYMrPIRk=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0uj6OCnxG+vnCXy14MrG3BJXO0rzJTkYrbcfaTosBDQzyqfK1 aQVoSk/3ayvuMIiaNecSvAcBe0dlYuBFJYixboadW5wuoupi8BsTPPW92prm2AIshXQS+6EGPZL y48Qr8aOGGQ== X-Google-Smtp-Source: AGHT+IGkMfbK8LFTyqa2WHNChhrC1EmxtYD81Q8wDfhlgq+6CGJjihWtDqxm7J7NyHBHnty4sQQAhU3Kr/hDiQ== X-Received: from suleiman1.tok.corp.google.com ([2401:fa00:8f:203:66b9:6412:4213:e30a]) (user=suleiman job=sendgmr) by 2002:a05:690c:201a:b0:6e3:f32:5fc8 with SMTP id 00721157ae682-6f3f80cd036mr1676287b3.1.1736223962893; Mon, 06 Jan 2025 20:26:02 -0800 (PST) Date: Tue, 7 Jan 2025 13:21:59 +0900 In-Reply-To: <20250107042202.2554063-1-suleiman@google.com> Message-Id: <20250107042202.2554063-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: <20250107042202.2554063-1-suleiman@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Subject: [PATCH v3 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 , David Woodhouse , 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. Change-Id: I8f644c9fbdb2c48d2c99dd9efaa5c85a83a14c2a Signed-off-by: Suleiman Souhlal --- include/linux/kvm_host.h | 2 ++ virt/kvm/kvm_main.c | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 401439bb21e3e6..cf926168b30820 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -2553,4 +2553,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 de2c11dae23163..d5ae237df76d0d 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -889,13 +889,39 @@ static int kvm_init_mmu_notifier(struct kvm *kvm) =20 #endif /* CONFIG_KVM_GENERIC_MMU_NOTIFIER */ =20 +static u64 last_suspend; +static u64 total_suspend_ns; + +u64 kvm_total_suspend_ns(void) +{ + return total_suspend_ns; +} + + #ifdef CONFIG_HAVE_KVM_PM_NOTIFIER +static int kvm_pm_notifier(struct kvm *kvm, unsigned long state) +{ + switch (state) { + case PM_HIBERNATION_PREPARE: + case PM_SUSPEND_PREPARE: + last_suspend =3D ktime_get_boottime_ns(); + case PM_POST_HIBERNATION: + case PM_POST_SUSPEND: + total_suspend_ns +=3D ktime_get_boottime_ns() - last_suspend; + } + + return NOTIFY_DONE; +} + static int kvm_pm_notifier_call(struct notifier_block *bl, unsigned long state, void *unused) { struct kvm *kvm =3D container_of(bl, struct kvm, pm_notifier); =20 + if (kvm_pm_notifier(kvm, state) !=3D NOTIFY_DONE) + return NOTIFY_BAD; + return kvm_arch_pm_notifier(kvm, state); } =20 --=20 2.47.1.613.gc27f4b7a9f-goog From nobody Wed Dec 17 14:01:42 2025 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 161B61D8E12 for ; Tue, 7 Jan 2025 04:26:06 +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=1736223968; cv=none; b=ftWFU2uy7dwO7s266sQpTo5qgQpG/tnV31hzOD6LsV2lX4g7/RZrI/d/kMnt0t/KrII+vziTy+zzTRoWaZ7mnUA8TvLNeyfEEIJ6BzyqnBQVYlZCd6EZgqRCviqRWCao014pbt4Q+NTpHJfIq5134J8wOgGN3BVks/NFC8gLMVM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736223968; c=relaxed/simple; bh=Oo5Czc4SbZT4Ha1Gp+D2fmjEvq65Mb4ymvqBOVaBP1U=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Cc:Content-Type; b=qnhjEGvNPExTu3EA6cvRLLPB7XMau3N2JE6eWpe61UOVDFjXCM62hT0CnXvobIa9XRaXSoagJ0PqP4Cn72vCCuiQgTlFBsYaUl6MRoxTOtVPwg6IHPLou1Zo822vZI1Zra7HX/iTMDhLwGbLPpkzCBz9EGveg+XUgCZUcIUUnjg= 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=B9Ibbhai; 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="B9Ibbhai" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e4bed6c9151so30921444276.0 for ; Mon, 06 Jan 2025 20:26:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736223966; x=1736828766; 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=+THoeasM42BCk1KQnN9W/5urUBLqOEIVbbKevhlfFUk=; b=B9IbbhainZOCLYfcktnDFj6i+G/u01ldv/s4fDXGRoocHp65x19GyjwJCpCFnt+1XN 6uSWPEj3feEAbYjnQDrBJLFq/fRc/X8rKm5On5rR24+UeX6Twh0LmEud0KE1icZDjJnH fPAM9MiWug8cuGaFAjL49DdinacsYP5Mn3d4eUT5FIOaRvDSLy1ZF1ST8fgZxa0LKk6c IyrWL0OdIIWKgJML0hKr6UKhUpCUtz9JWeEeq3mlMsfaAkU61ftF8NyHkyuoRIWKhsEU 3K/403V7uhj6u4U9427AfJaLSdUSGCW89lPPcS5OXoqVph3MX0AOus3tKnAEkBmfLsyn ickg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736223966; x=1736828766; 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=+THoeasM42BCk1KQnN9W/5urUBLqOEIVbbKevhlfFUk=; b=ESO+kdhmxBbALZBEj6sP3chFn/QSNqQ3q6GtEtgrOVdozPmSlGwqA2ihuv6pEws7u5 luEU7WOjhNM72G0AzYPjF7RJUf49sLX9LAQkbk+5bZydRigcKpQxZvdpW3Z5heHW8ljI XBPRPZi8dnonQxs7jWhNmh80+Er2oxI/c4ny/To0b9SZ+ZmJV2H/A+WGIGdh9T3xq1XQ nIg3Q5bngNya9bVMc6ZM/n+8/tGavxUpea/UwIuLgy6Spb/FPIEwjjJaYFmF3YvlOoGX ZISGg+wGcOth7Z1RVppYgoPt5Z3rhh4AYFw/ZMnVPqKeZ1Lk/3mMrWCa8fL5KtuxbcaE Lp5Q== X-Forwarded-Encrypted: i=1; AJvYcCWVP6pHS3T+oodpk7zYowmkOgZ4pEMdZkwoyTYYEv0/YaWb9UNvGyYF4Hxepzvrt00Z+lE07VtlagrxyAs=@vger.kernel.org X-Gm-Message-State: AOJu0YxyW8e2VSRH4nfIFUEJcBpt//itkxgw8yUTkAMhkxX7EmQRnpUQ vxe5KQDdGb1rwLqGhDyAb/MZSkzjM+KtJ556EDgRKPpwbrr9ZPWh3QwO796Pdtnlsf/P7BjIAbM JU7+V9GgdcQ== X-Google-Smtp-Source: AGHT+IGgNdDXJm39KCxJUsMtCDg+NtjT+Tuiwe+F9K1F2HLuSWB3gCkqA0t3EFGQwF6paadenujiL1dh4Z+w5A== X-Received: from suleiman1.tok.corp.google.com ([2401:fa00:8f:203:66b9:6412:4213:e30a]) (user=suleiman job=sendgmr) by 2002:a05:690c:3392:b0:6ee:4d97:9091 with SMTP id 00721157ae682-6f3f8261c62mr1692887b3.7.1736223966172; Mon, 06 Jan 2025 20:26:06 -0800 (PST) Date: Tue, 7 Jan 2025 13:22:00 +0900 In-Reply-To: <20250107042202.2554063-1-suleiman@google.com> Message-Id: <20250107042202.2554063-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: <20250107042202.2554063-1-suleiman@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Subject: [PATCH v3 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 , David Woodhouse , 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 can subtract the duration from the tasks' runtime. Note that the case of a suspend happening during a VM migration might not be accounted. Change-Id: I18d1d17d4d0d6f4c89b312e427036e052c47e1fa 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 e159e44a6a1b61..01d44d527a7f88 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -897,6 +897,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 c8160baf383851..12439edc36f83a 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3650,7 +3650,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)) { @@ -3677,6 +3677,7 @@ static void record_steal_time(struct kvm_vcpu *vcpu) return; } =20 + suspend_ns =3D kvm_total_suspend_ns(); st =3D (struct kvm_steal_time __user *)ghc->hva; /* * Doing a TLB flush here, on the guest's behalf, can avoid @@ -3731,6 +3732,13 @@ 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. + */ + 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; @@ -12299,6 +12307,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) if (r) goto free_guest_fpu; =20 + 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.47.1.613.gc27f4b7a9f-goog From nobody Wed Dec 17 14:01:42 2025 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 95A071DE4D6 for ; Tue, 7 Jan 2025 04:26:10 +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=1736223972; cv=none; b=Jrxg1dU01MMtxLs7E9FwGGn4RpzPkyK+SeBFtnIRVhnGGkLFUxOi5A8IwIH326JYSF/f3BzXGIxSczYpVeI+iv23Ire5zepijOWGmAid8B8Fw0cAR8vQLCCOW++8x4KqJxt4bbmCazSs8m4Ako/vG61lSUOycfDqo4QOnANc7Po= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736223972; c=relaxed/simple; bh=s25S+IIcIvU6NfHzDcJg2UokwZvlhm0DiOxjBcDy6cM=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Cc:Content-Type; b=Uw6vEIbPhkoWpENJWBR/GAYZ4K1VdfO53tDvdSY6sdaINZpZM2zkZdlsWOTgoiGgFKxbGs1Nxe1c1Q2KBmBXwzmX2CA2vEFqolUYcP+SNTawZ9fb9760wQn8C02FgDDk/vEjjl90cDUTjoqEut3/tirOdLuTLU2PtHv7An8RHtU= 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=eqQ7xnXJ; 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="eqQ7xnXJ" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e54da6701d2so560220276.0 for ; Mon, 06 Jan 2025 20:26:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736223969; x=1736828769; 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=ibH41uyLFh1ZmBilF+lh7wTD30QR58+YJn14H5cwa2A=; b=eqQ7xnXJm5/3ToK3Y+KIRkGBGnT8ck5PGKRrO+7kwDPwAigKGRXf4GK3G+e/4kPMDX ekgz4GTbeegb+tTL8oJw5JKPKVgWPT2NVyH78ldkKlTwQj5TOG60v0qBzKsfwWwrYqns 5r96rlRbMS4inCmPG+jZ4Z6fcS0u/OibXrg13zgQPbBQFkL06/qykNM1qfF/wFCi/Sit 05PVOjbpTuPc2su7+W9EnC7CXII/nczz6OLpPn9Bg3191Y9s5IpDJaqsbrFpIwWU8+Oc 0Y9sIDjh8IzWeege/9zPBWSfjO7fCrITdz9JQY6xLcaw+Gk7yuhSW9fgcKiyvQcuIgP4 9YZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736223969; x=1736828769; 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=ibH41uyLFh1ZmBilF+lh7wTD30QR58+YJn14H5cwa2A=; b=Mz9TBOlSDjGqsGQcP383D35GEMh7yvt3NsTxeaQvz9gk6Iri4ERrpls96R8HUqikv6 1eQz6yOUTsTyab4wbt6wTSppt7R2KaGlnqMyVVOCft1AcQzLo0chl57Y3bLnspFj1CO0 9nd9+6Ty8p1TVtu0UP5ReeBZIRyXa77gF2Byf1AgQU2wM/hVXOHxms58AeJ2fNVmye0m 0AoaBosC1NwDcckF5JKzOhGdyl5e3SjX5UoX5bxpGzVgSJOdzr/UfHoXy2dkG+CiseXp 8k41lEmIsr9Z8WJ3qqgmYLpduLn/eL4X9YB4L3IRMS1CLjxJ12XrcsoCMganAZV3+w4m et+A== X-Forwarded-Encrypted: i=1; AJvYcCVyfUOp1xf76l6w8zulccFp0jig0MfMGuSMX8NJ4RzeIiqMgVeAeto2uFTkSlUNgwOlH09uPpD4aNYRSMM=@vger.kernel.org X-Gm-Message-State: AOJu0YxtRygXFnNlkHciLLTufFTJVMkp8v68/UZHYH5WrMly9VabpP1x 1K3aDErXJwAve27xvcy1TWfF17HVDxFpways9yGypmEJ1KolP3N+CfqCBHm5PKg257doMbWO3Tp eOA77KU/UWQ== X-Google-Smtp-Source: AGHT+IEX66bQDxVtTDO+iv5Yj+TmEWirbM3zI7mFYJ98qz1aCvyAgg8k6W+5VvQt0BAu4w5ZqXAok0ekqv+9fg== X-Received: from suleiman1.tok.corp.google.com ([2401:fa00:8f:203:66b9:6412:4213:e30a]) (user=suleiman job=sendgmr) by 2002:a05:6902:d45:b0:e39:7a90:7b2 with SMTP id 3f1490d57ef6-e538c391482mr121318276.7.1736223969501; Mon, 06 Jan 2025 20:26:09 -0800 (PST) Date: Tue, 7 Jan 2025 13:22:01 +0900 In-Reply-To: <20250107042202.2554063-1-suleiman@google.com> Message-Id: <20250107042202.2554063-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: <20250107042202.2554063-1-suleiman@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Subject: [PATCH v3 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 , David Woodhouse , 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. Change-Id: Ie1236bc787e0d3bc9aff0d35e6b82b7e5cc8fd91 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.47.1.613.gc27f4b7a9f-goog