public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <len.brown@intel.com>
To: Arkadiusz Miskiewicz <arekm@pld-linux.org>
Cc: Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
	linux-kernel@vger.kernel.org,
	ACPI Developers <acpi-devel@lists.sourceforge.net>
Subject: Re: Linux 2.4.26-rc1 (cmpxchg vs 80386 build)
Date: 28 Mar 2004 23:49:15 -0500	[thread overview]
Message-ID: <1080535754.16221.188.camel@dhcppc4> (raw)
In-Reply-To: <A6974D8E5F98D511BB910002A50A6647615F6939@hdsmsx402.hd.intel.com>

On Sun, 2004-03-28 at 10:24, Arkadiusz Miskiewicz wrote:

> ACPI uses cmpxchg so it's not possible to build it for i386 it seems.
>
> +__acpi_release_global_lock (unsigned int *lock)
> +{
> +       unsigned int old, new, val;
> +       do {
> +               old = *lock;
> +               new = old & ~0x3;
> +               val = cmpxchg(lock, old, new);
> +       } while (unlikely (val != old));
> +       return old & 0x1;
> +}
> 

> -o vmlinux
> drivers/acpi/acpi.o(.text+0x4cf4): In function
> `acpi_ev_global_lock_handler':
> : undefined reference to `cmpxchg'
> drivers/acpi/acpi.o(.text+0x4dc6): In function
> `acpi_ev_acquire_global_lock':
> : undefined reference to `cmpxchg'
> drivers/acpi/acpi.o(.text+0x4e4b): In function
> `acpi_ev_release_global_lock':
> : undefined reference to `cmpxchg'

ACPI unconditionally used cmpxchg before this change also -- from asm().
The asm() was broken, so we replaced it with C,
which invokes the cmpxchg macro, which isn't defined for
an 80386 build.

I guess it is a build bug that the assembler allowed us
to invoke cmpxchg in an asm() for an 80386 build in earlier releases.

I'm open to suggestions on the right way to fix this.

1. recommend CONFIG_ACPI=n for 80386 build.

2. force CONFIG_ACPI=n for 80386 build.

3. invoke cmpxchg from acpi even for 80386 build.

4. re-implement locks for the 80386 case.

I guess it depends on why one would build
for 808386 and CONFIG_ACPI=y.  Certainly
there is no risk of 80386 hardware actually
running the CMPXCHG in the ACPI code --
80386 was EOL'd long before ACPI came out
and 2.4.25 (and earlier) would have died on us.

I don't like #1 b/c I don't want to get more
e-mail like this;-)

#2 wouldn't bother me.  But if somebody is
building for i386 for the purpose for de-tuning
the compiler and they really do want ACPI support,
it would bother them.

#3 would be the old behaviour, which also
wouldn't bother me.  I guess we'd duplicate the
macro inside the ACPI code so that others didn't
use it by mistake.

#4 would be an academic exercise, since the code
would never actually execute on an 80386.

suggestions?

thanks,
-Len



       reply	other threads:[~2004-03-29  4:49 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <A6974D8E5F98D511BB910002A50A6647615F6939@hdsmsx402.hd.intel.com>
2004-03-29  4:49 ` Len Brown [this message]
2004-03-29  0:09   ` [ACPI] Re: Linux 2.4.26-rc1 (cmpxchg vs 80386 build) Andi Kleen
2004-03-29  5:22   ` Willy Tarreau
2004-03-29  7:01     ` Denis Vlasenko
2004-03-29 19:57       ` Willy Tarreau
2004-03-29 22:07     ` Len Brown
2004-03-30 12:56       ` [ACPI] " Alan Cox
2004-03-30 13:15         ` Richard B. Johnson
2004-03-30 14:22           ` Willy Tarreau
2004-03-30 14:48             ` Richard B. Johnson
2004-03-30 15:09               ` Willy Tarreau
2004-03-30 15:33                 ` Richard B. Johnson
2004-03-30 16:14                   ` Willy Tarreau
2004-03-30 16:42                     ` Chris Friesen
2004-03-30 17:44                       ` Len Brown
2004-03-30 18:30                         ` Arkadiusz Miskiewicz
2004-03-30 20:05                           ` Len Brown
2004-03-30 20:25                             ` Arkadiusz Miskiewicz
2004-03-30 21:49                               ` Len Brown
2004-03-30 20:08                         ` Bill Davidsen
2004-03-31 11:13                           ` Maciej W. Rozycki
2004-03-31 13:04                             ` Bill Davidsen
2004-03-31 15:02                             ` Jamie Lokier
2004-04-01 12:29                               ` Maciej W. Rozycki
2004-04-01 13:17                                 ` Richard B. Johnson
2004-05-08 10:18                                   ` Denis Vlasenko
2004-04-01 20:46                                 ` Len Brown
2004-04-02 10:54                                   ` Maciej W. Rozycki

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=1080535754.16221.188.camel@dhcppc4 \
    --to=len.brown@intel.com \
    --cc=acpi-devel@lists.sourceforge.net \
    --cc=arekm@pld-linux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox