All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: Petr Cervenka <grugh@domain.hid>, xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH 2/3] x86-64: Work around gcc issues with populating syscall registers
Date: Sun, 19 Jul 2009 10:00:56 +0200	[thread overview]
Message-ID: <4A62D2B8.8030907@domain.hid> (raw)
In-Reply-To: <4A62D1C1.9050807@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 1049 bytes --]

gcc-4.1.3 of kubuntu has problem with proper syscall register
initialization in rt_task_shadow if TLS is enabled. But it is likely
that more compiler versions below 4.3 and more configuration variants
are affected.

This patch installs a workaround for these gcc versions which places an
optimization barrier before the register variable setup. This forces gcc
to actually load the registers.

Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
---

 include/asm-x86/syscall_64.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/syscall_64.h b/include/asm-x86/syscall_64.h
index adaa40b..6918ac4 100644
--- a/include/asm-x86/syscall_64.h
+++ b/include/asm-x86/syscall_64.h
@@ -82,7 +82,11 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
  * in kernel space.
  */
 
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
+#define LOAD_ARGS_0()	asm volatile ("" ::: "memory");
+#else
 #define LOAD_ARGS_0()
+#endif
 #define LOAD_REGS_0
 #define ASM_ARGS_0
 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

  parent reply	other threads:[~2009-07-19  8:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4A62D1C1.9050807@domain.hid>
2009-07-19  8:00 ` [Xenomai-core] [PATCH 1/3] native: Align documentation to code Jan Kiszka
2009-07-19  8:00 ` Jan Kiszka [this message]
2009-07-19 13:42   ` [Xenomai-core] [PATCH 2/3] x86-64: Work around gcc issues with populating syscall registers Gilles Chanteperdrix
2009-07-19 14:31     ` Philippe Gerum
2009-07-19 15:12   ` Gilles Chanteperdrix
2009-07-19 15:23     ` Jan Kiszka
2009-07-19 15:35       ` Philippe Gerum
2009-07-20  6:37         ` Jan Kiszka
2009-07-19  8:01 ` [Xenomai-core] [PATCH 3/3] x86: Merge syscall_{32|64}.h into syscall.h Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A62D2B8.8030907@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=grugh@domain.hid \
    --cc=rpm@xenomai.org \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.