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: <YS3Xm9yEUO1DsR+G@hirez.programming.kicks-ass.net>
Date:   Tue, 31 Aug 2021 09:17:47 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Tianqiang Xu <skyele@...u.edu.cn>
Cc:     x86@...nel.org, pbonzini@...hat.com, seanjc@...gle.com,
        vkuznets@...hat.com, wanpengli@...cent.com, jmattson@...gle.com,
        joro@...tes.org, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, kvm@...r.kernel.org, hpa@...or.com,
        jarkko@...nel.org, dave.hansen@...ux.intel.com,
        linux-kernel@...r.kernel.org, linux-sgx@...r.kernel.org
Subject: Re: [PATCH 3/4] KVM host implementation

On Tue, Aug 31, 2021 at 09:16:09AM +0200, Peter Zijlstra wrote:
> On Tue, Aug 31, 2021 at 09:59:18AM +0800, Tianqiang Xu wrote:
> > @@ -4304,8 +4374,14 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
> >  	idx = srcu_read_lock(&vcpu->kvm->srcu);
> >  	if (kvm_xen_msr_enabled(vcpu->kvm))
> >  		kvm_xen_runstate_set_preempted(vcpu);
> > -	else
> > +	else {
> >  		kvm_steal_time_set_preempted(vcpu);
> > +
> > +		if (get_cpu_nr_running(smp_processor_id()) <= 1)
> > +			kvm_steal_time_set_is_idle(vcpu);
> > +		else
> > +			kvm_steal_time_clear_is_idle(vcpu);
> > +	}
> >  	srcu_read_unlock(&vcpu->kvm->srcu, idx);
> 
> 
> This cannot be right. The CPU could long since be running tasks again,
> but as long as this vCPU crud doesn't run, the guest keeps thinking it's
> physically idle.

More fundamentally, a blocked task doesn't have a CPU. So unless you've
pinned your vCPU threads to physical CPUs, the whole thing is bonkers.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ