lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZqmNTl8KrjpfsRuR@chao-email>
Date: Wed, 31 Jul 2024 09:03:10 +0800
From: Chao Gao <chao.gao@...el.com>
To: Suleiman Souhlal <ssouhlal@...ebsd.org>
CC: Suleiman Souhlal <suleiman@...gle.com>, Sean Christopherson
	<seanjc@...gle.com>, Paolo Bonzini <pbonzini@...hat.com>, Thomas Gleixner
	<tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov
	<bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, <x86@...nel.org>,
	"H. Peter Anvin" <hpa@...or.com>, <kvm@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] KVM: x86: Include host suspended time in steal time.

>> >+static int
>> >+kvm_arch_resume_notifier(struct kvm *kvm)
>> >+{
>> >+	kvm->last_suspend_duration = ktime_get_boottime_ns() -
>> >+	    kvm->suspended_time;
>> 
>> Is it possible that a vCPU doesn't get any chance to run (i.e., update steal
>> time) between two suspends? In this case, only the second suspend would be
>> recorded.
>
>Good point. I'll address this.
>
>> 
>> Maybe we need an infrastructure in the PM subsystem to record accumulated
>> suspended time. When updating steal time, KVM can add the additional suspended
>> time since the last update into steal_time (as how KVM deals with
>> current->sched_info.run_deley). This way, the scenario I mentioned above won't
>> be a problem and KVM needn't calculate the suspend duration for each guest. And
>> this approach can potentially benefit RISC-V and ARM as well, since they have
>> the same logic as x86 regarding steal_time.
>
>Thanks for the suggestion.
>I'm a bit wary of making a whole PM subsystem addition for such a counter, but
>maybe I can make a architecture-independent KVM change for it, with a PM
>notifier in kvm_main.c.

Sounds good.

>
>> 
>> Additionally, it seems that if a guest migrates to another system after a suspend
>> and before updating steal time, the suspended time is lost during migration. I'm
>> not sure if this is a practical issue.
>
>The systems where the host suspends don't usually do VM migrations. Or at least
>the ones where we're encountering the problem this patch is trying to address
>don't (laptops).
>But even if they did, it doesn't seem that likely that the migration would
>happen over a host suspend.
>If it's ok with you, I'll put this issue aside for the time being.

I am fine with putting this issue aside.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ