qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume (was: Re: Ho ho ho - Linux v2.6.10)
       [not found]     ` <200501150042.35377.rjw@sisk.pl>
@ 2005-01-15  1:21       ` hugang
  2005-01-15 11:48         ` [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume Fabrice Bellard
       [not found]         ` <200501151147.32919.rjw@sisk.pl>
  0 siblings, 2 replies; 11+ messages in thread
From: hugang @ 2005-01-15  1:21 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: qemu-devel

On Sat, Jan 15, 2005 at 12:42:35AM +0100, Rafael J. Wysocki wrote:
> On Friday, 14 of January 2005 15:34, you wrote:
> > On Thu, Jan 13, 2005 at 07:09:24PM +0100, Rafael J. Wysocki wrote:
> > > Hi,
> > > 
> > > 
> > > Has this patch been ported to x86_64?  Or is there a newer version of it anywhere,
> > > or an alternative?
> > > 
> > 
> > Ok, Here is a new patch with x86_64 support, But I have not machine, So
> > Need someone test it. 
> > 
> > 2.6.11-rc1-mm1 
> >  -> 2005-1-14.core.diff 	core patch		TEST PASSED
> >   -> 2005-1-14.x86_64.diff	x86_64 patch	NOT TESTED
> 
> Unfortunately, on x86_64 it goes south on suspend, probably somwhere in write_pagedir(),
> but I'm not quite sure as I can't make it print any useful stuff to the serial console
> (everything is dumped to a virtual tty only).  Seemingly, it prints some
> "write_pagedir: ..." debug messages and then starts to print garbage in
> an infinite loop.

Try enable debug in swsusp, 
<....>
#include "power.h"
#undef pr_debug
#define pr_debug printk
<....>

 Enable serial conosole, 
 Adding console=ttyS0 in boot command line.

Then do software suspend, And send the log to me, that will useful. 

For other reference, I using qemu As X86-64 emulation, But current qemu
X86-64 not full works, the kernel hang after copy_page in suspend, I'll
enable CPU and ASM log in qemu to finger other where is the problem.

-- 
Hu Gang       .-.
              /v\
             // \\ 
Linux User  /(   )\  [204016]
GPG Key ID   ^^-^^   http://soulinfo.com/~hugang/hugang.asc

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume
  2005-01-15  1:21       ` [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume (was: Re: Ho ho ho - Linux v2.6.10) hugang
@ 2005-01-15 11:48         ` Fabrice Bellard
  2005-01-15 16:40           ` hugang
                             ` (2 more replies)
       [not found]         ` <200501151147.32919.rjw@sisk.pl>
  1 sibling, 3 replies; 11+ messages in thread
From: Fabrice Bellard @ 2005-01-15 11:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: Rafael J. Wysocki

hugang@soulinfo.com wrote:
> On Sat, Jan 15, 2005 at 12:42:35AM +0100, Rafael J. Wysocki wrote:
> 
>>On Friday, 14 of January 2005 15:34, you wrote:
>>
>>>On Thu, Jan 13, 2005 at 07:09:24PM +0100, Rafael J. Wysocki wrote:
>>>
>>>>Hi,
>>>>
>>>>
>>>>Has this patch been ported to x86_64?  Or is there a newer version of it anywhere,
>>>>or an alternative?
>>>>
>>>
>>>Ok, Here is a new patch with x86_64 support, But I have not machine, So
>>>Need someone test it. 
>>>
>>>2.6.11-rc1-mm1 
>>> -> 2005-1-14.core.diff 	core patch		TEST PASSED
>>>  -> 2005-1-14.x86_64.diff	x86_64 patch	NOT TESTED
>>
>>Unfortunately, on x86_64 it goes south on suspend, probably somwhere in write_pagedir(),
>>but I'm not quite sure as I can't make it print any useful stuff to the serial console
>>(everything is dumped to a virtual tty only).  Seemingly, it prints some
>>"write_pagedir: ..." debug messages and then starts to print garbage in
>>an infinite loop.
> 
> 
> Try enable debug in swsusp, 
> <....>
> #include "power.h"
> #undef pr_debug
> #define pr_debug printk
> <....>
> 
>  Enable serial conosole, 
>  Adding console=ttyS0 in boot command line.
> 
> Then do software suspend, And send the log to me, that will useful. 
> 
> For other reference, I using qemu As X86-64 emulation, But current qemu
> X86-64 not full works, the kernel hang after copy_page in suspend, I'll
> enable CPU and ASM log in qemu to finger other where is the problem.

I recently made a fix in fxsave/fxrestor which may correct some issues 
on x86_64. Strangely, the CVS commit mail did not appear on the mailing 
list...

The state of x86_64 is that the install of Fedora core 3 for x86_64 
begins to work (you can select the language for example), but there are 
some invalid characters displayed on screen. I believe there is a sign 
extension problem in a 64 bit instruction.

Now that SSE and MMX are implemented, no feature is lacking in the QEMU 
x86_64 emulation... "just" a problem of debugging now :-)

I did not enable SSE and MMX for x86 because I fear there are still bugs 
which may cause regressions. Interested people can enable the line:

--
      env->cpuid_features |= CPUID_FXSR | CPUID_MMX | CPUID_SSE | 
CPUID_SSE2 | CPUID_PAE;
--

and see if their OS and application still work.

Fabrice.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume
  2005-01-15 11:48         ` [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume Fabrice Bellard
@ 2005-01-15 16:40           ` hugang
  2005-01-16  4:38             ` hugang
  2005-01-15 18:02           ` [Qemu-devel] W2K SP0 Status (was: Re: 2.6.10-mm3: swsusp: out of memory on resume) Tim
  2005-01-17 18:02           ` [Qemu-devel] Re: Re: 2.6.10-mm3: swsusp: out of memory on resume Ronald
  2 siblings, 1 reply; 11+ messages in thread
From: hugang @ 2005-01-15 16:40 UTC (permalink / raw)
  To: qemu-devel, fabrice; +Cc: Rafael J. Wysocki

On Sat, Jan 15, 2005 at 12:48:54PM +0100, Fabrice Bellard wrote:
.....
> I recently made a fix in fxsave/fxrestor which may correct some issues 
> on x86_64. Strangely, the CVS commit mail did not appear on the mailing 
> list...
> 
> The state of x86_64 is that the install of Fedora core 3 for x86_64 
> begins to work (you can select the language for example), but there are 
> some invalid characters displayed on screen. I believe there is a sign 
> extension problem in a 64 bit instruction.
> 
> Now that SSE and MMX are implemented, no feature is lacking in the QEMU 
> x86_64 emulation... "just" a problem of debugging now :-)

When I using Qemu as X86_64 emulataion for testing software suspend, I
get the first oops the instruction is this, 
IN:
0xffffffff80116a8a:  movzwl 0x8(%rbx),%eax
0xffffffff80116a8e:  mov    %eax,%ss	<- general protection 

That's in 
arch/x86_64/kernel/suspend.c +105
 asm volatile ("movw %0, %%ss" :: "r" (ctxt->ss)); <-- general protection.

I don't why, but I check %eax and %ss are same value, so I just comment 
this line, the oops go away, But still geting hang, Now I have no idea,
:)


I put the all logs in this 
 http://soulinfo.com/~hugang/swsusp/x86_64_log/

thanks.

-- 
Hu Gang       .-.
              /v\
             // \\ 
Linux User  /(   )\  [204016]
GPG Key ID   ^^-^^   http://soulinfo.com/~hugang/hugang.asc

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] W2K SP0 Status (was: Re: 2.6.10-mm3: swsusp: out of memory on resume)
  2005-01-15 11:48         ` [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume Fabrice Bellard
  2005-01-15 16:40           ` hugang
@ 2005-01-15 18:02           ` Tim
  2005-01-17 18:02           ` [Qemu-devel] Re: Re: 2.6.10-mm3: swsusp: out of memory on resume Ronald
  2 siblings, 0 replies; 11+ messages in thread
From: Tim @ 2005-01-15 18:02 UTC (permalink / raw)
  To: qemu-devel

> I did not enable SSE and MMX for x86 because I fear there are still bugs 
> which may cause regressions. Interested people can enable the line:
> 
> --
>      env->cpuid_features |= CPUID_FXSR | CPUID_MMX | CPUID_SSE | 
> CPUID_SSE2 | CPUID_PAE;
> --
> 
> and see if their OS and application still work.

I am using exclusively x86 on x86 (target=i386-softmmu).

I just booted one of my older win2k images without this enabled.
Everything came up fine, and I am still stuck with the SP4 installer
(spews the same "an error has occured" that I have reported in the
past.)  No change here.

Then I added the two lines you mention in target-i386/helper2.c, and
recompiled.  Upon booting this old image again, everything worked as
expected.  I tried installing SP4 and I got the same old error.  So,
this initial test showed no difference with MMX et al. enabled.  (I was
hoping that MMX capabilities would fix their SP4 installer, but no
luck there.) 

Next, I kept MMX stuff enabled, and began installing win2k with an image
of the install CD.  The disk is partitioned and formatted fine.  After
the first reboot, and round of hardware detection, I get the dreaded
"not enough space on disk" error.  It gives me the software selection
screen, and it indicates there is 0 space left on disk.  I don't
remember how I got around this last time.  I'll keep trying.  (fyi- I
created this image with 'qemu-img win2k.img 3G'.)

In short, I don't see any differences so far, besides the disk issue
that comes and goes for those installing Win2k.

tim

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume
  2005-01-15 16:40           ` hugang
@ 2005-01-16  4:38             ` hugang
  0 siblings, 0 replies; 11+ messages in thread
From: hugang @ 2005-01-16  4:38 UTC (permalink / raw)
  To: qemu-devel, fabrice

On Sun, Jan 16, 2005 at 12:40:56AM +0800, hugang@soulinfo.com wrote:
> On Sat, Jan 15, 2005 at 12:48:54PM +0100, Fabrice Bellard wrote:
...
> 
> When I using Qemu as X86_64 emulataion for testing software suspend, I
> get the first oops the instruction is this, 
> IN:
> 0xffffffff80116a8a:  movzwl 0x8(%rbx),%eax
> 0xffffffff80116a8e:  mov    %eax,%ss	<- general protection 
> 
> That's in 
> arch/x86_64/kernel/suspend.c +105
>  asm volatile ("movw %0, %%ss" :: "r" (ctxt->ss)); <-- general protection.
> 
> I don't why, but I check %eax and %ss are same value, so I just comment 
> this line, the oops go away, But still geting hang, Now I have no idea,
> :)
> 
> 

Ok, I enable the raise_exception_err, and catach this.
.....
/* only works if protected mode and not VM86. seg_reg must be != R_CS */
void load_seg(int seg_reg, int selector)
{
    uint32_t e1, e2;
    int cpl, dpl, rpl;
    SegmentCache *dt;
    int index;
    target_ulong ptr;

    selector &= 0xffff;
    if ((selector & 0xfffc) == 0) {
        /* null selector case */
        if (seg_reg == R_SS)
            raise_exception_err(EXCP0D_GPF, 0);
        cpu_x86_load_seg_cache(env, seg_reg, selector, 0, 0, 0);
    } else {
	....

In the comment line, said must be != R_CS, But in code is check R_SS, I
just change R_SS to R_CS, then the software-suspend suspend part passed 
in qemu, I geting hang at copyback memory in resume, Still debuging...

:)

Maybe that, also useful for other, Eg. Win2k disk full...

-- 
Hu Gang       .-.
              /v\
             // \\ 
Linux User  /(   )\  [204016]
GPG Key ID   ^^-^^   http://soulinfo.com/~hugang/hugang.asc

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume (was: Re: Ho ho ho - Linux v2.6.10)
       [not found]           ` <200501152220.42129.rjw@sisk.pl>
@ 2005-01-16  5:54             ` hugang
  2005-01-16 10:07               ` Rafael J. Wysocki
  0 siblings, 1 reply; 11+ messages in thread
From: hugang @ 2005-01-16  5:54 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-kernel, qemu-devel

On Sat, Jan 15, 2005 at 10:20:42PM +0100, Rafael J. Wysocki wrote:
> > > > > 
> > > > > 2.6.11-rc1-mm1 
> > > > >  -> 2005-1-14.core.diff 	core patch		TEST PASSED
> > > > >   -> 2005-1-14.x86_64.diff	x86_64 patch	NOT TESTED
> > > > 
> > > > Unfortunately, on x86_64 it goes south on suspend, probably somwhere in write_pagedir(),
> > > > but I'm not quite sure as I can't make it print any useful stuff to the serial console
> > > > (everything is dumped to a virtual tty only).  Seemingly, it prints some
> > > > "write_pagedir: ..." debug messages and then starts to print garbage in
> > > > an infinite loop.
> 
> I have some good news for you. :-)
> 
> The patch actually works fine on my box.  What I thought was a result of an infinite loop,
> turned out to be "only" a debug output from it, which is _really_ excessive.  After I had
> commented out the most of pr_debug()s in your code, it works nicely and I like it very
> much.  Thanks a lot for porting it to x86_64!
> 
Cool, Current I making software suspend also works in Qemu X86_64
emulation, Here is a update patch to making copyback more safed and 
possible to improve copyback speed.

I change the swsusp_arch_resume to nosave section, the in memory copy
back it not touch this code. before not change that to nosave section,
I'm also geting a infinite loop in copy_one_page, From the qemu in_asm,
I sure that loop in copy_one_page, when I change it to nosave section,
that problem go away, I dont' sure tha't good idea to fixed it, but
current it works in my qemu, Can someone owner x86_64 test it.

I disable Flush TLB after copy page, It speedup the in qemu, But I can't
sure the right thing in real machine, can someone give me point.

-- 
Hu Gang       .-.
              /v\
             // \\ 
Linux User  /(   )\  [204016]
GPG Key ID   ^^-^^   http://soulinfo.com/~hugang/hugang.asc

2005-1-16.x86_64.diff

--- 2.6.11-rc1-mm1/arch/x86_64/kernel/suspend_asm.S	2004-12-30 14:56:35.000000000 +0800
+++ 2.6.11-rc1-mm1-swsusp-x86_64/arch/x86_64/kernel/suspend_asm.S	2005-01-16 13:38:25.000000000 +0800
@@ -35,6 +35,7 @@ ENTRY(swsusp_arch_suspend)
 	call swsusp_save
 	ret
 
+	.section    .data.nosave
 ENTRY(swsusp_arch_resume)
 	/* set up cr3 */	
 	leaq	init_level4_pgt(%rip),%rax
@@ -49,43 +50,47 @@ ENTRY(swsusp_arch_resume)
 	movq	%rcx, %cr3;
 	movq	%rax, %cr4;  # turn PGE back on
 
-	movl	nr_copy_pages(%rip), %eax
-	xorl	%ecx, %ecx
-	movq	$0, %r10
-	testl	%eax, %eax
-	jz	done
-.L105:
-	xorl	%esi, %esi
-	movq	$0, %r11
-	jmp	.L104
-	.p2align 4,,7
+	movq	pagedir_nosave(%rip), %rdi
+	testq	%rdi, %rdi
+	je		done
+
+copyback_page:
+	movq	24(%rdi), %r9
+	xorl	%r8d, %r8d
+
+copy_one_pgdir:
+	movq    8(%rdi), %rsi
+	testq   %rsi, %rsi
+	je  	done
+	movq    (%rdi), %rcx
+	xorl    %edx, %edx
+
 copy_one_page:
-	movq	%r10, %rcx
-.L104:
-	movq	pagedir_nosave(%rip), %rdx
-	movq	%rcx, %rax
-	salq	$5, %rax
-	movq	8(%rdx,%rax), %rcx
-	movq	(%rdx,%rax), %rax
-	movzbl	(%rsi,%rax), %eax
-	movb	%al, (%rsi,%rcx)
-
-	movq	%cr3, %rax;  # flush TLB
-	movq	%rax, %cr3;
-
-	movq	%r11, %rax
-	incq	%rax
-	cmpq	$4095, %rax
-	movq	%rax, %rsi
-	movq	%rax, %r11
-	jbe	copy_one_page
-	movq	%r10, %rax
-	incq	%rax
-	movq	%rax, %rcx
-	movq	%rax, %r10
-	mov	nr_copy_pages(%rip), %eax
-	cmpq	%rax, %rcx
-	jb	.L105
+	movq    (%rcx,%rdx,8), %rax
+	movq    %rax, (%rsi,%rdx,8)
+	movq    8(%rcx,%rdx,8), %rax
+	movq    %rax, 8(%rsi,%rdx,8)
+	movq    16(%rcx,%rdx,8), %rax
+	movq    %rax, 16(%rsi,%rdx,8)
+	movq    24(%rcx,%rdx,8), %rax
+	movq    %rax, 24(%rsi,%rdx,8)
+#if 0 /* XXX speep up in qemu */
+	movq    %cr3, %rax;  # flush TLB
+	movq    %rax, %cr3;
+#endif
+	addq    $4, %rdx
+	cmpq    $511, %rdx
+	jbe 	copy_one_page; # copy one page
+
+	incq    %r8
+	addq    $32, %rdi
+	cmpq    $127, %r8
+	jbe 	copy_one_pgdir; # copy one pgdir
+
+	testq   %r9, %r9
+	movq    %r9, %rdi
+	jne 	copyback_page
+
 done:
 	movl	$24, %eax
 	movl	%eax, %ds

Here is the patch for current qemu, with this it has no problem in
software suspend/resume, everything. :)

--- target-i386/helper.c~cvs	2005-01-16 14:06:22.000000000 -0500
+++ target-i386/helper.c	2005-01-16 14:07:21.000000000 -0500
@@ -1454,7 +1454,7 @@ void load_seg(int seg_reg, int selector)
     selector &= 0xffff;
     if ((selector & 0xfffc) == 0) {
         /* null selector case */
-        if (seg_reg == R_SS)
+        if (seg_reg == R_CS)
             raise_exception_err(EXCP0D_GPF, 0);
         cpu_x86_load_seg_cache(env, seg_reg, selector, 0, 0, 0);
     } else {

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume (was: Re: Ho ho ho - Linux v2.6.10)
  2005-01-16  5:54             ` [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume (was: Re: Ho ho ho - Linux v2.6.10) hugang
@ 2005-01-16 10:07               ` Rafael J. Wysocki
  0 siblings, 0 replies; 11+ messages in thread
From: Rafael J. Wysocki @ 2005-01-16 10:07 UTC (permalink / raw)
  To: hugang; +Cc: linux-kernel, qemu-devel

On Sunday, 16 of January 2005 06:54, hugang@soulinfo.com wrote:
> On Sat, Jan 15, 2005 at 10:20:42PM +0100, Rafael J. Wysocki wrote:
> > > > > > 
> > > > > > 2.6.11-rc1-mm1 
> > > > > >  -> 2005-1-14.core.diff 	core patch		TEST PASSED
> > > > > >   -> 2005-1-14.x86_64.diff	x86_64 patch	NOT TESTED
> > > > > 
> > > > > Unfortunately, on x86_64 it goes south on suspend, probably somwhere in write_pagedir(),
> > > > > but I'm not quite sure as I can't make it print any useful stuff to the serial console
> > > > > (everything is dumped to a virtual tty only).  Seemingly, it prints some
> > > > > "write_pagedir: ..." debug messages and then starts to print garbage in
> > > > > an infinite loop.
> > 
> > I have some good news for you. :-)
> > 
> > The patch actually works fine on my box.  What I thought was a result of an infinite loop,
> > turned out to be "only" a debug output from it, which is _really_ excessive.  After I had
> > commented out the most of pr_debug()s in your code, it works nicely and I like it very
> > much.  Thanks a lot for porting it to x86_64!
> > 
> Cool, Current I making software suspend also works in Qemu X86_64
> emulation, Here is a update patch to making copyback more safed and 
> possible to improve copyback speed.
> 
> I change the swsusp_arch_resume to nosave section, the in memory copy
> back it not touch this code. before not change that to nosave section,
> I'm also geting a infinite loop in copy_one_page, From the qemu in_asm,
> I sure that loop in copy_one_page, when I change it to nosave section,
> that problem go away, I dont' sure tha't good idea to fixed it, but
> current it works in my qemu, Can someone owner x86_64 test it.
> 
> I disable Flush TLB after copy page, It speedup the in qemu, But I can't
> sure the right thing in real machine, can someone give me point.

Could you, please, make a patch against -rc1-mm1 with your previous patch
applied?  It would be much easier to apply. :-)

Greets,
RJW


-- 
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
		-- Lewis Carroll "Alice's Adventures in Wonderland"

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] Re: Re: 2.6.10-mm3: swsusp: out of memory on resume
  2005-01-15 11:48         ` [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume Fabrice Bellard
  2005-01-15 16:40           ` hugang
  2005-01-15 18:02           ` [Qemu-devel] W2K SP0 Status (was: Re: 2.6.10-mm3: swsusp: out of memory on resume) Tim
@ 2005-01-17 18:02           ` Ronald
  2005-01-17 21:54             ` Fabrice Bellard
  2 siblings, 1 reply; 11+ messages in thread
From: Ronald @ 2005-01-17 18:02 UTC (permalink / raw)
  To: qemu-devel

Le Sat, 15 Jan 2005 12:48:54 +0100, Fabrice Bellard a écrit :

 
> Now that SSE and MMX are implemented, no feature is lacking in the QEMU
> x86_64 emulation... "just" a problem of debugging now :-)
> 
> I did not enable SSE and MMX for x86 because I fear there are still bugs
> which may cause regressions. Interested people can enable the line:
> 
> --
>       env->cpuid_features |= CPUID_FXSR | CPUID_MMX | CPUID_SSE |
> CPUID_SSE2 | CPUID_PAE;

What about doing this with qemu options?

Perhaps I'am wrong, but something like that:

--- vl.c.old    2005-01-15 23:49:25.124123925 +0100
+++ vl.c        2005-01-17 17:19:18.528256753 +0100
@@ -134,6 +134,8 @@
 int graphic_height = 600;
 int graphic_depth = 15;
 int full_screen = 0;
+int use_mmx = 0;
+int use_sse = 0;
 TextConsole *vga_console;
 CharDriverState *serial_hds[MAX_SERIAL_PORTS];
 CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
@@ -2848,6 +2850,8 @@
     QEMU_OPTION_loadvm,
     QEMU_OPTION_full_screen,
     QEMU_OPTION_pidfile,
+       QEMU_OPTION_use_mmx,
+       QEMU_OPTION_use_sse,
 };

 typedef struct QEMUOption {
@@ -2911,7 +2915,10 @@
     { "loadvm", HAS_ARG, QEMU_OPTION_loadvm },
     { "full-screen", 0, QEMU_OPTION_full_screen },
     { "pidfile", HAS_ARG, QEMU_OPTION_pidfile },
-
+#ifdef TARGET_I386
+    { "mmx", 0, QEMU_OPTION_use_mmx },
+    { "sse", 0, QEMU_OPTION_use_sse },
+#endif
     /* temporary options */
     { "pci", 0, QEMU_OPTION_pci },
     { "cirrusvga", 0, QEMU_OPTION_cirrusvga },
@@ -3358,6 +3365,12 @@
             case QEMU_OPTION_pidfile:
                 create_pidfile(optarg);
                 break;
+                       case QEMU_OPTION_use_mmx:
+                           use_mmx = 1;
+                               break;
+                       case QEMU_OPTION_use_sse:
+                               use_sse = 1;
+                               break;
             }
         }
     }
--- vl.h.old    2005-01-17 17:28:37.491471386 +0100
+++ vl.h        2005-01-17 17:19:13.723332164 +0100
@@ -123,6 +123,8 @@
 extern int graphic_width;
 extern int graphic_height;
 extern int graphic_depth;
+extern int use_mmx;
+extern int use_sse;
 extern const char *keyboard_layout;

 /* XXX: make it dynamic */
--- target-i386/helper2.c.old   2005-01-17 17:37:57.199481651 +0100
+++ target-i386/helper2.c       2005-01-17 17:46:18.834424698 +0100
@@ -25,6 +25,7 @@
 #include <signal.h>
 #include <assert.h>

+#include "vl.h"
 #include "cpu.h"
 #include "exec-all.h"

@@ -106,6 +107,13 @@
         env->cpuid_features = (CPUID_FP87 | CPUID_DE | CPUID_PSE |
                                CPUID_TSC | CPUID_MSR | CPUID_MCE |
                                CPUID_CX8 | CPUID_PGE | CPUID_CMOV);
+#ifdef TARGET_I386
+               if(use_mmx == 1)
+                       env->cpuid_features |= CPUID_MMX;
+               if(use_sse == 1)
+                       env->cpuid_features |= CPUID_FXSR | CPUID_SSE;
+#endif
+
 #ifdef TARGET_X86_64
         /* currently not enabled for std i386 because not fully tested */
         env->cpuid_features |= CPUID_FXSR | CPUID_MMX | CPUID_SSE |
         CPUID_SSE2;

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] Re: Re: 2.6.10-mm3: swsusp: out of memory on resume
  2005-01-17 18:02           ` [Qemu-devel] Re: Re: 2.6.10-mm3: swsusp: out of memory on resume Ronald
@ 2005-01-17 21:54             ` Fabrice Bellard
  2005-01-22  4:17               ` [Qemu-devel] " Anand Kumria
  0 siblings, 1 reply; 11+ messages in thread
From: Fabrice Bellard @ 2005-01-17 21:54 UTC (permalink / raw)
  To: daimon55, qemu-devel

Hi,

My plan is to add a more generic option to select a given cpu model and 
to be able to disable or enable some specific features (for example 
'-cpu p6+pae+sse3', any other suggestions ?), so I prefer not to include 
this patch now.

Fabrice.

Ronald wrote:
> Le Sat, 15 Jan 2005 12:48:54 +0100, Fabrice Bellard a écrit :
> 
>  
> 
>>Now that SSE and MMX are implemented, no feature is lacking in the QEMU
>>x86_64 emulation... "just" a problem of debugging now :-)
>>
>>I did not enable SSE and MMX for x86 because I fear there are still bugs
>>which may cause regressions. Interested people can enable the line:
>>
>>--
>>      env->cpuid_features |= CPUID_FXSR | CPUID_MMX | CPUID_SSE |
>>CPUID_SSE2 | CPUID_PAE;
> 
> 
> What about doing this with qemu options?
> 
> Perhaps I'am wrong, but something like that:
> 
> --- vl.c.old    2005-01-15 23:49:25.124123925 +0100
> +++ vl.c        2005-01-17 17:19:18.528256753 +0100
> @@ -134,6 +134,8 @@
>  int graphic_height = 600;
>  int graphic_depth = 15;
>  int full_screen = 0;
> +int use_mmx = 0;
> +int use_sse = 0;
>  TextConsole *vga_console;
>  CharDriverState *serial_hds[MAX_SERIAL_PORTS];
>  CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
> @@ -2848,6 +2850,8 @@
>      QEMU_OPTION_loadvm,
>      QEMU_OPTION_full_screen,
>      QEMU_OPTION_pidfile,
> +       QEMU_OPTION_use_mmx,
> +       QEMU_OPTION_use_sse,
>  };
> 
>  typedef struct QEMUOption {
> @@ -2911,7 +2915,10 @@
>      { "loadvm", HAS_ARG, QEMU_OPTION_loadvm },
>      { "full-screen", 0, QEMU_OPTION_full_screen },
>      { "pidfile", HAS_ARG, QEMU_OPTION_pidfile },
> -
> +#ifdef TARGET_I386
> +    { "mmx", 0, QEMU_OPTION_use_mmx },
> +    { "sse", 0, QEMU_OPTION_use_sse },
> +#endif
>      /* temporary options */
>      { "pci", 0, QEMU_OPTION_pci },
>      { "cirrusvga", 0, QEMU_OPTION_cirrusvga },
> @@ -3358,6 +3365,12 @@
>              case QEMU_OPTION_pidfile:
>                  create_pidfile(optarg);
>                  break;
> +                       case QEMU_OPTION_use_mmx:
> +                           use_mmx = 1;
> +                               break;
> +                       case QEMU_OPTION_use_sse:
> +                               use_sse = 1;
> +                               break;
>              }
>          }
>      }
> --- vl.h.old    2005-01-17 17:28:37.491471386 +0100
> +++ vl.h        2005-01-17 17:19:13.723332164 +0100
> @@ -123,6 +123,8 @@
>  extern int graphic_width;
>  extern int graphic_height;
>  extern int graphic_depth;
> +extern int use_mmx;
> +extern int use_sse;
>  extern const char *keyboard_layout;
> 
>  /* XXX: make it dynamic */
> --- target-i386/helper2.c.old   2005-01-17 17:37:57.199481651 +0100
> +++ target-i386/helper2.c       2005-01-17 17:46:18.834424698 +0100
> @@ -25,6 +25,7 @@
>  #include <signal.h>
>  #include <assert.h>
> 
> +#include "vl.h"
>  #include "cpu.h"
>  #include "exec-all.h"
> 
> @@ -106,6 +107,13 @@
>          env->cpuid_features = (CPUID_FP87 | CPUID_DE | CPUID_PSE |
>                                 CPUID_TSC | CPUID_MSR | CPUID_MCE |
>                                 CPUID_CX8 | CPUID_PGE | CPUID_CMOV);
> +#ifdef TARGET_I386
> +               if(use_mmx == 1)
> +                       env->cpuid_features |= CPUID_MMX;
> +               if(use_sse == 1)
> +                       env->cpuid_features |= CPUID_FXSR | CPUID_SSE;
> +#endif
> +
>  #ifdef TARGET_X86_64
>          /* currently not enabled for std i386 because not fully tested */
>          env->cpuid_features |= CPUID_FXSR | CPUID_MMX | CPUID_SSE |
>          CPUID_SSE2;
> 
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
> 
> 
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] Re: Re: Re: 2.6.10-mm3: swsusp: out of memory on resume
  2005-01-17 21:54             ` Fabrice Bellard
@ 2005-01-22  4:17               ` Anand Kumria
  2005-01-22 12:42                 ` Johannes Schindelin
  0 siblings, 1 reply; 11+ messages in thread
From: Anand Kumria @ 2005-01-22  4:17 UTC (permalink / raw)
  To: qemu-devel

On Mon, 17 Jan 2005 22:54:52 +0100, Fabrice Bellard wrote:

> Hi,
> 
> My plan is to add a more generic option to select a given cpu model and to
> be able to disable or enable some specific features (for example '-cpu
> p6+pae+sse3', any other suggestions ?), so I prefer not to include this
> patch now.
> 

My only suggestion would be to make it part of the monitor rather than a
command line option (set cpu <model>|<base>+<feature1><feature2> ...).

Anand

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] Re: Re: Re: 2.6.10-mm3: swsusp: out of memory on resume
  2005-01-22  4:17               ` [Qemu-devel] " Anand Kumria
@ 2005-01-22 12:42                 ` Johannes Schindelin
  0 siblings, 0 replies; 11+ messages in thread
From: Johannes Schindelin @ 2005-01-22 12:42 UTC (permalink / raw)
  To: qemu-devel

Hi,

On Sat, 22 Jan 2005, Anand Kumria wrote:

> On Mon, 17 Jan 2005 22:54:52 +0100, Fabrice Bellard wrote:
>
> > My plan is to add a more generic option to select a given cpu model and to
> > be able to disable or enable some specific features (for example '-cpu
> > p6+pae+sse3', any other suggestions ?), so I prefer not to include this
> > patch now.
> >
>
> My only suggestion would be to make it part of the monitor rather than a
> command line option (set cpu <model>|<base>+<feature1><feature2> ...).

Why? Normally the OS tests for the CPU capabilities at boot time. What you
suggest would be a fine way to shoot the OS in the knee (by taking away
features it assumes are present), and sometimes wouldn't work (when you
grant a capability the OS no longer expects, and thus doesn't use).

Hth,
Dscho

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-01-22 12:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.58.0412241434110.17285@ppc970.osdl.org>
     [not found] ` <200501131909.26021.rjw@sisk.pl>
     [not found]   ` <20050114143400.GA27657@hugang.soulinfo.com>
     [not found]     ` <200501150042.35377.rjw@sisk.pl>
2005-01-15  1:21       ` [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume (was: Re: Ho ho ho - Linux v2.6.10) hugang
2005-01-15 11:48         ` [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume Fabrice Bellard
2005-01-15 16:40           ` hugang
2005-01-16  4:38             ` hugang
2005-01-15 18:02           ` [Qemu-devel] W2K SP0 Status (was: Re: 2.6.10-mm3: swsusp: out of memory on resume) Tim
2005-01-17 18:02           ` [Qemu-devel] Re: Re: 2.6.10-mm3: swsusp: out of memory on resume Ronald
2005-01-17 21:54             ` Fabrice Bellard
2005-01-22  4:17               ` [Qemu-devel] " Anand Kumria
2005-01-22 12:42                 ` Johannes Schindelin
     [not found]         ` <200501151147.32919.rjw@sisk.pl>
     [not found]           ` <200501152220.42129.rjw@sisk.pl>
2005-01-16  5:54             ` [Qemu-devel] Re: 2.6.10-mm3: swsusp: out of memory on resume (was: Re: Ho ho ho - Linux v2.6.10) hugang
2005-01-16 10:07               ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).