All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [BUG] target width of shifts on 64 bits
@ 2007-04-18 18:13 Jan Kiszka
  2007-04-18 20:07 ` Philippe Gerum
  0 siblings, 1 reply; 15+ messages in thread
From: Jan Kiszka @ 2007-04-18 18:13 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai-core

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

Hi Philippe,

here is an explanation of the scalable scheduler issue I face on x86_64
under different gcc compilers:

        unsigned long x = 0;
        int n = 32;

        x |= 1 << n;

The last instruction translates to:

	mov    0xfffffffffffffffc(%rbp),%ecx
	mov    $0x1,%eax
	shl    %cl,%eax
	cltq
	or     %rax,0xfffffffffffffff0(%rbp)

That means we only shift with 32-bit precision although the target type
is 64 bit. We find such code for setting the queue usage bits in
addmlq(), but probably elsewhere too. This variant lets gcc generate the
desired code:

	x |= (unsigned long)1 << n;

Compiler issue, x86_64-specific oddity, or generic 64-bit problem we may
have across the ipipe and Xenomai code (ppc64, ia64?)?

After patching nucleus/queue.h appropriately, my oopses disappear, but
RT threads still do not run (no CSW to the threads latency creates).

Jan


PS: If you are interested, I could post a modified qemu patch that
enables gdb kernel debugging under x86_64.


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2007-04-23 13:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-18 18:13 [Xenomai-core] [BUG] target width of shifts on 64 bits Jan Kiszka
2007-04-18 20:07 ` Philippe Gerum
2007-04-18 20:27   ` Gilles Chanteperdrix
2007-04-18 21:07     ` Jan Kiszka
2007-04-18 21:30       ` Gilles Chanteperdrix
2007-04-18 22:05         ` Jan Kiszka
2007-04-18 21:07   ` Jan Kiszka
2007-04-23  9:35     ` Jan Kiszka
2007-04-23 10:30       ` Philippe Gerum
2007-04-23 10:37         ` Gilles Chanteperdrix
2007-04-23 10:52           ` Gilles Chanteperdrix
2007-04-23 12:48             ` Jan Kiszka
2007-04-23 13:00               ` Gilles Chanteperdrix
2007-04-23 13:04                 ` Jan Kiszka
2007-04-23 13:08               ` Philippe Gerum

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.