* .set mips2 breaks 64bit kernel (Re: CVS Update@linux-mips.org: linux)
[not found] <20050614173512Z8225617-1340+8840@linux-mips.org>
@ 2005-06-22 7:31 ` Atsushi Nemoto
2005-06-22 12:33 ` Maciej W. Rozycki
0 siblings, 1 reply; 6+ messages in thread
From: Atsushi Nemoto @ 2005-06-22 7:31 UTC (permalink / raw)
To: linux-mips, macro
>>>>> On Tue, 14 Jun 2005 18:35:06 +0100, macro@linux-mips.org said:
macro> Modified files:
macro> arch/mips/kernel: semaphore.c
macro> include/asm-mips: atomic.h bitops.h system.h
macro> Log message:
macro> Enable a suitable ISA for the assembler around ll/sc so that code
macro> builds even for processors that don't support the instructions.
macro> Plus minor formatting fixes.
Please do not set mips2 unconditionaly. It breaks 64bit kernel.
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: .set mips2 breaks 64bit kernel (Re: CVS Update@linux-mips.org: linux)
2005-06-22 7:31 ` .set mips2 breaks 64bit kernel (Re: CVS Update@linux-mips.org: linux) Atsushi Nemoto
@ 2005-06-22 12:33 ` Maciej W. Rozycki
2005-06-22 12:55 ` Kumba
0 siblings, 1 reply; 6+ messages in thread
From: Maciej W. Rozycki @ 2005-06-22 12:33 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: linux-mips
On Wed, 22 Jun 2005, Atsushi Nemoto wrote:
> macro> Log message:
> macro> Enable a suitable ISA for the assembler around ll/sc so that code
> macro> builds even for processors that don't support the instructions.
> macro> Plus minor formatting fixes.
>
> Please do not set mips2 unconditionaly. It breaks 64bit kernel.
Any specifics please? It works for me -- I wouldn't have committed it
otherwise. In particular in the affected range there are no operations
that would require a 64-bit ISA.
Maciej
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: .set mips2 breaks 64bit kernel (Re: CVS Update@linux-mips.org: linux)
2005-06-22 12:33 ` Maciej W. Rozycki
@ 2005-06-22 12:55 ` Kumba
2005-06-22 13:30 ` Maciej W. Rozycki
0 siblings, 1 reply; 6+ messages in thread
From: Kumba @ 2005-06-22 12:55 UTC (permalink / raw)
To: linux-mips
Maciej W. Rozycki wrote:
>
> Any specifics please? It works for me -- I wouldn't have committed it
> otherwise. In particular in the affected range there are no operations
> that would require a 64-bit ISA.
>
> Maciej
I've tested to see it break IP30, and Thiemo reported IP27 was also not booting
(no text display after kernel entry). Reversing this patch seems to allow both
systems to boot. Is it possible it breaks ELF64-only builds? I haven't tested
it on IP28 yet, so I can't confirm this (it's also ELF64).
--Kumba
--
Gentoo/MIPS Team Lead
Gentoo Foundation Board of Trustees
"Such is oft the course of deeds that move the wheels of the world: small hands
do them because they must, while the eyes of the great are elsewhere." --Elrond
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: .set mips2 breaks 64bit kernel (Re: CVS Update@linux-mips.org: linux)
2005-06-22 12:55 ` Kumba
@ 2005-06-22 13:30 ` Maciej W. Rozycki
2005-06-22 16:26 ` .set mips2 breaks 64bit kernel Atsushi Nemoto
0 siblings, 1 reply; 6+ messages in thread
From: Maciej W. Rozycki @ 2005-06-22 13:30 UTC (permalink / raw)
To: Kumba; +Cc: linux-mips
On Wed, 22 Jun 2005, Kumba wrote:
> I've tested to see it break IP30, and Thiemo reported IP27 was also not
> booting (no text display after kernel entry). Reversing this patch seems to
> allow both systems to boot. Is it possible it breaks ELF64-only builds? I
> haven't tested it on IP28 yet, so I can't confirm this (it's also ELF64).
Well, could I please ask people to be more specific when writing such
reports? Unfortunately "break" can mean anything and my crystal ball is
currently away for a service. At least you've mentioned problems at a
bootstrap, so I infer it's not a build-time failure.
That said, I'm only using ELF64 for my 64-bit builds, so that shouldn't
be the cause. But I think there is one possiblity of a problem --
obsolete versions of GCC may rely on gas expanding "ll" and "sc" as
macros, i.e. substitute a name of a symbol rather than a valid
machine-level address expression (e.g. "0($reg)" or "%lo(sym)($reg)") for
memory constraints. Well, by using "m" right now we sort of permit it to.
But shouldn't gas actually complain if the ISA or CPU selection forbids
it doing the right address calculation for the ABI in use? I think it
should, so I consider it a bug in gas. Of course, blaming gas doesn't
magically make our code right, but the deficiency makes noticing such
problems tougher.
As we still strive to support old versions of GCC, I guess a reasonable
solution is taking an approach similar to that I already have in
include/asm-mips/bitops.h, i.e. defining __SET_MIPS appropriately and
using it instead of hardcoded ".set mips2". I'll prepare a fix shortly.
Maciej
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: .set mips2 breaks 64bit kernel
2005-06-22 13:30 ` Maciej W. Rozycki
@ 2005-06-22 16:26 ` Atsushi Nemoto
2005-06-23 17:37 ` Maciej W. Rozycki
0 siblings, 1 reply; 6+ messages in thread
From: Atsushi Nemoto @ 2005-06-22 16:26 UTC (permalink / raw)
To: macro; +Cc: kumba, linux-mips
>>>>> On Wed, 22 Jun 2005 14:30:41 +0100 (BST), "Maciej W. Rozycki" <macro@linux-mips.org> said:
macro> But I think there is one possiblity of a problem -- obsolete
macro> versions of GCC may rely on gas expanding "ll" and "sc" as
macro> macros, i.e. substitute a name of a symbol rather than a valid
macro> machine-level address expression (e.g. "0($reg)" or
macro> "%lo(sym)($reg)") for memory constraints. Well, by using "m"
macro> right now we sort of permit it to.
Yes, this is my case.
A line in net/key/af_key.c:pfkey_create()
atomic_inc(&pfkey_socks_nr);
was translated to:
.set mips2
1: ll $3, pfkey_socks_nr # atomic_add
addu $3, 1
sc $3, pfkey_socks_nr
beqz $3, 1b
.set mips0
Then gas expands the 'll' to LUI and LL (no high 32bit).
I'm using gcc 3.4.4 and binutils 2.16.1. Not so brand new but not so
obsolete (I hope :-))
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: .set mips2 breaks 64bit kernel
2005-06-22 16:26 ` .set mips2 breaks 64bit kernel Atsushi Nemoto
@ 2005-06-23 17:37 ` Maciej W. Rozycki
0 siblings, 0 replies; 6+ messages in thread
From: Maciej W. Rozycki @ 2005-06-23 17:37 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: kumba, linux-mips
On Thu, 23 Jun 2005, Atsushi Nemoto wrote:
> Then gas expands the 'll' to LUI and LL (no high 32bit).
I've fixed it by using ".set mips3" universally -- alternating between it
and ".set mips2" would be too ugly and the only difference between these
ISAs are 64-bit operations, so for code that does not use them explicitly
these settings should be equivalent.
> I'm using gcc 3.4.4 and binutils 2.16.1. Not so brand new but not so
> obsolete (I hope :-))
Well, GCC 3.4.4 is a bit old-fashioned, but it's not the worst one and
certainly we are going to support it for a while yet. ;-) Binutils 2.16.1
should be OK -- I don't think there's been any problems discovered with
them yet that would urge an update.
Maciej
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-06-23 17:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20050614173512Z8225617-1340+8840@linux-mips.org>
2005-06-22 7:31 ` .set mips2 breaks 64bit kernel (Re: CVS Update@linux-mips.org: linux) Atsushi Nemoto
2005-06-22 12:33 ` Maciej W. Rozycki
2005-06-22 12:55 ` Kumba
2005-06-22 13:30 ` Maciej W. Rozycki
2005-06-22 16:26 ` .set mips2 breaks 64bit kernel Atsushi Nemoto
2005-06-23 17:37 ` Maciej W. Rozycki
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.