From: Linus Torvalds <torvalds@transmeta.com>
To: kai@tp1.ruhr-uni-bochum.de, linux-kernel@vger.kernel.org,
Julian Anastasov <ja@ssi.bg>
Subject: Re: cpuid_eax damages registers (2.4.7pre7)
Date: Wed, 18 Jul 2001 15:04:20 -0700 [thread overview]
Message-ID: <200107182204.f6IM4K001282@penguin.transmeta.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0107182239050.1298-100000@vaio>
In-Reply-To: <Pine.LNX.4.33.0107181014590.883-100000@penguin.transmeta.com>
In article <Pine.LNX.4.33.0107182239050.1298-100000@vaio> you write:
>
>Generated code looks okay now (using kgcc aka egcs-2.91.66):
>
> 2002: 31 c0 xor %eax,%eax
> 2004: 0f a2 cpuid
> 2006: 89 46 08 mov %eax,0x8(%esi)
> 2009: 5b pop %ebx
> 200a: 5e pop %esi
> 200b: c3 ret
>
>Patch follows:
Can you verify with this alternate patch instead? Yours works ok on
older gcc's, but the gcc team feels that clobbers must never cover
inputs or outputs, so your patch really generates invalid asms. Here's
a alternate, can you verify that it works for you guys, and perhaps
people can at the same time eye-ball it for any other issues they can
think of?
Linus
----
--- pre7/linux/include/asm-i386/processor.h Wed Jul 18 09:34:03 2001
+++ linux/include/asm-i386/processor.h Wed Jul 18 14:58:45 2001
@@ -126,7 +126,7 @@
"=b" (*ebx),
"=c" (*ecx),
"=d" (*edx)
- : "a" (op));
+ : "0" (op));
}
/*
@@ -134,38 +134,42 @@
*/
extern inline unsigned int cpuid_eax(unsigned int op)
{
- unsigned int eax, ebx, ecx, edx;
+ unsigned int eax;
__asm__("cpuid"
- : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
- : "a" (op));
+ : "=a" (eax)
+ : "0" (op)
+ : "bx", "cx", "dx");
return eax;
}
extern inline unsigned int cpuid_ebx(unsigned int op)
{
- unsigned int eax, ebx, ecx, edx;
+ unsigned int eax, ebx;
__asm__("cpuid"
- : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
- : "a" (op));
+ : "=a" (eax), "=b" (ebx)
+ : "0" (op)
+ : "cx", "dx" );
return ebx;
}
extern inline unsigned int cpuid_ecx(unsigned int op)
{
- unsigned int eax, ebx, ecx, edx;
+ unsigned int eax, ecx;
__asm__("cpuid"
- : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
- : "a" (op));
+ : "=a" (eax), "=c" (ecx)
+ : "0" (op)
+ : "bx", "dx" );
return ecx;
}
extern inline unsigned int cpuid_edx(unsigned int op)
{
- unsigned int eax, ebx, ecx, edx;
+ unsigned int eax, edx;
__asm__("cpuid"
- : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
- : "a" (op));
+ : "=a" (eax), "=d" (edx)
+ : "0" (op)
+ : "bx", "cx");
return edx;
}
next prev parent reply other threads:[~2001-07-18 22:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-18 10:48 Julian Anastasov
2001-07-18 15:10 ` Linus Torvalds
2001-07-18 17:08 ` Julian Anastasov
2001-07-18 17:21 ` Linus Torvalds
2001-07-18 20:43 ` Kai Germaschewski
2001-07-18 22:04 ` Linus Torvalds [this message]
2001-07-18 22:25 ` Kai Germaschewski
2001-07-19 8:23 ` Julian Anastasov
2001-07-19 18:36 ` H. Peter Anvin
2001-07-20 1:42 ` Julian Anastasov
2001-07-19 22:51 ` H. Peter Anvin
2001-07-20 2:01 ` Julian Anastasov
2001-07-19 23:02 ` H. Peter Anvin
2001-07-19 22:55 ` Linus Torvalds
2001-07-20 2:19 ` Julian Anastasov
2001-07-19 23:23 ` H. Peter Anvin
2001-07-19 23:24 ` Linus Torvalds
2001-07-22 0:00 ` Richard Henderson
2001-07-22 4:27 ` H. Peter Anvin
2001-07-21 23:45 ` Richard Henderson
2001-07-18 20:30 Rick Hohensee
2001-07-19 5:15 ` Keith Owens
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=200107182204.f6IM4K001282@penguin.transmeta.com \
--to=torvalds@transmeta.com \
--cc=ja@ssi.bg \
--cc=kai@tp1.ruhr-uni-bochum.de \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®