Re: [kvm-devel] Compilation problems with git tree

2008-04-08 Thread Zdenek Kabelac
2008/4/8, Marcelo Tosatti [EMAIL PROTECTED]:
 On Tue, Apr 08, 2008 at 01:03:58AM +0200, Zdenek Kabelac wrote:
   Hi
  
   I've tried to compile git tree for kvm-userspace.git
   I've used these configure options:
  
   --disable-gcc-check --with-patched-kernel
  
   using x86-64 platform
  
   I've got this error:
  
   pc.o: In function `pc_init1':
   /home/kabi/export/kvm-userspace/qemu/hw/pc.c:987: undefined reference
   to `kvm_pit_init'
   collect2: ld returned 1 exit status
  
  
   Obviously kvm_pit_init seems to be compiled in only for i386 - I've
   disables this code by #if 0



 Update your host kernel. It seems backward compatibility is broken.



   Core was generated by `qemu-kvm -s -m 320 -smp 2 -net nic,model=pcnet
   -net user -redir'.
   Program terminated with signal 11, Segmentation fault.
  
   #0  0x004849a7 in tcp_reass (tp=0x7fabec000d60, ti=0xec000d60,
   m=0x0) at slirp/tcp_input.c:208


Hmm - to get fixed first compilation problem - or the second coredump crash ?

Because I need to use some combination of other kernel trees for now
I'll stay with linux git tree 2.6.25-rc8 - hopefully patches from  kvm
git tree will get there soon.

I think I'll survive the occasional crash (2x/day) caused by this
backward incompatibility.

As compared with kvm-64  I no longer experience sudden  qemu-kvm stops,
which I had to resolve by attaching strace to qemu procees - that
magically 'unfreezed' qemu
and it was happening quite often.

Zdenek

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] Compilation problems with git tree

2008-04-07 Thread Zdenek Kabelac
Hi

I've tried to compile git tree for kvm-userspace.git
I've used these configure options:

--disable-gcc-check --with-patched-kernel

using x86-64 platform

I've got this error:

ar rcs libqemu.a exec.o kqemu.o cpu-exec.o host-utils.o
translate-all.o translate.o op.o tcg/tcg.o tcg/tcg-dyngen.o
tcg/tcg-runtime.o qemu-kvm.o fpu/softfloat-native.o helper.o helper2.o
qemu-kvm-x86.o kvm-tpr-opt.o qemu-kvm-helper.o disas.o i386-dis.o
gcc -L /home/kabi/export/kvm-userspace/qemu/../libkvm  -g  -m64 -o
qemu-system-x86_64 vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o
migration.o block-raw-posix.o lsi53c895a.o esp.o usb-ohci.o
eeprom93xx.o eepro100.o ne2000.o pcnet.o rtl8139.o e1000.o hypercall.o
virtio.o virtio-net.o virtio-blk.o device-hotplug.o ide.o pckbd.o
ps2.o vga.o sb16.o es1370.o dma.o fdc.o mc146818rtc.o serial.o i8259.o
i8254.o pcspk.o pc.o cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
usb-uhci.o vmmouse.o vmport.o vmware_vga.o extboot.o gdbstub.o
../libqemu_common.a libqemu.a  -lm -lz -lkvm -lgnutls   -lrt -lpthread
-lutil -lSDL -lpthread  -lcurses
pc.o: In function `pc_init1':
/home/kabi/export/kvm-userspace/qemu/hw/pc.c:987: undefined reference
to `kvm_pit_init'
collect2: ld returned 1 exit status


Obviously kvm_pit_init seems to be compiled in only for i386 - I've
disables this code by #if 0

But then during code run I've got this coredump:
'ti' seems to be containing some garbage - am I using the latest code ??
(as this is the last commit I could see:

commit 5208ce19dca268f84a2b9441c2fbb6129161e44c
Author: Marcelo Tosatti [EMAIL PROTECTED]
Date:   Thu Apr 3 20:24:37 2008 -0300)


Core was generated by `qemu-kvm -s -m 320 -smp 2 -net nic,model=pcnet
-net user -redir'.
Program terminated with signal 11, Segmentation fault.

#0  0x004849a7 in tcp_reass (tp=0x7fabec000d60, ti=0xec000d60,
m=0x0) at slirp/tcp_input.c:208
208 if (ti == (struct tcpiphdr *)tp || ti-ti_seq != tp-rcv_nxt)
Missing separate debuginfos, use: debuginfo-install SDL.x86_64
glibc.x86_64 gnutls.x86_64 libX11.x86_64 libXau.x86_64
libXcursor.x86_64 libXdmcp.x86_64 libXext.x86_64 libXfixes.x86_64
libXrandr.x86_64 libXrender.x86_64 libgcrypt.x86_64
libgpg-error.x86_64 libtasn1.x86_64 libxcb.x86_64 ncurses.x86_64
zlib.x86_64
(gdb) bt
#0  0x004849a7 in tcp_reass (tp=0x7fabec000d60, ti=0xec000d60,
m=0x0) at slirp/tcp_input.c:208
#1  0x00485c3b in tcp_input (m=0x2ba7260, iphlen=value
optimized out, inso=value optimized out)
at slirp/tcp_input.c:1052
#2  0x00406aa1 in qemu_send_packet (vc1=0x2b9b0b0,
buf=0x2c9dd58 RT, size=54)
at /home/kabi/export/kvm-userspace/qemu/vl.c:3758
#3  0x00426211 in pcnet_transmit (s=0x2c9d990) at
/home/kabi/export/kvm-userspace/qemu/hw/pcnet.c:1272
#4  0x00426898 in pcnet_poll_timer (opaque=value optimized
out) at /home/kabi/export/kvm-userspace/qemu/hw/pcnet.c:1335
#5  0x00426f30 in pcnet_ioport_writew (opaque=0x7fabec000d60,
addr=0, val=0)
at /home/kabi/export/kvm-userspace/qemu/hw/pcnet.c:1617
#6  0x005050f1 in kvm_outw (opaque=value optimized out,
addr=0, data=0)
at /home/kabi/export/kvm-userspace/qemu/qemu-kvm.c:515
#7  0x005252b4 in handle_io (kvm=0x2ac4000,
run=0x7fac0bc73000, vcpu=1) at libkvm.c:721
#8  0x00525972 in kvm_run (kvm=0x2ac4000, vcpu=1) at libkvm.c:889
#9  0x00505636 in kvm_cpu_exec (env=value optimized out) at
/home/kabi/export/kvm-userspace/qemu/qemu-kvm.c:146
#10 0x005058e0 in ap_main_loop (_env=value optimized out) at
/home/kabi/export/kvm-userspace/qemu/qemu-kvm.c:330
#11 0x00371600740a in start_thread () from /lib64/libpthread.so.0
#12 0x0037154e678d in clone () from /lib64/libc.so.6


Zdenek

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] [PATCH] prepopulate guest pages after write-protecting

2008-04-04 Thread Zdenek Kabelac
2008/4/4, Marcelo Tosatti [EMAIL PROTECTED]:

  Zdenek reported a bug where a looping dmsetup status eventually hangs
  on SMP guests.

  The problem is that kvm_mmu_get_page() prepopulates the shadow MMU
  before write protecting the guest page tables. By doing so, it leaves a
  window open where the guest can mark a pte as present while the host has
  shadow cached such pte as notrap. Accesses to such address will fault
  in the guest without the host having a chance to fix the situation.


Great - this looks like it has fixed my problems with busy looping
processes - lets see if it will fix other weird behaviours  I'm seeing
with kvm :)

Zdenek

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] Qemu-kvm is leaking my memory ???

2008-03-24 Thread Zdenek Kabelac
2008/3/24, Avi Kivity [EMAIL PROTECTED]:
 Avi Kivity wrote:
  
  
   Tested - and actually seeing no difference in my case of memory leak.
   Still it looks like over 30M per execution of qemu is lost.
   (tested with fresh 2.6.25-rc6 with your patch)
  
  
  
   Can you double check? 2.6.25-rc6 definitely leaks without, and here it
   doesn't with the patch.
  


 btw, there's an additional patch I have queued up that might have an
  effect.  please test the attached (which is my 2.6.25 queue).


Yep - I've made a quick short test - and it looks promising - so far I
can not see the leak
with your additional patch.

But I still have get my busy loop problem. Though now it's sometime
stack-back-traced on the  leaveq  - maybe this instruction might cause
some problems ??

Before this patch - I've always got the back-trace at the point of
copy_user_generic_string -
now its slightly different  -- and still applies when I run the second
dmsetup status - it unblocks the looped one)

Call Trace:
 [8803558d] :dm_mod:dm_compat_ctl_ioctl+0xd/0x20
 [802bd352] compat_sys_ioctl+0x182/0x3d0
 [80283d20] vfs_write+0x130/0x170
 [80221192] sysenter_do_call+0x1b/0x66


Call Trace:
 [88032100] ? :dm_mod:table_status+0x0/0x90
 [80436809] ? error_exit+0x0/0x51
 [88032100] ? :dm_mod:table_status+0x0/0x90
 [8032d157] ? copy_user_generic_string+0x17/0x40
 [880332d7] ? :dm_mod:copy_params+0x87/0xb0
 [80237b11] ? __capable+0x11/0x30
 [88033469] ? :dm_mod:ctl_ioctl+0x169/0x260
 [80340712] ? tty_ldisc_deref+0x62/0x80
 [8034320c] ? tty_write+0x22c/0x260
 [8803358d] ? :dm_mod:dm_compat_ctl_ioctl+0xd/0x20
 [802bd352] ? compat_sys_ioctl+0x182/0x3d0
 [80283d20] ? vfs_write+0x130/0x170
 [80221192] ? sysenter_do_call+0x1b/0x66



Here is dissambled  dm_compat_ctl_ioctl:

1fa0 dm_compat_ctl_ioctl:
return (long)ctl_ioctl(command, (struct dm_ioctl __user *)u);
}

#ifdef CONFIG_COMPAT
static long dm_compat_ctl_ioctl(struct file *file, uint command, ulong u)
{
1fa0:   55  push   %rbp
1fa1:   89 f7   mov%esi,%edi
1fa3:   48 89 e5mov%rsp,%rbp
return r;
}

static long dm_ctl_ioctl(struct file *file, uint command, ulong u)
{
return (long)ctl_ioctl(command, (struct dm_ioctl __user *)u);
1fa6:   89 d6   mov%edx,%esi
1fa8:   e8 73 fd ff ff  callq  1d20 ctl_ioctl

#ifdef CONFIG_COMPAT
static long dm_compat_ctl_ioctl(struct file *file, uint command, ulong u)
{
return (long)dm_ctl_ioctl(file, command, (ulong) compat_ptr(u));
}
1fad:   c9  leaveq
return r;
}

static long dm_ctl_ioctl(struct file *file, uint command, ulong u)
{
return (long)ctl_ioctl(command, (struct dm_ioctl __user *)u);
1fae:   48 98   cltq

#ifdef CONFIG_COMPAT
static long dm_compat_ctl_ioctl(struct file *file, uint command, ulong u)
{
return (long)dm_ctl_ioctl(file, command, (ulong) compat_ptr(u));
}
1fb0:   c3  retq

Zdenek

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] Qemu-kvm is leaking my memory ???

2008-03-23 Thread Zdenek Kabelac
2008/3/23, Avi Kivity [EMAIL PROTECTED]:
 Avi Kivity wrote:
  
   I see the same issue too now, and am investigating.
  


 The attached patch should fix the issue.  It is present in 2.6.25-rc6
  only, and not in kvm.git, which is why few people noticed it.


Hi

Tested - and actually seeing no difference in my case of memory leak.
Still it looks like over 30M per execution of qemu is lost.
(tested with fresh 2.6.25-rc6 with your patch)

Also now I'd have said that before my dmsetup status loop test case
was not causing big problems and it was just enough to run another
dmsetup to unblock the loop - now it's usually leads to some wierd end
of qemu itself - will explore more

So it's probably fixing some bug - and exposing another.

As I said before - in my debuger it was looping in page_fault hadler -
i.e.  memory should be paged_in - but as soon as the handler return to
the code to continue memcopy - new page_fault is invoked and pointer 
couters are not changed.

Zdenek

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] Coredump from qemu

2008-03-21 Thread Zdenek Kabelac
Hi

During execution of qemu I've got this crash:

#0  0x00407a29 in qemu_mod_timer (ts=0x2e8cf90,
expire_time=130685351465) at /usr/src/debug/kvm-63/qemu/vl.c:1073
#1  0x00425590 in pcnet_ioport_writew (opaque=0x0,
addr=1836332585, val=8090216)
at /usr/src/debug/kvm-63/qemu/hw/pcnet.c:1617
#2  0x00501cf1 in kvm_outw (opaque=value optimized out,
addr=13865, data=29288)
at /usr/src/debug/kvm-63/qemu/qemu-kvm.c:457
#3  0x0051e2a0 in kvm_run (kvm=0x2dbb030, vcpu=1) at libkvm.c:719
#4  0x00501646 in kvm_cpu_exec (env=value optimized out) at
/usr/src/debug/kvm-63/qemu/qemu-kvm.c:127
#5  0x005021a5 in kvm_main_loop_cpu (env=0x2e8f010) at
/usr/src/debug/kvm-63/qemu/qemu-kvm.c:307
#6  0x00502302 in ap_main_loop (_env=value optimized out) at
/usr/src/debug/kvm-63/qemu/qemu-kvm.c:338
#7  0x00353420740a in start_thread () from /lib64/libpthread.so.0
#8  0x0035336e5d1d in clone () from /lib64/libc.so.6

(gdb) print alarm_timer
$1 = (struct qemu_alarm_timer *) 0x0


It happend during detach of gdb and quit of the qemu itsell - I assume
no all timers were probably stoped when quit_timers was executed ?

Maybe check for non NULL pointer is enough qemu_mod_timer?


I'm using kvm64 fedora rawhide packages.

Zdenek

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] Qemu-kvm is leaking my memory ???

2008-03-19 Thread Zdenek Kabelac
2008/3/16, Avi Kivity [EMAIL PROTECTED]:
 Zdenek Kabelac wrote:
   Hello
  
   Recently I'm using qemu-kvm on fedora-rawhide box with my own kernels
   (with many debug options) I've noticed that over the time my memory
   seems to disappear somewhere.
  
   Here is my memory trace after boot and some time of work - thus memory
   should be populated.
  


 No idea how these should add up.  What does 'free' say?

Ok - here goes my free log (I'm loggin free prior each start of my qemu-kvm
so here is the log for this afternoon:
(I'm running same apps all the time - except during kernel compilation
I'm reading some www pages - and working with gnome-terminal - so some
slightly more memory could have been eaten by them - but not in the
range of hundreds of MB)


Wed Mar 19 12:54:38 CET 2008
 total   used   free sharedbuffers cached
Mem:   20074601525240 482220  0  18060 469812
-/+ buffers/cache:1037368 970092
Swap:0  0  0
Wed Mar 19 13:27:51 CET 2008
 total   used   free sharedbuffers cached
Mem:   20074601491672 515788  0  13024 404220
-/+ buffers/cache:1074428 933032
Swap:0  0  0
Wed Mar 19 13:51:38 CET 2008
 total   used   free sharedbuffers cached
Mem:   20074601513000 494460  0  12676 366708
-/+ buffers/cache:1133616 873844
Swap:0  0  0
Wed Mar 19 14:05:30 CET 2008
 total   used   free sharedbuffers cached
Mem:   20074601976592  30868  0  12220 785672
-/+ buffers/cache:1178700 828760
Swap:0  0  0
Wed Mar 19 14:13:52 CET 2008
 total   used   free sharedbuffers cached
Mem:   20074601865500 141960  0  14592 633136
-/+ buffers/cache:1217772 789688
Swap:0  0  0
Wed Mar 19 14:16:04 CET 2008
 total   used   free sharedbuffers cached
Mem:   20074601533432 474028  0   5852 304736
-/+ buffers/cache:1222844 784616
Swap:0  0  0
Wed Mar 19 15:05:33 CET 2008
 total   used   free sharedbuffers cached
Mem:   20074601545796 461664  0   4100 276756
-/+ buffers/cache:1264940 742520
Swap:0  0  0
Wed Mar 19 15:14:07 CET 2008
 total   used   free sharedbuffers cached
Mem:   20074601748680 258780  0   8324 427172
-/+ buffers/cache:1313184 694276
Swap:0  0  0


-now it's:
 total   used   free sharedbuffers cached
Mem:   20074601784952 222508  0  20644 335360
-/+ buffers/cache:1428948 578512
Swap:0  0  0


and top-twenty memory list of currently running processes:

top - 15:52:29 up 19:07, 12 users,  load average: 0.33, 0.30, 0.60
Tasks: 298 total,   1 running, 296 sleeping,   1 stopped,   0 zombie
Cpu(s):  1.6%us,  3.3%sy,  0.0%ni, 95.1%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2007460k total,  1770748k used,   236712k free,20304k buffers
Swap:0k total,0k used,0k free,   335036k cached

  PID  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
15974  20   0  655m 207m  28m S  0.0 10.6   3:31.31 firefox
 3980  20   0  378m  63m  10m S  1.3  3.2   1:00.53 gnome-terminal
 2657  20   0  481m  58m 9928 S  2.3  3.0  19:16.03 Xorg
12492  20   0  494m  34m  17m S  0.0  1.8   1:20.52 pidgin
 3535  20   0  336m  22m  12m S  0.0  1.2   0:15.41 gnome-panel
 3571  20   0  265m  16m  10m S  0.0  0.9   0:06.25 nm-applet
 3638  20   0  298m  16m 9296 S  0.0  0.8   0:36.79 wnck-applet
 3546  20   0  458m  16m  10m S  0.0  0.8   1:21.65 gnome-power-man
 3579  20   0  261m  16m 8252 S  0.0  0.8   0:02.65 python
 3532  20   0  200m  15m 8144 S  0.3  0.8   1:14.34 metacity
 3754  20   0  325m  14m 9856 S  0.0  0.7   0:00.42 mixer_applet2
 3909  20   0  243m  14m 7988 S  0.0  0.7   0:06.13 notification-da
 3706  20   0  330m  14m 9764 S  0.0  0.7   0:01.40 clock-applet
 3534  20   0  449m  13m 9884 S  0.0  0.7   0:00.92 nautilus
 3540  20   0  250m  12m 8616 S  0.3  0.6   0:07.30 pk-update-icon
 3708  20   0  300m  12m 7940 S  0.0  0.6   0:03.15 gnome-keyboard-
 3752  20   0  290m  11m 8028 S  0.0  0.6   0:00.27 gnome-brightnes
 3553  20   0  286m  11m 8144 S  0.0  0.6   0:04.29 krb5-auth-dialo
 3761  20   0  270m  11m 7968 S  0.0  0.6   0:23.02 cpufreq-applet
 2898  20   0  328m  10m 8240 S  0.0  0.5   0:07.95 gnome-settings-
 3702  20   0  282m 9436 7460 S  0.0  0.5   0:00.25 drivemount_appl
 3749  20   0  288m 8848 6924 S  0.0  0.4   0:00.11 gnome-inhibit-a
 3756

Re: [kvm-devel] Qemu-kvm is leaking my memory ???

2008-03-19 Thread Zdenek Kabelac
2008/3/19, Avi Kivity [EMAIL PROTECTED]:
 Zdenek Kabelac wrote:
   2008/3/16, Avi Kivity [EMAIL PROTECTED]:
  
   Zdenek Kabelac wrote:
 Hello

 Recently I'm using qemu-kvm on fedora-rawhide box with my own kernels
 (with many debug options) I've noticed that over the time my memory
 seems to disappear somewhere.

 Here is my memory trace after boot and some time of work - thus memory
 should be populated.

  
  
   No idea how these should add up.  What does 'free' say?
  
  
   Ok - here goes my free log (I'm loggin free prior each start of my qemu-kvm
   so here is the log for this afternoon:
   (I'm running same apps all the time - except during kernel compilation
   I'm reading some www pages - and working with gnome-terminal - so some
   slightly more memory could have been eaten by them - but not in the
   range of hundreds of MB)
  
  


 Can you make sure that it isn't other processes?  Go to runlevel 3 and
  start the VM using vnc or X-over-network?

Hmmm not really sure what do you mean by external VNC - I could grab
this info once I'll finish some work today and kill all the apps
running in the system - so most of the memory should be released -
will go to  single mode for this - is this what do you want ?


  What host kernel and kvm version are you using?

Usually running quite up-to-date Linus git tree kernel -
Both host/guest are running 2.6.25-rc6 kernels
For compiling using gcc-4.3

kvm itself is fedora rawhide package:
kvm-63-2.fc9.x86_64

(somehow I've troubles to compile the kvm-userspace git tree as libkvm
mismatches my kernel version - which probably means I would have to
use kvm linux kernel to use kvm-userspace ??)
(actually why the gcc-3.x is preferred when this compiler is IMHO far
more broken then 4.3 ?)

I think I've already posted my configuration already several times if
it's needed I'll repost again - I've many debugging features enabled
for my kernels
(yet having no idea how to use them to detect my lost memory :))

Zdenek

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] Oopses with Oprofile and qemu-kvm

2008-03-14 Thread Zdenek Kabelac
Hi

I'm trying various thing with qemu to resolve my other issue and I've
tried to use oprofile.
But as soon  as I run these:

opcontrol --vmlinux=mine/vmlinux
opcontrol --start

I get kernel oops (see bellow)

Is the fault in qemu (i.e. NMI is not emulated) or do I have to use
some other tools ?
Or should I report this to lkml ?

[   59.423311] oprofile: using NMI interrupt.
[   65.125411] general protection fault:  [1] PREEMPT SMP
[   65.128156] CPU 1
[   65.128156] Modules linked in: oprofile nfs lockd nfs_acl sunrpc
autofs4 dm_mod loop rtc psmouse evdev serio_raw i2c
_piix4 pcnet32 mii i2c_core button
[   65.128156] Pid: 2584, comm: udevd Not tainted 2.6.25-rc5-replic-server #52
[   65.128156] RIP: 0010:[881043e9]  [881043e9]
:oprofile:nmi_save_registers+0x49/0xb0
[   65.128156] RSP: :81001f89bf78  EFLAGS: 0002
[   65.128156] RAX: 0001 RBX:  RCX: 00c1
[   65.128156] RDX: 88106400 RSI:  RDI: 81001b9513a8
[   65.128156] RBP: 81001f89bf78 R08: 0020 R09: 81001b951410
[   65.128156] R10: 0002 R11: 0001 R12: 881043a0
[   65.128156] R13: 0001 R14:  R15: 81001c1c65a0
[   65.128156] FS:  () GS:81001f80f190(0063)
knlGS:f7d79720
[   65.128156] CS:  0010 DS: 002b ES: 002b CR0: 8005003b
[   65.128156] CR2: f7dad1b0 CR3: 1b93b000 CR4: 06e0
[   65.128156] DR0:  DR1:  DR2: 
[   65.128156] DR3:  DR6: 0ff0 DR7: 0400
[   65.128156] Process udevd (pid: 2584, threadinfo 81001b004000,
task 81001bba8000)
[   65.128156] Stack:  81001f89bfa8 8101f74f
aaab 81001c0f1d68
[   65.128156]  810002666220  81001b005c30
8100d25b
[   65.128156]  81001b005c30 EOI  81001b005d48
0001 
[   65.128156] Call Trace:
[   65.128156]  IRQ  [8101f74f]
smp_call_function_interrupt+0x4f/0x80
[   65.128156]  [8100d25b] call_function_interrupt+0x6b/0x70
[   65.128156]  EOI  [8109bd60] ? __do_fault+0x240/0x580
[   65.128156]  [8109bcdd] ? __do_fault+0x1bd/0x580
[   65.128156]  [8109df4d] ? handle_mm_fault+0x26d/0x8c0
[   65.128156]  [812f8cac] ? do_page_fault+0x3fc/0xb50
[   65.128156]  [81058171] ? hrtimer_start+0xe1/0x1a0
[   65.128156]  [8106157a] ? get_lock_stats+0x2a/0x70
[   65.128156]  [810615ce] ? put_lock_stats+0xe/0x30
[   65.128156]  [810415b3] ? do_setitimer+0x393/0x3b0
[   65.128156]  [812f59b2] ? _spin_unlock_irq+0x32/0x80
[   65.128156]  [81063461] ? trace_hardirqs_on+0x131/0x190
[   65.128156]  [812f59bd] ? _spin_unlock_irq+0x3d/0x80
[   65.128156]  [810415b3] ? do_setitimer+0x393/0x3b0
[   65.128156]  [812f5151] ? trace_hardirqs_on_thunk+0x35/0x3a
[   65.128156]  [812f646d] ? error_exit+0x0/0xa9
[   65.128156]
[   65.128156]
[   65.128156] Code: b8 60 c6 10 88 4c 8b 88 68 c6 10 88 85 c9 74 3b
8d 41 ff 31 f6 4c 8d 40 01 49 c1 e0 04 0f 1f 44 00
 00 48 8b 0c 37 48 85 c9 74 17 0f 32 48 c1 e2 20 89 c0 48 09 c2 89
54 37 0c 48 c1 ea 20 89 54
[   65.128156] RIP  [881043e9] :oprofile:nmi_save_registers+0x49/0xb0
[   65.128156]  RSP 81001f89bf78
[   65.128156] ---[ end trace e503d3702565a4da ]---
[   65.128156] Kernel panic - not syncing: Aiee, killing interrupt handler!


Or another one:

[   69.388548] oprofile: using NMI interrupt.
[   78.377689] general protection fault:  [1] PREEMPT SMP
[   78.378754] CPU 0
[   78.378754] Modules linked in: oprofile nfs lockd nfs_acl sunrpc
autofs4 dm_mod loop psmouse i2c_piix4 evdev rtc ser
io_raw i2c_core pcnet32 mii button
[   78.378754] Pid: 506, comm: udevd Not tainted 2.6.25-rc5-replic-server #52
[   78.378754] RIP: 0010:[881063e9]  [881063e9]
:oprofile:nmi_save_registers+0x49/0xb0
[   78.378754] RSP: 0018:81559f78  EFLAGS: 0002
[   78.378754] RAX: 0001 RBX:  RCX: 00c1
[   78.378754] RDX: 88108400 RSI:  RDI: 81001b589000
[   78.378754] RBP: 81559f78 R08: 0020 R09: 81001b589270
[   78.378754] R10: 0002 R11: 0001 R12: 881063a0
[   78.378754] R13: 0001 R14: 81001f20c000 R15: 
[   78.378754] FS:  () GS:8148c000(0063)
knlGS:f7e59720
[   78.378754] CS:  0010 DS: 002b ES: 002b CR0: 8005003b
[   78.378754] CR2: 080f0d78 CR3: 1f109000 CR4: 06e0
[   78.378754] DR0:  DR1:  DR2: 
[   78.378754] DR3:  DR6: 0ff0 DR7: 0400
[   78.378754] Process udevd (pid: 506, threadinfo 81001f204000,
task 

[kvm-devel] Qemu-kvm is leaking my memory ???

2008-03-14 Thread Zdenek Kabelac
Hello

Recently I'm using qemu-kvm on fedora-rawhide box with my own kernels
(with many debug options) I've noticed that over the time my memory
seems to disappear somewhere.

Here is my memory trace after boot and some time of work - thus memory
should be populated.

MemTotal:  2007460 kB
MemFree:618772 kB
Buffers: 46044 kB
Cached: 733156 kB
SwapCached:  0 kB
Active: 613384 kB
Inactive:   541844 kB
SwapTotal:   0 kB
SwapFree:0 kB
Dirty: 148 kB
Writeback:   0 kB
AnonPages:  376152 kB
Mapped:  67184 kB
Slab:80340 kB
SReclaimable:50284 kB
SUnreclaim:  30056 kB
PageTables:  27976 kB
NFS_Unstable:0 kB
Bounce:  0 kB
CommitLimit:   1003728 kB
Committed_AS:   810968 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 71244 kB
VmallocChunk: 34359666419 kB
618772 + 46044 + 733156 + 148 + 376152 + 67184 + 80340 + 50284 + 30056
+ 27976 = 2030112

2GB  (though could be wrong - I could be wrong and adding something improperly)

And this memory listing is when I work during the day with qemu-kvm do
something like 30-50 qemu restarts.  Then before I rebooted the
machine I've killed nearly all running task (i.e no Xserver, most of
services turned of)

MemTotal:  2007416 kB
MemFree:652412 kB
Buffers: 7 kB
Cached: 607144 kB
SwapCached:  0 kB
Active: 571464 kB
Inactive:   709796 kB
SwapTotal:   0 kB
SwapFree:0 kB
Dirty:   0 kB
Writeback:   0 kB
AnonPages:6408 kB
Mapped:   4844 kB
Slab:52620 kB
SReclaimable:32752 kB
SUnreclaim:  19868 kB
PageTables:   1468 kB
NFS_Unstable:0 kB
Bounce:  0 kB
CommitLimit:   1003708 kB
Committed_AS:33988 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 68152 kB
VmallocChunk: 34359668731 kB

I've have expected much more free memory here and I definitely do not
see how this could combine 2GB of my memory:

652412 + 7 + 607144 + 6408 + 4844 + 52620 + 32752 + 19868 + 1468 =
1447516

1.4GB

so where is my 600MB piece of memory hiding ?

Zdenek

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] loop in copy_user_generic_string

2008-03-12 Thread Zdenek Kabelac
2008/3/11, Zdenek Kabelac [EMAIL PROTECTED]:
 2008/3/9, Zdenek Kabelac [EMAIL PROTECTED]:

  2008/3/7, Zdenek Kabelac [EMAIL PROTECTED]:
  
2008/3/5, Zdenek Kabelac [EMAIL PROTECTED]:

  2008/3/5, Avi Kivity [EMAIL PROTECTED]:
  
Andi Kleen wrote:
   Avi Kivity [EMAIL PROTECTED] writes:
  
   Most likely movs emulation is broken for long counts.  Please 
 post a
   disassembly of copy_user_generic_string to make sure we're 
 looking at
   the same code.
  
  
   Be careful -- this code is patched at runtime and what you
   see in the vmlinux is not necessarily the same that is executed
  
  


 If the disassembled instruction isn't marked as an alternative in 
 the
  source, then it can't be patched, right?



 Hello

  Any progress on this - It looks like I get this bug quite often when I 
 test
  device-mapper code.

  
  
  
   Hello
  
I've made some more experiments and noticed few more things:
  
a) - it is just enough to run parallel loop with cat LVM partition
/dev/null and dmsetup status
  
b) when I insert for() loop for zeroing allocated memory in the
dm-ioctl copy_params function my loop start once the memory crosses
exactly 4KB boundary (visible from register content)
  
c) in my trace log I could usually always see this pattern:
[  160.634897]  [812ee5ba] preempt_schedule_irq+0x5a/0xa0
[  160.634897]  [8100cf46] retint_kernel+0x26/0x30
  
from the look in the arch/x86/kernel/entry64.s I could really see
there is some potentiality for internal loop that may call
preempt_schedule_irq in upon some check in  exit_intr - but having
actually now idea what's this all about...
  
I've put there just some extra dump_stack trace in the
preempt_schedule_irq - and it's really being printed - but quite
slowly actually considering process eats 100% CPU
  
So anyone has any idea what might be wrong ?



 Hello

  I've some more news here - it looks I've found working setup on my C2D.

  All I need to do is compile my 64bit kernel with optimization for space.
  This will magical start to work - at least in this case.

  I'll now probably slowly try to figure out which directory with -Os
  compilation makes the difference.

  Also I've noticed that standard Debian 2.6.24-4-686 kernel loops in
  Qemu, but 486 version doesn't.

Argh - being stupid here - it looks like these 'working' kernels were
not SMP actually.
As long as the SMP is used - I still get the busy loop :(
Now being clueless

Zdenek

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] loop in copy_user_generic_string

2008-03-12 Thread Zdenek Kabelac
2008/3/12, Andi Kleen [EMAIL PROTECTED]:
  Argh - being stupid here - it looks like these 'working' kernels were
   not SMP actually.
   As long as the SMP is used - I still get the busy loop :(
   Now being clueless


 Sorry don't have the cycles to look into your problem, but the
  standard procedure for hard problems that can be reproduced
  is to git bisect them down to the change set that introduced the
  problem originally and then complain to whoever authored that.

The problem is - I don't know about any working SMP kernel which would
survive this test - thought haven't got into a really big history -
tried something like 2.6.22 kernels - no luck - also many kernel seems
to be unbootable in SMP mode on my machine giving many oopses - in
fact just 2.6.24 series starts to be at least reliable in booting in
my Qemu setup without failing during disk mounting or in some other
place...

Will try to find probably some 2.6.18 kernel and will check what happens.

On the other hand - I've tried to replicate my bug on few other
machines with no luck actually - so it's something which might not be
easy to trace :(

Zdenek

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] loop in copy_user_generic_string

2008-03-12 Thread Zdenek Kabelac
2008/3/12, Zdenek Kabelac [EMAIL PROTECTED]:
 2008/3/12, Andi Kleen [EMAIL PROTECTED]:

   Argh - being stupid here - it looks like these 'working' kernels were
 not SMP actually.
 As long as the SMP is used - I still get the busy loop :(
 Now being clueless
  
  
   Sorry don't have the cycles to look into your problem, but the
standard procedure for hard problems that can be reproduced
is to git bisect them down to the change set that introduced the
problem originally and then complain to whoever authored that.


 The problem is - I don't know about any working SMP kernel which would
  survive this test - thought haven't got into a really big history -
  tried something like 2.6.22 kernels - no luck - also many kernel seems
  to be unbootable in SMP mode on my machine giving many oopses - in
  fact just 2.6.24 series starts to be at least reliable in booting in
  my Qemu setup without failing during disk mounting or in some other
  place...

  Will try to find probably some 2.6.18 kernel and will check what happens.

  On the other hand - I've tried to replicate my bug on few other
  machines with no luck actually - so it's something which might not be
  easy to trace :(


Btw - just for testing purposes - I've taken current fedora rawhide kernel.
Started machine with this kernel and installed it into qemu guest as well.

And this is what I get when running in SMP mode:

BUG: soft lockup - CPU#1 stuck for 61s! [udevd:583]
CPU 1:
Modules linked in: floppy ata_piix ata_generic pata_acpi pcnet32 mii
libata scsi_m
od
Pid: 583, comm: udevd Not tainted 2.6.25-0.105.rc5.fc9 #1
RIP: 0010:[8113b907]  [8113b907] clear_page_c+0x7/0x10
RSP: :810015455b20  EFLAGS: 00010246
RAX:  RBX: 810015455be8 RCX: 0200
RDX: 06a0 RSI: 810015455a74 RDI: 810015001000
RBP: 8100 R08: 15562000 R09: 8100
R10: 0292 R11: 0001 R12: 3000
R13: 81009540 R14: 810015454000 R15: 0001
FS:  () GS:810017509320(0063) knlGS:f7f1d720
CS:  0010 DS: 002b ES: 002b CR0: 8005003b
CR2: 810015001000 CR3: 159e9000 CR4: 06a0
DR0:  DR1:  DR2: 
DR3:  DR6: 0ff0 DR7: 0400

Call Trace:
 [810833ac] ? get_page_from_freelist+0x51f/0x6b6
 [810838ae] ? __alloc_pages+0xed/0x3c3
 [8109d5d8] ? alloc_pages_current+0x100/0x109
 [81082e4e] ? __get_free_pages+0xe/0x4d
 [810f0d4b] ? show_stat+0x2a/0x4af
 [810838ae] ? __alloc_pages+0xed/0x3c3
 [8109d5d8] ? alloc_pages_current+0x100/0x109
 [81082e4e] ? __get_free_pages+0xe/0x4d
 [810a621d] ? __kmalloc+0x3e/0xf0
 [810c555f] ? seq_read+0x143/0x2a2
 [810c5532] ? seq_read+0x116/0x2a2
 [810c541c] ? seq_read+0x0/0x2a2
 [810c541c] ? seq_read+0x0/0x2a2
 [810e9df5] ? proc_reg_read+0x8a/0xa7
 [810ab489] ? vfs_read+0xab/0x154
 [810ab5f6] ? sys_read+0x47/0x70
 [81023f32] ? ia32_sysret+0x0/0xa

(Full trace attached)
So I guess I'm kind of lucky that my own kernels actually boot in smp
mode properly.
Guest was started with 384MB - host has 2GB - around 1GB was free when started.
Kernel boots with nosmp flag.

Zdenek


qemu-debian.tty
Description: Binary data
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] loop in copy_user_generic_string

2008-03-11 Thread Zdenek Kabelac
2008/3/9, Zdenek Kabelac [EMAIL PROTECTED]:
 2008/3/7, Zdenek Kabelac [EMAIL PROTECTED]:

  2008/3/5, Zdenek Kabelac [EMAIL PROTECTED]:
  
2008/3/5, Avi Kivity [EMAIL PROTECTED]:

  Andi Kleen wrote:
 Avi Kivity [EMAIL PROTECTED] writes:

 Most likely movs emulation is broken for long counts.  Please 
 post a
 disassembly of copy_user_generic_string to make sure we're 
 looking at
 the same code.


 Be careful -- this code is patched at runtime and what you
 see in the vmlinux is not necessarily the same that is executed


  
  
   If the disassembled instruction isn't marked as an alternative in the
source, then it can't be patched, right?
  
  
  
   Hello
  
Any progress on this - It looks like I get this bug quite often when I 
 test
device-mapper code.
  



 Hello

  I've made some more experiments and noticed few more things:

  a) - it is just enough to run parallel loop with cat LVM partition
  /dev/null and dmsetup status

  b) when I insert for() loop for zeroing allocated memory in the
  dm-ioctl copy_params function my loop start once the memory crosses
  exactly 4KB boundary (visible from register content)

  c) in my trace log I could usually always see this pattern:
  [  160.634897]  [812ee5ba] preempt_schedule_irq+0x5a/0xa0
  [  160.634897]  [8100cf46] retint_kernel+0x26/0x30

  from the look in the arch/x86/kernel/entry64.s I could really see
  there is some potentiality for internal loop that may call
  preempt_schedule_irq in upon some check in  exit_intr - but having
  actually now idea what's this all about...

  I've put there just some extra dump_stack trace in the
  preempt_schedule_irq - and it's really being printed - but quite
  slowly actually considering process eats 100% CPU

  So anyone has any idea what might be wrong ?


Hello

I've some more news here - it looks I've found working setup on my C2D.

All I need to do is compile my 64bit kernel with optimization for space.
This will magical start to work - at least in this case.

I'll now probably slowly try to figure out which directory with -Os
compilation makes the difference.

Also I've noticed that standard Debian 2.6.24-4-686 kernel loops in
Qemu, but 486 version doesn't.

So if anyone starts to get idea what could be wrong...

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] loop in copy_user_generic_string

2008-03-09 Thread Zdenek Kabelac
2008/3/7, Zdenek Kabelac [EMAIL PROTECTED]:
 2008/3/5, Zdenek Kabelac [EMAIL PROTECTED]:

  2008/3/5, Avi Kivity [EMAIL PROTECTED]:
  
Andi Kleen wrote:
   Avi Kivity [EMAIL PROTECTED] writes:
  
   Most likely movs emulation is broken for long counts.  Please post a
   disassembly of copy_user_generic_string to make sure we're looking 
 at
   the same code.
  
  
   Be careful -- this code is patched at runtime and what you
   see in the vmlinux is not necessarily the same that is executed
  
  


 If the disassembled instruction isn't marked as an alternative in the
  source, then it can't be patched, right?



 Hello

  Any progress on this - It looks like I get this bug quite often when I test
  device-mapper code.



Hello

I've made some more experiments and noticed few more things:

a) - it is just enough to run parallel loop with cat LVM partition
/dev/null and dmsetup status

b) when I insert for() loop for zeroing allocated memory in the
dm-ioctl copy_params function my loop start once the memory crosses
exactly 4KB boundary (visible from register content)

c) in my trace log I could usually always see this pattern:
[  160.634897]  [812ee5ba] preempt_schedule_irq+0x5a/0xa0
[  160.634897]  [8100cf46] retint_kernel+0x26/0x30

from the look in the arch/x86/kernel/entry64.s I could really see
there is some potentiality for internal loop that may call
preempt_schedule_irq in upon some check in  exit_intr - but having
actually now idea what's this all about...

I've put there just some extra dump_stack trace in the
preempt_schedule_irq - and it's really being printed - but quite
slowly actually considering process eats 100% CPU

So anyone has any idea what might be wrong ?

Zdenek

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] loop in copy_user_generic_string

2008-03-07 Thread Zdenek Kabelac
2008/3/5, Zdenek Kabelac [EMAIL PROTECTED]:
 2008/3/5, Avi Kivity [EMAIL PROTECTED]:

  Andi Kleen wrote:
 Avi Kivity [EMAIL PROTECTED] writes:

 Most likely movs emulation is broken for long counts.  Please post a
 disassembly of copy_user_generic_string to make sure we're looking at
 the same code.


 Be careful -- this code is patched at runtime and what you
 see in the vmlinux is not necessarily the same that is executed


  
  
   If the disassembled instruction isn't marked as an alternative in the
source, then it can't be patched, right?
  

Hello

Any progress on this - It looks like I get this bug quite often when I test
device-mapper code.

Should I test something special ?

Also I'm seeing some problems with nfs - not yet tracked down, but I'd
like to get bugs fixed after another. Also about two times qemu-kvm
coredumped - unfortunately it's compiled without debugs thus the
traceback was not really useful to make any report...

Zdenek

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] loop in copy_user_generic_string

2008-03-05 Thread Zdenek Kabelac
2008/3/5, Avi Kivity [EMAIL PROTECTED]:
 Andi Kleen wrote:
   Avi Kivity [EMAIL PROTECTED] writes:
  
   Most likely movs emulation is broken for long counts.  Please post a
   disassembly of copy_user_generic_string to make sure we're looking at
   the same code.
  
  
   Be careful -- this code is patched at runtime and what you
   see in the vmlinux is not necessarily the same that is executed
  
  


 If the disassembled instruction isn't marked as an alternative in the
  source, then it can't be patched, right?



   Incidentially that might cause problems.


 Specific to kvm?  how?


As for me - I'm note sure were this bug come from - I just can easily
reproduce it on my box with Qemu-kvm - the problem could be also
directly in kernel - (either MMU or dm) - I just know the bug is not
reproducible with vmware nor natively running code.
On the other hand Qemu-kvm easily catches racing bugs compared with
native execution - so maybe it's exposing some MMU problem.

I've traced the problem to the instruction place - but I'm not sure
how to help more with this issue - so if anyone has some idea what
else should I check - let me know.

I've got an idea to replace rep movqs with plain  asm loop - does
anyone thinks it might be worth to check this ??

Zdenek

PS: In the attachment there is my config file - thought there is
probably nothing special


config.bz2
Description: BZip2 compressed data
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] loop in copy_user_generic_string

2008-03-04 Thread Zdenek Kabelac
Hello


I'm having weird problem and being a bit puzzled about where to look
for this bug.

I'm using T61 - C2D  2GB

So I'll describe symptoms:

When I run inside my 0.5G smp  qemu-kvm guest with Debian these two
loops in parallel:

'while : ; do dmsetup status  ; done'

and

'while : ; do cat /dev/zero /dev/mapper/any_free_to_use_lvm_partition ; done'

after a while dmsetup start to loop in this place:

[  356.257323] dmsetup   R  running task0  3385   2342
[  356.257323]  81001c9fbc58 812ee85e 
0001
[  356.257323]  00070617 0001 81001be94000
81001f864000
[  356.257323]  81001be94360 00018100cddc 81001be94000
812f13b1
[  356.257323] Call Trace:
[  356.257323]  [812ee85e] ? thread_return+0x99/0x51b
[  356.257323]  [812f13b1] ? trace_hardirqs_on_thunk+0x35/0x3a
[  356.257323]  [81065749] ? trace_hardirqs_on+0x139/0x1a0
[  356.257323]  [812f13b1] ? trace_hardirqs_on_thunk+0x35/0x3a
[  356.257323]  [8100cddc] ? restore_args+0x0/0x30
[  356.257323]  [8117c017] ? copy_user_generic_string+0x17/0x40
[  356.257323]  [8804c527] ? :dm_mod:copy_params+0x87/0xb0
[  356.257323]  [81047d11] ? __capable+0x11/0x30
[  356.257323]  [8804c6b9] ? :dm_mod:ctl_ioctl+0x169/0x260
[  356.257323]  [8804c7dd] ? :dm_mod:dm_compat_ctl_ioctl+0xd/0x20
[  356.257323]  [810f6c12] ? compat_sys_ioctl+0x182/0x3d0
[  356.257323]  [810bbba0] ? vfs_write+0x130/0x170
[  356.257323]  [812f13eb] ? trace_hardirqs_off_thunk+0x35/0x37
[  356.257323]  [8102aec2] ? sysenter_do_call+0x1b/0x70
[  356.257323]  [812f13b1] ? trace_hardirqs_on_thunk+0x35/0x3a


I'm using preemptible kernel and the code will stay in the
copy_user_generic_string call forever eating 100%cpu - without
preemption the kernel gets dead.

With preemption when I run at this moment second dmsetup status in
paralllel the busy-looped dmsetup gets finished and while loop starts
to continue agains until next dmsetup busy-loop.

I've noticed that if I change inside  drivers/md/dm-ioctl.c
copy_params  the parameter tmp.data_size in the copy_from_user call to
just page size (4kB) - or when I replace vmalloc to kmalloc - the busy
loop will not happen.

So it seems to be related to page jump somehow

Anyway might have any idea - what is going on here ?

Thanks

Zdenek

Cc me please I'm not a litst member.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


Re: [kvm-devel] loop in copy_user_generic_string

2008-03-04 Thread Zdenek Kabelac
2008/3/4, Avi Kivity [EMAIL PROTECTED]:
 Zdenek Kabelac wrote:
   Hello
  
  
   I'm having weird problem and being a bit puzzled about where to look
   for this bug.
  
   I'm using T61 - C2D  2GB
  
   So I'll describe symptoms:
  
   When I run inside my 0.5G smp  qemu-kvm guest with Debian these two
   loops in parallel:
  
   'while : ; do dmsetup status  ; done'
  
   and
  
   'while : ; do cat /dev/zero /dev/mapper/any_free_to_use_lvm_partition ; 
 done'
  
   after a while dmsetup start to loop in this place:
  

  [  356.257323]  [8117c017] ? copy_user_generic_string+0x17/0x40
  
  

  I'm using preemptible kernel and the code will stay in the
   copy_user_generic_string call forever eating 100%cpu - without
   preemption the kernel gets dead.
  
   With preemption when I run at this moment second dmsetup status in
   paralllel the busy-looped dmsetup gets finished and while loop starts
   to continue agains until next dmsetup busy-loop.
  
   I've noticed that if I change inside  drivers/md/dm-ioctl.c
   copy_params  the parameter tmp.data_size in the copy_from_user call to
   just page size (4kB) - or when I replace vmalloc to kmalloc - the busy
   loop will not happen.
  
   So it seems to be related to page jump somehow
  
   Anyway might have any idea - what is going on here ?
  


 Most likely movs emulation is broken for long counts.  Please post a
  disassembly of copy_user_generic_string to make sure we're looking at
  the same code.


Is it emulated ? I've thought it's running natively with vmx?

Anyway here is  objdump of copy_user_64.o
(loops on 0x1d7)

01c0 copy_user_generic_string:
 1c0:   41 89 c8mov%ecx,%r8d
 1c3:   89 d1   mov%edx,%ecx
 1c5:   c1 e9 03shr$0x3,%ecx
 1c8:   83 e2 07and$0x7,%edx
 1cb:   74 0a   je 1d7 copy_user_generic_string+0x17
 1cd:   f3 48 a5rep movsq %ds:(%rsi),%es:(%rdi)
 1d0:   89 d1   mov%edx,%ecx
 1d2:   f3 a4   rep movsb %ds:(%rsi),%es:(%rdi)
 1d4:   89 c8   mov%ecx,%eax
 1d6:   c3  retq
 1d7:   f3 48 a5rep movsq %ds:(%rsi),%es:(%rdi)
 1da:   31 c0   xor%eax,%eax
 1dc:   c3  retq
 1dd:   48 8d 04 ca lea(%rdx,%rcx,8),%rax
 1e1:   eb 02   jmp1e5 copy_user_generic_string+0x25
 1e3:   89 c8   mov%ecx,%eax
 1e5:   45 85 c0test   %r8d,%r8d
 1e8:   74 08   je 1f2 copy_user_generic_string+0x32
 1ea:   89 c1   mov%eax,%ecx
 1ec:   50  push   %rax
 1ed:   31 c0   xor%eax,%eax
 1ef:   f3 aa   rep stos %al,%es:(%rdi)
 1f1:   58  pop%rax
 1f2:   c3  retq

Zdenek

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel