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: <CANRm+Cyix-AzUO2+osGz+1M6vh=pjafjNQcrUBKWB5NOD853kQ@mail.gmail.com>
Date:	Thu, 19 May 2016 19:48:45 +0800
From:	Wanpeng Li <kernellwp@...il.com>
To:	Christian Borntraeger <borntraeger@...ibm.com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	kvm <kvm@...r.kernel.org>, Wanpeng Li <wanpeng.li@...mail.com>,
	Paolo Bonzini <pbonzini@...hat.com>,
	Radim Krčmář <rkrcmar@...hat.com>,
	David Matlack <dmatlack@...gle.com>
Subject: Re: [PATCH] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 19:42 GMT+08:00 Christian Borntraeger <borntraeger@...ibm.com>:
> On 05/19/2016 01:35 PM, Wanpeng Li wrote:
>> 2016-05-19 19:23 GMT+08:00 Christian Borntraeger <borntraeger@...ibm.com>:
>>> On 05/19/2016 11:26 AM, Wanpeng Li wrote:
>>>
>>> I think in general a good idea to poll if a timer will expire soon.
>>>
>>> Some patch comments:
>>>
>>> Same for all non-x86 archs:
>>>> +static inline unsigned int kvm_arch_timer_remaining(struct kvm_vcpu *vcpu) {}
>>>
>>> A function returning int, without a return statement?
>>> That gives at least a compiler warning.
>>
>> How about return 0 for all non-x86 archs?
>
> We will provide an s390 implementation soon, but until then a proper
> default would be good.
>
> [....]
>>>> +     if (vcpu->halt_poll_ns || (remaining < halt_poll_ns_base)) {
>
> but then remaining is 0 and the 2nd condition will always be true, no?

Nice catch!

How about something like below:

+       if (vcpu->halt_poll_ns ||
+               (remaining != 0 && remaining < halt_poll_ns_base)) {

Regards,
Wanpeng Li

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ