All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [BUG] target width of shifts on 64 bits
Date: Wed, 18 Apr 2007 20:13:28 +0200	[thread overview]
Message-ID: <46265FC8.1070207@domain.hid> (raw)

[-- 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 --]

             reply	other threads:[~2007-04-18 18:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-18 18:13 Jan Kiszka [this message]
2007-04-18 20:07 ` [Xenomai-core] [BUG] target width of shifts on 64 bits 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

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=46265FC8.1070207@domain.hid \
    --to=jan.kiszka@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.