<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/arch/um/os-Linux, branch tegra</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>um: Save FPU registers between task switches</title>
<updated>2011-09-15T01:09:37+00:00</updated>
<author>
<name>Ingo van Lil</name>
<email>inguin@gmx.de</email>
</author>
<published>2011-09-14T23:21:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fbfe9c847edf57ac8232aeafb290f272289893a3'/>
<id>fbfe9c847edf57ac8232aeafb290f272289893a3</id>
<content type='text'>
Some time ago Jeff prepared 42daba316557 ("uml: stop saving process FP
state") for UML to stop saving the process FP state between task
switches.  The assumption was that since with SKAS0 every guest process
runs inside a host process context the host OS will take care of keeping
the proper FP state.

Unfortunately this is not true for multi-threaded applications, where
all guest threads share a single host process context yet all may use
the FPU on their own.  Although I haven't verified it I suspect things
to be even worse in SKAS3 mode where all guest processes run inside a
single host process.

The patch reintroduces the saving and restoring of the FP context
between task switches.

[richard@nod.at: Ingo posted this patch in 2009, sadly it was never applied
and got lost. Now in 2011 the problem was reported by Gunnar.]

Signed-off-by: Ingo van Lil &lt;inguin@gmx.de&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Reported-by: &lt;gunnarlindroth@hotmail.com&gt;
Tested-by: &lt;gunnarlindroth@hotmail.com&gt;
Cc: Stanislav Meduna &lt;stano@meduna.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some time ago Jeff prepared 42daba316557 ("uml: stop saving process FP
state") for UML to stop saving the process FP state between task
switches.  The assumption was that since with SKAS0 every guest process
runs inside a host process context the host OS will take care of keeping
the proper FP state.

Unfortunately this is not true for multi-threaded applications, where
all guest threads share a single host process context yet all may use
the FPU on their own.  Although I haven't verified it I suspect things
to be even worse in SKAS3 mode where all guest processes run inside a
single host process.

The patch reintroduces the saving and restoring of the FP context
between task switches.

[richard@nod.at: Ingo posted this patch in 2009, sadly it was never applied
and got lost. Now in 2011 the problem was reported by Gunnar.]

Signed-off-by: Ingo van Lil &lt;inguin@gmx.de&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Reported-by: &lt;gunnarlindroth@hotmail.com&gt;
Tested-by: &lt;gunnarlindroth@hotmail.com&gt;
Cc: Stanislav Meduna &lt;stano@meduna.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: disable scan_elf_aux() on x86_64</title>
<updated>2011-07-26T03:57:13+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2011-07-26T00:12:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b743ac54e54ca18fb7164a97cc77cf1ccee0b0f7'/>
<id>b743ac54e54ca18fb7164a97cc77cf1ccee0b0f7</id>
<content type='text'>
Reusing the host's vDSO makes only sense on x86_32.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reusing the host's vDSO makes only sense on x86_32.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uml: free resources</title>
<updated>2011-07-26T03:57:13+00:00</updated>
<author>
<name>Davidlohr Bueso</name>
<email>dave@gnu.org</email>
</author>
<published>2011-07-26T00:12:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2a6d0ac182688d4d23357ece744978706c044aad'/>
<id>2a6d0ac182688d4d23357ece744978706c044aad</id>
<content type='text'>
When creating the temp file there's a memory and file descriptor leak upon
error.

Signed-off-by: Davidlohr Bueso &lt;dave@gnu.org&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Reviewed-by: Vitaliy Ivanov &lt;vitalivanov@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When creating the temp file there's a memory and file descriptor leak upon
error.

Signed-off-by: Davidlohr Bueso &lt;dave@gnu.org&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Reviewed-by: Vitaliy Ivanov &lt;vitalivanov@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uml: helper.c warning corrections</title>
<updated>2011-07-26T03:57:13+00:00</updated>
<author>
<name>Vitaliy Ivanov</name>
<email>vitalivanov@gmail.com</email>
</author>
<published>2011-07-26T00:12:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2fdf2130926f07881c75e3905ece472c37d7703f'/>
<id>2fdf2130926f07881c75e3905ece472c37d7703f</id>
<content type='text'>
Fix this warning:

  arch/um/os-Linux/helper.c: In function `helper_child':
  arch/um/os-Linux/helper.c:38:7: warning: ignoring return value of `write', declared with attribute warn_unused_result

[richard@nod.at: happens only with -D_FORTIFY_SOURCE=2]
Signed-off-by: Vitaliy Ivanov &lt;vitalivanov@gmail.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix this warning:

  arch/um/os-Linux/helper.c: In function `helper_child':
  arch/um/os-Linux/helper.c:38:7: warning: ignoring return value of `write', declared with attribute warn_unused_result

[richard@nod.at: happens only with -D_FORTIFY_SOURCE=2]
Signed-off-by: Vitaliy Ivanov &lt;vitalivanov@gmail.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: fix _FORTIFY_SOURCE=2 support for kernel modules</title>
<updated>2011-07-26T03:57:12+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2011-07-26T00:12:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f956b3e40ad7b9f7c0d33b80fe78f57fedb74f49'/>
<id>f956b3e40ad7b9f7c0d33b80fe78f57fedb74f49</id>
<content type='text'>
When UML is compiled with _FORTIFY_SOURCE we have to export all _chk()
functions which are used in modules.  For now it's only the case for
__sprintf_chk().

Tested-by: Florian Fainelli &lt;florian@openwrt.org&gt;
Reported-by: Florian Fainelli &lt;florian@openwrt.org&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Acked-by: Vitaliy Ivanov &lt;vitalivanov@gmail.com&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When UML is compiled with _FORTIFY_SOURCE we have to export all _chk()
functions which are used in modules.  For now it's only the case for
__sprintf_chk().

Tested-by: Florian Fainelli &lt;florian@openwrt.org&gt;
Reported-by: Florian Fainelli &lt;florian@openwrt.org&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Acked-by: Vitaliy Ivanov &lt;vitalivanov@gmail.com&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: fix crash while os_dump_core()</title>
<updated>2011-05-25T15:39:42+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2011-05-25T00:13:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=db271cf03f5fe39feab8e1b1818c0880c7290c5c'/>
<id>db271cf03f5fe39feab8e1b1818c0880c7290c5c</id>
<content type='text'>
os_dump_core() emits SIGTERM to terminate all UML processes.  Kernel
threads have to exit on SIGTERM instead of calling last_ditch_exit().
Multiple calls to last_ditch_exit() can cause a crash.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
os_dump_core() emits SIGTERM to terminate all UML processes.  Kernel
threads have to exit on SIGTERM instead of calling last_ditch_exit().
Multiple calls to last_ditch_exit() can cause a crash.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: add earlyprintk support</title>
<updated>2011-05-25T15:39:41+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2011-05-25T00:13:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d634f194d4e2e58d57927c812aca097e67a2287d'/>
<id>d634f194d4e2e58d57927c812aca097e67a2287d</id>
<content type='text'>
User Mode Linux can also benefit from earlyprintk.  UML's earlyprintk
writes kernel messages directly to stdout.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
User Mode Linux can also benefit from earlyprintk.  UML's earlyprintk
writes kernel messages directly to stdout.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: remove SIGHUP handler</title>
<updated>2011-05-25T15:39:40+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2011-05-25T00:13:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2525e70d492f8c7bbe1292db8fcd973607a56ac6'/>
<id>2525e70d492f8c7bbe1292db8fcd973607a56ac6</id>
<content type='text'>
The UML kernel ignores SIGHUP anyway.  This handler is in vain.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The UML kernel ignores SIGHUP anyway.  This handler is in vain.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: fix UML_LIB_PATH</title>
<updated>2011-05-25T15:39:40+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2011-05-25T00:13:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0ce451acb1872eab0fcf22753f93f51567e812fa'/>
<id>0ce451acb1872eab0fcf22753f93f51567e812fa</id>
<content type='text'>
UML_LIB_PATH is hardcoded to /usr/lib/uml/, on 64bit systems UML_LIB_PATH
needs to be /usr/lib64/uml/.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
UML_LIB_PATH is hardcoded to /usr/lib/uml/, on 64bit systems UML_LIB_PATH
needs to be /usr/lib64/uml/.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: fix abort</title>
<updated>2011-05-18T09:55:23+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2011-05-17T22:44:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b2db21997f43907f54500edaf063253ca2a186f9'/>
<id>b2db21997f43907f54500edaf063253ca2a186f9</id>
<content type='text'>
os_dump_core() uses abort() to terminate UML in case of an fatal error.

glibc's abort() calls raise(SIGABRT) which makes use of tgkill().
tgkill() has no effect within UML's kernel threads because they are not
pthreads.  As fallback abort() executes an invalid instruction to
terminate the process.  Therefore UML gets killed by SIGSEGV and leaves a
ugly log entry in the host's kernel ring buffer.

To get rid of this we use our own abort routine.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
os_dump_core() uses abort() to terminate UML in case of an fatal error.

glibc's abort() calls raise(SIGABRT) which makes use of tgkill().
tgkill() has no effect within UML's kernel threads because they are not
pthreads.  As fallback abort() executes an invalid instruction to
terminate the process.  Therefore UML gets killed by SIGSEGV and leaves a
ugly log entry in the host's kernel ring buffer.

To get rid of this we use our own abort routine.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
