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: <c6a23208-4432-6fc4-a3f8-56a6aff07fd8@oracle.com>
Date:   Mon, 4 Nov 2019 11:49:27 +0800
From:   Zhenzhong Duan <zhenzhong.duan@...cle.com>
To:     Marcelo Tosatti <mtosatti@...hat.com>
Cc:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        joao.m.martins@...cle.com, rafael.j.wysocki@...el.com,
        rkrcmar@...hat.com, pbonzini@...hat.com
Subject: Re: [PATCH 1/5] KVM: simplify branch check in host poll code


On 2019/11/2 5:03, Marcelo Tosatti wrote:
> On Sat, Oct 26, 2019 at 11:23:55AM +0800, Zhenzhong Duan wrote:
>> Remove redundant check.
>>
>> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@...cle.com>
>> ---
>>   virt/kvm/kvm_main.c | 9 ++++-----
>>   1 file changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 67ef3f2..2ca2979 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -2366,13 +2366,12 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
>>   		} else if (halt_poll_ns) {
>>   			if (block_ns <= vcpu->halt_poll_ns)
>>   				;
>> -			/* we had a long block, shrink polling */
>> -			else if (vcpu->halt_poll_ns && block_ns > halt_poll_ns)
>> -				shrink_halt_poll_ns(vcpu);
>>   			/* we had a short halt and our poll time is too small */
>> -			else if (vcpu->halt_poll_ns < halt_poll_ns &&
> This is not a redundant check: it avoids from calling
> into grow_halt_poll_ns, which will do:
>
> 	1) Multiplication
> 	2) Cap that back to halt_poll_ns
> 	3) Invoke the trace_kvm_halt_poll_ns_grow tracepoint
> 	   (when in fact vcpu->halt_poll_ns did not grow).

In this branch, vcpu->halt_poll_ns < block_ns is true, and if block_ns < 
halt_poll_ns,

then vcpu->halt_poll_ns < halt_poll_ns is always true, isn't it?


I realized I ignored the situation that halt_poll_ns and 
halt_poll_ns_grow could be

updated at runtime, so pls ignore this patch, I'll fix it by following 
the guest haltpoll code.

Thanks

Zhenzhong

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ