On Wed, Aug 21, 2024 at 2:40 PM Chao Gao <chao.gao@xxxxxxxxx> wrote: > > On Tue, Aug 20, 2024 at 01:35:41PM +0900, Suleiman Souhlal wrote: > >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 <suleiman@xxxxxxxxxx> > > Reviewed-by: Chao Gao <chao.gao@xxxxxxxxx> > > one nit below > > >--- > > 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 > > > >+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); > > } > > > >+static u64 last_suspend; > >+static u64 total_suspend_ns; > >+ > >+u64 > >+kvm_total_suspend_ns(void) > > nit: don't wrap before the function name. Sorry, I completely missed that, even after Sean told me. Force of habit (FreeBSD style(9) says you have to do it). If I send another version I will fix that. -- Suleiman