* [2.6.30-rc8 KVM] gcc 3.3 dies at emulate_2op_cl().
@ 2009-06-05 5:39 Tetsuo Handa
2009-06-07 6:24 ` Avi Kivity
0 siblings, 1 reply; 10+ messages in thread
From: Tetsuo Handa @ 2009-06-05 5:39 UTC (permalink / raw)
To: guillaume.thouvenin, avi; +Cc: linux-kernel
(Continued from http://lkml.org/lkml/2009/6/4/14 )
I tried to identify the location of gcc 3.3's internal error using
"make CONFIG_DEBUG_INFO=1 arch/x86/kvm/x86_emulate.s", and it turned out that
the location is emulate_2op_cl().
Commenting out like below solves the gcc's internal error.
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index ca91749..561b9b6 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -2070,7 +2070,7 @@ twobyte_insn:
break;
case 0xa4: /* shld imm8, r, r/m */
case 0xa5: /* shld cl, r, r/m */
- emulate_2op_cl("shld", c->src2, c->src, c->dst, ctxt->eflags);
+ //emulate_2op_cl("shld", c->src2, c->src, c->dst, ctxt->eflags);
break;
case 0xab:
bts: /* bts */
@@ -2080,7 +2080,7 @@ twobyte_insn:
break;
case 0xac: /* shrd imm8, r, r/m */
case 0xad: /* shrd cl, r, r/m */
- emulate_2op_cl("shrd", c->src2, c->src, c->dst, ctxt->eflags);
+ //emulate_2op_cl("shrd", c->src2, c->src, c->dst, ctxt->eflags);
break;
case 0xae: /* clflush */
break;
I think something is wrong with emulate_2op_cl() when compiled with gcc 3.3.5 .
Regards.
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [2.6.30-rc8 KVM] gcc 3.3 dies at emulate_2op_cl().
2009-06-05 5:39 [2.6.30-rc8 KVM] gcc 3.3 dies at emulate_2op_cl() Tetsuo Handa
@ 2009-06-07 6:24 ` Avi Kivity
2009-06-07 7:38 ` Tetsuo Handa
0 siblings, 1 reply; 10+ messages in thread
From: Avi Kivity @ 2009-06-07 6:24 UTC (permalink / raw)
To: Tetsuo Handa; +Cc: guillaume.thouvenin, linux-kernel
Tetsuo Handa wrote:
> (Continued from http://lkml.org/lkml/2009/6/4/14 )
> I tried to identify the location of gcc 3.3's internal error using
> "make CONFIG_DEBUG_INFO=1 arch/x86/kvm/x86_emulate.s", and it turned out that
> the location is emulate_2op_cl().
>
> Commenting out like below solves the gcc's internal error.
>
> diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
> index ca91749..561b9b6 100644
> --- a/arch/x86/kvm/x86_emulate.c
> +++ b/arch/x86/kvm/x86_emulate.c
> @@ -2070,7 +2070,7 @@ twobyte_insn:
> break;
> case 0xa4: /* shld imm8, r, r/m */
> case 0xa5: /* shld cl, r, r/m */
> - emulate_2op_cl("shld", c->src2, c->src, c->dst, ctxt->eflags);
> + //emulate_2op_cl("shld", c->src2, c->src, c->dst, ctxt->eflags);
> break;
> case 0xab:
> bts: /* bts */
> @@ -2080,7 +2080,7 @@ twobyte_insn:
> break;
> case 0xac: /* shrd imm8, r, r/m */
> case 0xad: /* shrd cl, r, r/m */
> - emulate_2op_cl("shrd", c->src2, c->src, c->dst, ctxt->eflags);
> + //emulate_2op_cl("shrd", c->src2, c->src, c->dst, ctxt->eflags);
> break;
> case 0xae: /* clflush */
> break;
>
> I think something is wrong with emulate_2op_cl() when compiled with gcc 3.3.5 .
>
>
This is on i386, not x86_64, yes?
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.30-rc8 KVM] gcc 3.3 dies at emulate_2op_cl().
2009-06-07 6:24 ` Avi Kivity
@ 2009-06-07 7:38 ` Tetsuo Handa
2009-06-07 8:29 ` Avi Kivity
0 siblings, 1 reply; 10+ messages in thread
From: Tetsuo Handa @ 2009-06-07 7:38 UTC (permalink / raw)
To: avi; +Cc: guillaume.thouvenin, linux-kernel
Avi Kivity wrote:
> > I think something is wrong with emulate_2op_cl() when compiled with gcc 3.3.5 .
>
> This is on i386, not x86_64, yes?
>
Yes. Building "make allmodconfig" using Debian Sarge on i686 machine.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.30-rc8 KVM] gcc 3.3 dies at emulate_2op_cl().
2009-06-07 7:38 ` Tetsuo Handa
@ 2009-06-07 8:29 ` Avi Kivity
2009-06-07 8:47 ` Tetsuo Handa
0 siblings, 1 reply; 10+ messages in thread
From: Avi Kivity @ 2009-06-07 8:29 UTC (permalink / raw)
To: Tetsuo Handa; +Cc: guillaume.thouvenin, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 385 bytes --]
Tetsuo Handa wrote:
> Avi Kivity wrote:
>
>>> I think something is wrong with emulate_2op_cl() when compiled with gcc 3.3.5 .
>>>
>> This is on i386, not x86_64, yes?
>>
>>
> Yes. Building "make allmodconfig" using Debian Sarge on i686 machine.
>
Does the attached patch help?
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
[-- Attachment #2: fix-gcc3.3-register-pressure.patch --]
[-- Type: text/plain, Size: 509 bytes --]
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index 22c765d..01717a5 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -451,7 +451,7 @@ static u32 group2_table[] = {
_PRE_EFLAGS("0", "5", "2") \
_op _suffix " %4,%1 \n" \
_POST_EFLAGS("0", "5", "2") \
- : "=m" (_eflags), "+r" (_dstv), "=&r" (_tmp) \
+ : "=m" (_eflags), "+rm" (_dstv), "=&r" (_tmp) \
: "c" (_clv) , "r" (_srcv), "i" (EFLAGS_MASK) \
); \
\
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [2.6.30-rc8 KVM] gcc 3.3 dies at emulate_2op_cl().
2009-06-07 8:29 ` Avi Kivity
@ 2009-06-07 8:47 ` Tetsuo Handa
2009-06-07 9:01 ` Avi Kivity
0 siblings, 1 reply; 10+ messages in thread
From: Tetsuo Handa @ 2009-06-07 8:47 UTC (permalink / raw)
To: avi; +Cc: guillaume.thouvenin, linux-kernel
Avi Kivity wrote:
> Does the attached patch help?
Unfortunately, no.
# gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-13)
# make arch/x86/kvm/x86_emulate.o
/usr/src/linux-2.6.30-rc8/arch/x86/Makefile:82: stack protector enabled but no compiler support
CHK include/linux/version.h
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-x86
CALL scripts/checksyscalls.sh
CC [M] arch/x86/kvm/x86_emulate.o
gcc: Internal error: Segmentation fault (program cc1)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-3.3/README.Bugs>.
{standard input}: Assembler messages:
{standard input}:4331: Warning: end of file not at end of a line; newline inserted
make[1]: *** [arch/x86/kvm/x86_emulate.o] Error 1
make: *** [arch/x86/kvm/x86_emulate.o] Error 2
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.30-rc8 KVM] gcc 3.3 dies at emulate_2op_cl().
2009-06-07 8:47 ` Tetsuo Handa
@ 2009-06-07 9:01 ` Avi Kivity
2009-06-07 9:39 ` Tetsuo Handa
0 siblings, 1 reply; 10+ messages in thread
From: Avi Kivity @ 2009-06-07 9:01 UTC (permalink / raw)
To: Tetsuo Handa; +Cc: guillaume.thouvenin, linux-kernel
Tetsuo Handa wrote:
> Avi Kivity wrote:
>
>> Does the attached patch help?
>>
> Unfortunately, no.
>
>
What if you change "rm" in the patch to "m"?
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.30-rc8 KVM] gcc 3.3 dies at emulate_2op_cl().
2009-06-07 9:01 ` Avi Kivity
@ 2009-06-07 9:39 ` Tetsuo Handa
2009-06-07 9:40 ` Avi Kivity
0 siblings, 1 reply; 10+ messages in thread
From: Tetsuo Handa @ 2009-06-07 9:39 UTC (permalink / raw)
To: avi; +Cc: guillaume.thouvenin, linux-kernel
Avi Kivity wrote:
> What if you change "rm" in the patch to "m"?
It still fails.
__asm__ __volatile__ ( \
_PRE_EFLAGS("0", "5", "2") \
_op _suffix " %4,%1 \n" \
_POST_EFLAGS("0", "5", "2") \
: "=m" (_eflags), "+m" (_dstv), "=&r" (_tmp) \
: "c" (_clv) , "r" (_srcv), "i" (EFLAGS_MASK) \
);
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.30-rc8 KVM] gcc 3.3 dies at emulate_2op_cl().
2009-06-07 9:39 ` Tetsuo Handa
@ 2009-06-07 9:40 ` Avi Kivity
2009-06-07 10:00 ` Tetsuo Handa
0 siblings, 1 reply; 10+ messages in thread
From: Avi Kivity @ 2009-06-07 9:40 UTC (permalink / raw)
To: Tetsuo Handa; +Cc: guillaume.thouvenin, linux-kernel
Tetsuo Handa wrote:
> Avi Kivity wrote:
>
>> What if you change "rm" in the patch to "m"?
>>
> It still fails.
>
> __asm__ __volatile__ ( \
> _PRE_EFLAGS("0", "5", "2") \
> _op _suffix " %4,%1 \n" \
> _POST_EFLAGS("0", "5", "2") \
> : "=m" (_eflags), "+m" (_dstv), "=&r" (_tmp) \
> : "c" (_clv) , "r" (_srcv), "i" (EFLAGS_MASK) \
> );
>
I can eliminate _tmp by using lahf/sahf, but it's not going to be a
trivial patch.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.30-rc8 KVM] gcc 3.3 dies at emulate_2op_cl().
2009-06-07 9:40 ` Avi Kivity
@ 2009-06-07 10:00 ` Tetsuo Handa
2009-06-07 10:03 ` Avi Kivity
0 siblings, 1 reply; 10+ messages in thread
From: Tetsuo Handa @ 2009-06-07 10:00 UTC (permalink / raw)
To: avi; +Cc: guillaume.thouvenin, linux-kernel
Avi Kivity wrote:
> I can eliminate _tmp by using lahf/sahf, but it's not going to be a
> trivial patch.
I don't know what's happening here.
If I comment out (_dst).bytes == 2 , it compiles.
The problem happens only "w" + "unsigned short" case.
# diff -urp arch/x86/kvm/x86_emulate.c~ arch/x86/kvm/x86_emulate.c
--- arch/x86/kvm/x86_emulate.c~ 2009-06-03 12:07:25.000000000 +0900
+++ arch/x86/kvm/x86_emulate.c 2009-06-07 17:52:05.591542272 +0900
@@ -461,8 +461,8 @@ static u32 group2_table[] = {
do { \
switch ((_dst).bytes) { \
case 2: \
- __emulate_2op_cl(_op, _cl, _src, _dst, _eflags, \
- "w", unsigned short); \
+ /* __emulate_2op_cl(_op, _cl, _src, _dst, _eflags, \
+ "w", unsigned short); */ \
break; \
case 4: \
__emulate_2op_cl(_op, _cl, _src, _dst, _eflags, \
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.30-rc8 KVM] gcc 3.3 dies at emulate_2op_cl().
2009-06-07 10:00 ` Tetsuo Handa
@ 2009-06-07 10:03 ` Avi Kivity
0 siblings, 0 replies; 10+ messages in thread
From: Avi Kivity @ 2009-06-07 10:03 UTC (permalink / raw)
To: Tetsuo Handa; +Cc: guillaume.thouvenin, linux-kernel
Tetsuo Handa wrote:
> Avi Kivity wrote:
>
>> I can eliminate _tmp by using lahf/sahf, but it's not going to be a
>> trivial patch.
>>
>
> I don't know what's happening here.
>
> If I comment out (_dst).bytes == 2 , it compiles.
> The problem happens only "w" + "unsigned short" case.
>
> # diff -urp arch/x86/kvm/x86_emulate.c~ arch/x86/kvm/x86_emulate.c
> --- arch/x86/kvm/x86_emulate.c~ 2009-06-03 12:07:25.000000000 +0900
> +++ arch/x86/kvm/x86_emulate.c 2009-06-07 17:52:05.591542272 +0900
> @@ -461,8 +461,8 @@ static u32 group2_table[] = {
> do { \
> switch ((_dst).bytes) { \
> case 2: \
> - __emulate_2op_cl(_op, _cl, _src, _dst, _eflags, \
> - "w", unsigned short); \
> + /* __emulate_2op_cl(_op, _cl, _src, _dst, _eflags, \
> + "w", unsigned short); */ \
> break; \
> case 4: \
> __emulate_2op_cl(_op, _cl, _src, _dst, _eflags, \
>
It's a gcc register allocator bug. Bugs don't have to be reasonable.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-06-07 10:04 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-05 5:39 [2.6.30-rc8 KVM] gcc 3.3 dies at emulate_2op_cl() Tetsuo Handa
2009-06-07 6:24 ` Avi Kivity
2009-06-07 7:38 ` Tetsuo Handa
2009-06-07 8:29 ` Avi Kivity
2009-06-07 8:47 ` Tetsuo Handa
2009-06-07 9:01 ` Avi Kivity
2009-06-07 9:39 ` Tetsuo Handa
2009-06-07 9:40 ` Avi Kivity
2009-06-07 10:00 ` Tetsuo Handa
2009-06-07 10:03 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox