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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 05 Jan 2011 18:08:31 +0800
From:	Xiao Guangrong <xiaoguangrong@...fujitsu.com>
To:	Avi Kivity <avi@...hat.com>
CC:	Marcelo Tosatti <mtosatti@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>, KVM <kvm@...r.kernel.org>
Subject: Re: [PATCH 3/3] KVM: make make_all_cpus_request() lockless

On 01/05/2011 05:54 PM, Avi Kivity wrote:

>> +        kvm_make_request(req, vcpu);
>>           cpu = vcpu->cpu;
>>           if (cpus != NULL&&  cpu != -1&&  cpu != me&&
>>           atomic_read(&vcpu->guest_mode))
>> @@ -163,7 +161,7 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req)
>>           smp_call_function_many(cpus, ack_flush, NULL, 1);
>>       else
>>           called = false;
>> -    raw_spin_unlock(&kvm->requests_lock);
>> +    put_cpu();
>>       free_cpumask_var(cpus);
>>       return called;
>>   }
> 
> Maybe we can drop 'cpu != me' and then we don't need to disable preemption?
> 

Preemption should be disabled in the caller site of smp_call_function_many():

......

 * You must not call this function with disabled interrupts or from a
 * hardware interrupt handler or from a bottom half handler. Preemption
 * must be disabled when calling this function.
 */
void smp_call_function_many(const struct cpumask *mask,
			    smp_call_func_t func, void *info, bool wait)
{

......

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ