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: <200808281425.57336.borntraeger@de.ibm.com>
Date:	Thu, 28 Aug 2008 14:25:57 +0200
From:	Christian Borntraeger <borntraeger@...ibm.com>
To:	Jeremy Fitzhardinge <jeremy@...p.org>
Cc:	Ingo Molnar <mingo@...e.hu>, Jens Axboe <jens.axboe@...cle.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Arjan van de Ven <arjan@...radead.org>
Subject: Re: [PATCH RFC 3/3] x86: use mwait for trigger API

Am Samstag, 16. August 2008 schrieb Jeremy Fitzhardinge:

Seems that this cant work. We never reset the t->cpus bits. That means we 
never mwait after a kick.

See:

> +void mwait_trigger_reset(trigger_t *t)
> +{
> +	unsigned long flags;
> +
> +	t->trigger = 0;
> +
> +	local_save_flags(flags);
> +	__get_cpu_var(mwait_saved_flags) = flags;
> +
> +	__monitor(&t->trigger, 0, 0);
> +}
> +
> +void mwait_trigger_wait(trigger_t *t)
> +{
> +	unsigned long flags = __get_cpu_var(mwait_saved_flags);
> +	int cpu = smp_processor_id();
> +
> +	if (irqs_disabled_flags(flags)) {
> +		while(!cpu_isset(cpu, t->cpus)) {

We check the bits here

> +			__mwait(0, 0);
> +			barrier();
> +			__monitor(&t->trigger, 0, 0);
> +		}
> +	} else {
> +		while(!cpu_isset(cpu, t->cpus)) {

and here

> +			__sti_mwait(0, 0);
> +			barrier();
> +			local_irq_disable();
> +			__monitor(&t->trigger, 0, 0);
> +		}
> +	}
> +}
> +
> +void mwait_trigger_finish(trigger_t *t)
> +{
> +	local_irq_restore(__get_cpu_var(mwait_saved_flags));
> +}
> +
> +void mwait_trigger_kick(trigger_t *t)
> +{
> +	cpus_setall(t->cpus);

We set the bits here.

> +	smp_wmb();
> +	t->trigger = 1;
> +	smp_wmb();
> +}

Nothing else.
--
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