All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <roland@topspin.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: anton@au.ibm.com,
	linuxppc64-dev <linuxppc64-dev@lists.linuxppc.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Fix ppc64 out_be64
Date: 13 Jun 2004 09:48:01 -0700	[thread overview]
Message-ID: <52llir5rr2.fsf@topspin.com> (raw)
In-Reply-To: <1087141822.8210.176.camel@gaston>

    Benjamin> Ugh ? The syntax of std is std rS, ds(rA), so your fix
    Benjamin> doesn't look good to me, and it definitely builds with
    Benjamin> the current syntax, though I agree the type is indeed
    Benjamin> wrong. I also spotted another bug where we forgot to
    Benjamin> change an eieio into sync in there though.

Although the kernel builds, it's only because no one actually uses
out_be64.  You can try the old version and see:

    > cat foo.c
    static inline void out_be64(volatile unsigned long *addr, unsigned
    long val)
    {
            __asm__ __volatile__("std %1,0(%0); eieio" : "=m" (*addr) :
    "r" (val));
    }

    void foo(void *x, unsigned long y)
    {
            out_be64(x, y);
    }
    $ ${CROSS_COMPILE}gcc -save-temps -c foo.c
    foo.s: Assembler messages:
    foo.s:49: Error: syntax error; found `(' but expected `)'
    foo.s:49: Error: junk at end of line: `(9))'

Looking at foo.s, it's pretty obvious that %0 is already in the ds(rA)
form, and adding 0() around it breaks things.  out_be64 expands to:

    #APP
            std 0,0(0(9)); eieio
    #NO_APP

It's possible this is an artifact of my cross-toolchain (gcc
3.4.0/binutils 2.15 built with Dan Kegel's crosstool), 

    Benjamin> Does this totally untested patch works for you ?

Yes, that looks fine (after fixing val to be unsigned long in
out_be64).  You know infinitely more about ppc64 asm than I do so I'm
sure your version is better.

Thanks,
  Roland

  parent reply	other threads:[~2004-06-13 16:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-12 22:00 [PATCH] Fix ppc64 out_be64 Roland Dreier
2004-06-13 15:50 ` Benjamin Herrenschmidt
2004-06-13 16:21   ` Anton Blanchard
2004-06-13 17:08     ` Benjamin Herrenschmidt
2004-06-13 16:48   ` Roland Dreier [this message]
2004-06-13 17:11     ` Benjamin Herrenschmidt
2004-06-14 20:26       ` Roland Dreier
2004-06-14 21:10         ` Benjamin Herrenschmidt

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=52llir5rr2.fsf@topspin.com \
    --to=roland@topspin.com \
    --cc=anton@au.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@lists.linuxppc.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.