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: <20130408171035.GA27264@merkur.ravnborg.org>
Date:	Mon, 8 Apr 2013 19:10:35 +0200
From:	Sam Ravnborg <sam@...nborg.org>
To:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
Cc:	"David S. Miller" <davem@...emloft.net>,
	Thomas Gleixner <tglx@...utronix.de>,
	LKML <linux-kernel@...r.kernel.org>, linux-arch@...r.kernel.org,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Paul McKenney <paulmck@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <peterz@...radead.org>,
	Magnus Damm <magnus.damm@...il.com>
Subject: Re: [PATCH] sparc: Use generic idle loop

> > @@ -52,17 +52,12 @@
> > 
> >  #include "kstack.h"
> > 
> > -static void sparc64_yield(int cpu)
> > +/* Idle loop support on sparc64. */
> > +void arch_cpu_idle(void)
> >  {
> >  	if (tlb_type != hypervisor) {
> >  		touch_nmi_watchdog();
> > -		return;
> > -	}
> > -
> > -	clear_thread_flag(TIF_POLLING_NRFLAG);
> > -	smp_mb__after_clear_bit();
> > -
> > -	while (!need_resched() && !cpu_is_offline(cpu)) {
> > +	} else {
> >  		unsigned long pstate;
> > 
> >  		/* Disable interrupts. */
> > @@ -73,7 +68,7 @@ static void sparc64_yield(int cpu)
> >  			: "=&r" (pstate)
> >  			: "i" (PSTATE_IE));
> > 
> > -		if (!need_resched() && !cpu_is_offline(cpu))
> > +		if (!need_resched() && !cpu_is_offline(smp_processor_id()))
> >  			sun4v_cpu_yield();
> > 
> >  		/* Re-enable interrupts. */
> > @@ -84,36 +79,16 @@ static void sparc64_yield(int cpu)
> >  			: "=&r" (pstate)
> >  			: "i" (PSTATE_IE));
> >  	}
> > -
> > -	set_thread_flag(TIF_POLLING_NRFLAG);
> > +	local_irq_enable();
> >  }
> 
> Nitpick: you can probably move the local_irq_enable() to the
> 'if' block, since the else block already has assembly code to enable
> the interrupts. But anyway its up to you.

I think not.
local_irq_disable writes 0 to the PIL register,
whereas the above code set the IE (Interrupt enable) bit to 0.

So the implementations differs - and I think there is a good
reason for being so.

But this is the part where I refer to that I am fooling around
in code that I do not understand.
I re-checked the SPARC V9 manual - but I did not within a few minutes
reading understand what is the difference between the twoo.

	Sam
--
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