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: <Pine.LNX.4.64.0701101436370.3594@woody.osdl.org>
Date:	Wed, 10 Jan 2007 14:43:56 -0800 (PST)
From:	Linus Torvalds <torvalds@...l.org>
To:	Geert Uytterhoeven <geert@...ux-m68k.org>
cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Andrew Morton <akpm@...l.org>,
	Al Viro <viro@...iv.linux.org.uk>,
	Linux Kernel Development <linux-kernel@...r.kernel.org>,
	Linux/m68k <linux-m68k@...r.kernel.org>
Subject: Re: [PATCH] mm: pagefault_{disable,enable}()



On Wed, 10 Jan 2007, Geert Uytterhoeven wrote:
>
> > The REAL problem seems to be that the m68k preempt.h (or rather, to be 
> > exact, asm/thread_info.h) doesn't do things right, and while it exposes 
> > "inc_preempt_count()", it doesn't expose enough information to actually 
> > use it.
> > 
> > I think your "current_thread_info()" is broken.
> 
> But struct task_struct is defined in <linux/sched.h>, which cannot be included
> in <asm/thread_info.h> due to include recursion hell.

But why do you need "struct task_struct" at all?

The reason this doesn't happen on other platforms is that they don't use 
"struct task_struct". They use "struct thread_info", which is where the 
preemption counter is.

The problem on m68k i sthat broken indirection through "current", which is 
unnecessary. Isn't the thread structure on the stack on m68k too? So you 
could do what x86 does, and just do

	movel %a7,%d0
	andl $STACK_MASK,%d0

or something, and thus go directly to the thread-info rather than load it 
off the task pointer.

Or, if worst comes to worst, you can just hardcode the offset of the 
thread-info pointer in the "struct task_struct". It's the second word 
after "state". Ugly, but less so than forcing everybody who does NOT want 
to have that big <linux/sched.h> dependency to get it.

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