You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(33) |
Nov
(325) |
Dec
(320) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(484) |
Feb
(438) |
Mar
(407) |
Apr
(713) |
May
(831) |
Jun
(806) |
Jul
(1023) |
Aug
(1184) |
Sep
(1118) |
Oct
(1461) |
Nov
(1224) |
Dec
(1042) |
2008 |
Jan
(1449) |
Feb
(1110) |
Mar
(1428) |
Apr
(1643) |
May
(682) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Tan, L. <li...@in...> - 2008-05-16 06:26:50
|
struct metadata { u32 kmagic; /* stores kernel defined metadata read from debugfs entry*/ u32 umagic; /* stores userspace tool defined metadata */ u32 extra; /* it is redundant, only use to fit into record. */ } seems umagic and extra are no need now. I guess they were designed as record pad to keep the format of trace log transparent to kvmtrace_format, but now kvmtrace_format has to know the format: the first record is metadata So I’ll change to struct metadata { u32 kmagic; /* stores kernel defined metadata */ } Tan Li -----Original Message----- From: Tan, Li Sent: 2008年5月15日 9:20 To: 'Hollis Blanchard' Cc: kvm-devel; kvm...@li... Subject: RE: kvm trace support for ppc -----Original Message----- From: Hollis Blanchard [mailto:ho...@us...] Sent: 2008年5月15日 5:37 To: Tan, Li Cc: kvm-devel; kvm...@li... Subject: Re: kvm trace support for ppc On Tuesday 13 May 2008 03:06:19 Tan, Li wrote: > Hollisb, > I have 2 more questions: > 1. seems record won't be overwritten because current code is as following: > /* > * The relay channel is used in "no-overwrite" mode, it keeps trace of how > * many times we encountered a full subbuffer, to tell user space app the > * lost records there were. > */ > static int kvm_subbuf_start_callback(struct rchan_buf *buf, void *subbuf, > void *prev_subbuf, size_t prev_padding) > { > struct kvm_trace *kt; > > if (!relay_buf_full(buf)) > return 1; > > kt = buf->chan->private_data; > atomic_inc(&kt->lost_records); > > return 0; > } > > 2. Then needn't expose debugfs entry "kvmtrace-metadata", we can use existing relayfs to output struct metadata with kmagic, if we update code as following? > static int kvm_subbuf_start_callback(struct rchan_buf *buf, void *subbuf, > void *prev_subbuf, size_t prev_padding) > { > struct kvm_trace *kt; > > if (!relay_buf_full(buf)) > { > if (!prev_subbuf) { > //here is executed only once (when the channel is opened) > subbuf_start_reserve(buf, sizeof(struct metadata)); > ((struct metadata *)subbuf)->kmagic = 0x1234; > } > > return 1; > } > > kt = buf->chan->private_data; > atomic_inc(&kt->lost_records); > > return 0; > } Ah, I didn't understand what the "lost records" handling was about. Given that it won't be lost, it would be OK for the kernel to export the header, and in that case I guess you would want it to be the same size as the other records. I'm not sure how I feel about that from a layering point of view, but at least it would be functional. [tan] The relay channel is used in "no-overwrite" mode, so it will lost any new items if encounters a full subbuffer, "lost records" is to count lost records. Yes, metadata is the same size as the other records. This solution needn't change kvmtrace user app, only need to change kvmtrace_format.pl like following: if i == 1: line = sys.stdin.read(struct.calcsize(HDRREC)) (kmgc, umgc, mgcpad) = struct.unpack(HDRREC, line) if kmgc == 0x1234: rev = False else: rev = True continue # If i > 1: line = sys.stdin.read(struct.calcsize(HDRREC)) (event, pid, vcpu_id) = struct.unpack(HDRREC, line) ... if rev: event = reverse_int(event) pid = reverse_int(pid) vcpu_id = reverse_int(vcpu_id) tsc = reverse_qword(tsc) d1 = reverse_int(d1) d2 = reverse_int(d2) d3 = reverse_int(d3) d4 = reverse_int(d4) d5 = reverse_int(d5) -- Hollis Blanchard IBM Linux Technology Center |
From: Nick P. <np...@su...> - 2008-05-15 23:52:26
|
On Thu, May 15, 2008 at 10:33:57AM -0700, Christoph Lameter wrote: > On Thu, 15 May 2008, Nick Piggin wrote: > > > Oh, I get that confused because of the mixed up naming conventions > > there: unmap_page_range should actually be called zap_page_range. But > > at any rate, yes we can easily zap pagetables without holding mmap_sem. > > How is that synchronized with code that walks the same pagetable. These > walks may not hold mmap_sem either. I would expect that one could only > remove a portion of the pagetable where we have some sort of guarantee > that no accesses occur. So the removal of the vma prior ensures that? I don't really understand the question. If you remove the pte and invalidate the TLBS on the remote image's process (importing the page), then it can of course try to refault the page in because it's vma is still there. But you catch that refault in your driver , which can prevent the page from being faulted back in. |
From: Подарок <ig...@bo...> - 2008-05-15 23:39:52
|
Новые коллекции постельного белья на сайте www.posmagazin.ru Большой выбор на любой вкус, цвет и кошелёк. Доставка по Москве, отправка по России! Заходите www.posmagazin.ru |
From: Dor L. <dor...@qu...> - 2008-05-15 23:02:57
|
On Thu, 2008-05-15 at 11:11 -0700, Michael Lilie (mlilie) wrote: > Running iperf with 100 connections crashes with the new virtio driver. > The same setup works with e1000. > > BSOD data: > > DRIVER_IRQL_NOT_LESS_OR_EQUAL That's not good, I just tested the old driver with xp guest and it was ok. Probably the locking change might triggered it. We'll send a fix next week. Regards, Dor > > *** STOP: 0x000000D1 (0x0000001C, 0x00000002, 0x00000000, 0xF86FFE03) > *** kvmnet.sys - Address F86FFE03 base at F86FF000, DateStamp > 4827fdde > > > remote iperf: iperf -c 2.43.181.131 -p 18332 -P 100 -t 10 > guest iperf: iperf -s -p 18332 > > kvm-68, kvm-guest-drivers-windows-2 > > Guest: Win2003 enterprise, SP1 > > Host: 2.6.23 x86_64 > > Qemu cmdline: -pidfile /var/run/vb1.pid -daemonize -boot c > -m 512 -name 'VB-05-1 w2k3' -cdrom /local/local1/vbs/w2k3.iso > -net nic,vlan=0,macaddr=00:16:3E:D0:6C:45,model=virtio > -net tap,vlan=0,ifname=vblade10,script=/tmp/vblade10 > -drive index=0,if=ide,file=/vbspace/vb1-disk0 > -cpu qemu64 -vnc :1 -S -monitor pty &>/var/run/vb1.qemu > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > kvm-devel mailing list > kvm...@li... > https://lists.sourceforge.net/lists/listinfo/kvm-devel |
From: Mohammed G. <m.g...@gm...> - 2008-05-15 18:14:05
|
On Wed, May 14, 2008 at 10:29 AM, Guillaume Thouvenin <gui...@ex...> wrote: > On Tue, 6 May 2008 20:05:39 +0300 > "Mohammed Gamal" <m.g...@gm...> wrote: > > >> > > > WinXP fails with the patch applied too. Ubuntu 7.10 live CD and >> > > > FreeDOS don't boot but complain about instruction mov 0x11,sreg not >> > > > being emulated. > > Mohammed, can you try the patch at the end of this mail? Here it's > working with FreeDOS now (I added the emulation of 0x90 that is an xchg > instruction). I can also boot winXP Professional X64 edition. I still > have a weird issue with Ubuntu 7.10 that crashes sometimes with the > error: > > kvm_run: failed entry, reason 5 > kvm_run returned -8 > > It's a little bit strange because this error appears very often with > the wmii window manager but never with XFCE. And with wmii, it only > occurs when I move the mouse above the Qemu/KVM window. If I wait 30s > until the automatic boot it works... > > So to give a summary, on my box: > > OpensSuse 10.3 -> OK > WinXP Pro X64 -> OK > FreeDOS -> OK > Ubuntu 7.10 -> NOK > > Regards, > Guillaume > On Wed, May 14, 2008 at 10:29 AM, Guillaume Thouvenin <gui...@ex...> wrote: > On Tue, 6 May 2008 20:05:39 +0300 > "Mohammed Gamal" <m.g...@gm...> wrote: > > >> > > > WinXP fails with the patch applied too. Ubuntu 7.10 live CD and >> > > > FreeDOS don't boot but complain about instruction mov 0x11,sreg not >> > > > being emulated. > > Mohammed, can you try the patch at the end of this mail? Here it's > working with FreeDOS now (I added the emulation of 0x90 that is an xchg > instruction). I can also boot winXP Professional X64 edition. I still > have a weird issue with Ubuntu 7.10 that crashes sometimes with the > error: > > kvm_run: failed entry, reason 5 > kvm_run returned -8 > > It's a little bit strange because this error appears very often with > the wmii window manager but never with XFCE. And with wmii, it only > occurs when I move the mouse above the Qemu/KVM window. If I wait 30s > until the automatic boot it works... > > So to give a summary, on my box: > > OpensSuse 10.3 -> OK > WinXP Pro X64 -> OK > FreeDOS -> OK > Ubuntu 7.10 -> NOK > > Regards, > Guillaume > Hi Guillaume, I still haven't applied the patch you sent now. However I'm using the patch you last sent me (it's attached in case anyone wants to have a look). I'm having the same problem with Ubuntu 7.10 Live CD under GNOME. Regarding WinXP, I'm using 32-bit WinXP Pro and it crashes with this error: unhandled vm exit: 0x21 vcpu_id 0 rax 0000000000000011 rbx 00000000000014fc rcx 000000000000ffff rdx 00000000534d0000 rsi 00000000ffff1d68 rdi 000000000008164f rsp 00000000000014fa rbp 0000000000001522 r8 0000000000000000 r9 0000000000000000 r10 0000000000000000 r11 0000000000000000 r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15 0000000000000000 rip 0000000000000269 rflags 00010006 cs 2000 (00020000/0000ffff p 1 dpl 0 db 0 s 1 type b l 0 g 0 avl 0) ds 22f3 (00022f30/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) es 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 1 type 3 l 0 g 0 avl 0) ss 22f3 (00022f30/0000ffff p 1 dpl 0 db 0 s 1 type 3 l 0 g 0 avl 0) fs 0030 (00000300/0000ffff p 1 dpl 0 db 0 s 1 type 3 l 0 g 0 avl 0) gs 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 1 type 3 l 0 g 0 avl 0) tr 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0) ldt 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 0 type 2 l 0 g 0 avl 0) gdt 17000/3ff idt 17400/7ff cr0 11 cr2 0 cr3 0 cr4 0 cr8 0 efer 0 Aborted and dmesg outputs this: emulation failed (vmentry failure) rip 269 68 6d 02 cb The output is the same on every run. I'll give this patch (and Marcello's) a try and report on what happens. |
From: Michael L. (mlilie) <ml...@ci...> - 2008-05-15 18:13:27
|
Running iperf with 100 connections crashes with the new virtio driver. The same setup works with e1000. BSOD data: DRIVER_IRQL_NOT_LESS_OR_EQUAL *** STOP: 0x000000D1 (0x0000001C, 0x00000002, 0x00000000, 0xF86FFE03) *** kvmnet.sys - Address F86FFE03 base at F86FF000, DateStamp 4827fdde remote iperf: iperf -c 2.43.181.131 -p 18332 -P 100 -t 10 guest iperf: iperf -s -p 18332 kvm-68, kvm-guest-drivers-windows-2 Guest: Win2003 enterprise, SP1 Host: 2.6.23 x86_64 Qemu cmdline: -pidfile /var/run/vb1.pid -daemonize -boot c -m 512 -name 'VB-05-1 w2k3' -cdrom /local/local1/vbs/w2k3.iso -net nic,vlan=0,macaddr=00:16:3E:D0:6C:45,model=virtio -net tap,vlan=0,ifname=vblade10,script=/tmp/vblade10 -drive index=0,if=ide,file=/vbspace/vb1-disk0 -cpu qemu64 -vnc :1 -S -monitor pty &>/var/run/vb1.qemu |
From: Christoph L. <cla...@sg...> - 2008-05-15 17:34:18
|
On Thu, 15 May 2008, Nick Piggin wrote: > Oh, I get that confused because of the mixed up naming conventions > there: unmap_page_range should actually be called zap_page_range. But > at any rate, yes we can easily zap pagetables without holding mmap_sem. How is that synchronized with code that walks the same pagetable. These walks may not hold mmap_sem either. I would expect that one could only remove a portion of the pagetable where we have some sort of guarantee that no accesses occur. So the removal of the vma prior ensures that? |
From: Bernd S. <bs...@q-...> - 2008-05-15 16:48:00
|
On Thursday 15 May 2008 12:54:46 Avi Kivity wrote: > Bernd Schubert wrote: > > On Thursday 15 May 2008 09:36:41 Avi Kivity wrote: > >> Bernd Schubert wrote: > >>> Hello, > >>> > >>> there is a problem booting 2.6.26-rcX (X=1,2). It stops booting at > >>> > >>> Calibrating delay using timer specific routine.. 4016.92 BogoMIPS > >>> (lpj=8033846) > >>> > >>> The kvm process then takes 100% of my host CPU. > >>> > >>> This is with kvm-67 on an AM64-X2- > >>> > >>> I'm not yet familiar with kvm and debugging. Will a sysrq+t trace of > >>> the host show something useful? Or will only full git-bisect help? > >> > >> Do you have CONFIG_KVM_GUEST or CONFIG_KVM_CLOCK in your config? If so, > >> this may be a paravirt problem. Try turning them off and let us know. > > > > Thanks, I had both options enabled. Disabling these makes the > > Can you check which one causes the trouble? Most likely it's the clock. It is CONFIG_KVM_GUEST, with CONFIG_KVM_CLOCK=y is boots fine! Thanks, Bernd -- Bernd Schubert Q-Leap Networks GmbH |
From: Ryan H. <ry...@us...> - 2008-05-15 16:27:24
|
* Chris Wright <ch...@so...> [2008-05-15 02:01]: > * Anthony Liguori (an...@co...) wrote: > > From a quick look, I suspect that the number of wildly off TSC > > calibrations correspond to the VMs that are misbehaving. I think this > > may mean that we have to re-examine the tsc delta computation. > > > > 10_serial.log:time.c: Detected 1995.038 MHz processor. > > 11_serial.log:time.c: Detected 2363.195 MHz processor. > > 12_serial.log:time.c: Detected 2492.675 MHz processor. > > 13_serial.log:time.c: Detected 1995.061 MHz processor. > > 14_serial.log:time.c: Detected 1994.917 MHz processor. > > 15_serial.log:time.c: Detected 4100.735 MHz processor. > > 16_serial.log:time.c: Detected 2075.800 MHz processor. > > 17_serial.log:time.c: Detected 2674.350 MHz processor. > > 18_serial.log:time.c: Detected 1995.002 MHz processor. > > 19_serial.log:time.c: Detected 1994.978 MHz processor. > > 1_serial.log:time.c: Detected 4384.310 MHz processor. > > Is this with pinning? We at least know we're losing small bits on > migration. From my measurements it's ~3000 (outliers are 10-20k). > > Also, what happens if you roll back to kvm-userspace 7f5c4d15ece5? I'll try that next. > > I'm using this: > On tip, using the patch, I still see hosed guests and tons of apic round robin output, but the tsc calc seems to have stablized: /tmp/10_serial.log:time.c: Detected 1995.018 MHz processor. /tmp/11_serial.log:time.c: Detected 1995.009 MHz processor. /tmp/12_serial.log:time.c: Detected 1995.012 MHz processor. /tmp/13_serial.log:time.c: Detected 1995.013 MHz processor. /tmp/14_serial.log:time.c: Detected 1995.016 MHz processor. /tmp/15_serial.log:time.c: Detected 1995.020 MHz processor. /tmp/16_serial.log:time.c: Detected 1995.020 MHz processor. /tmp/18_serial.log:time.c: Detected 1995.020 MHz processor. /tmp/19_serial.log:time.c: Detected 1995.023 MHz processor. /tmp/1_serial.log:time.c: Detected 1995.008 MHz processor. /tmp/20_serial.log:time.c: Detected 1995.011 MHz processor. /tmp/21_serial.log:time.c: Detected 1995.016 MHz processor. /tmp/22_serial.log:time.c: Detected 1995.016 MHz processor. /tmp/23_serial.log:time.c: Detected 1995.013 MHz processor. /tmp/24_serial.log:time.c: Detected 1995.018 MHz processor. /tmp/25_serial.log:time.c: Detected 1995.030 MHz processor. /tmp/26_serial.log:time.c: Detected 1995.021 MHz processor. /tmp/27_serial.log:time.c: Detected 1995.026 MHz processor. /tmp/28_serial.log:time.c: Detected 1995.016 MHz processor. /tmp/29_serial.log:time.c: Detected 1995.012 MHz processor. /tmp/2_serial.log:time.c: Detected 1995.020 MHz processor. /tmp/30_serial.log:time.c: Detected 1995.021 MHz processor. /tmp/31_serial.log:time.c: Detected 1995.021 MHz processor. /tmp/32_serial.log:time.c: Detected 1995.008 MHz processor. /tmp/33_serial.log:time.c: Detected 1995.015 MHz processor. /tmp/34_serial.log:time.c: Detected 1995.018 MHz processor. /tmp/35_serial.log:time.c: Detected 1995.017 MHz processor. /tmp/36_serial.log:time.c: Detected 1995.013 MHz processor. /tmp/37_serial.log:time.c: Detected 1995.003 MHz processor. /tmp/38_serial.log:time.c: Detected 1995.036 MHz processor. /tmp/39_serial.log:time.c: Detected 1995.020 MHz processor. /tmp/3_serial.log:time.c: Detected 1995.017 MHz processor. /tmp/40_serial.log:time.c: Detected 1994.998 MHz processor. /tmp/41_serial.log:time.c: Detected 1995.015 MHz processor. /tmp/43_serial.log:time.c: Detected 1995.007 MHz processor. /tmp/44_serial.log:time.c: Detected 1995.029 MHz processor. /tmp/45_serial.log:time.c: Detected 1995.009 MHz processor. /tmp/46_serial.log:time.c: Detected 1995.025 MHz processor. /tmp/47_serial.log:time.c: Detected 1995.019 MHz processor. /tmp/48_serial.log:time.c: Detected 1995.013 MHz processor. /tmp/4_serial.log:time.c: Detected 1995.024 MHz processor. /tmp/5_serial.log:time.c: Detected 1995.016 MHz processor. /tmp/6_serial.log:time.c: Detected 1995.023 MHz processor. /tmp/7_serial.log:time.c: Detected 1995.036 MHz processor. /tmp/8_serial.log:time.c: Detected 1995.013 MHz processor. /tmp/9_serial.log:time.c: Detected 1995.014 MHz processor. -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ry...@us... |
From: Bernd S. <bs...@q-...> - 2008-05-15 16:24:49
|
Hello, with 2.6.26-rc2 (git-something from the weekend) I get a NULL pointer dereference: (gdb) l *(start_xmit+0x48/0x12e) 0xffffffff80413752 is in start_xmit (drivers/net/virtio_net.c:282). 277 278 return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb); 279 } 280 281 static int start_xmit(struct sk_buff *skb, struct net_device *dev) 282 { 283 struct virtnet_info *vi = netdev_priv(dev); 284 285 again: 286 /* Free up any pending old buffers before queueing new ones. */ [17180705.299138] Loglevel set to 9 [17180730.942144] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 [17180730.943115] IP: [<ffffffff8041379a>] start_xmit+0x48/0x12e [17180730.943115] PGD 11d54067 PUD 11d55067 PMD 0 [17180730.943115] Oops: 0002 [1] SMP [17180730.943115] CPU 0 [17180730.943115] Modules linked in: rtc psmouse i2c_piix4 i2c_core [17180730.943115] Pid: 2552, comm: iperf Not tainted 2.6.26-rc2 #12 [17180730.943115] RIP: 0010:[<ffffffff8041379a>] [<ffffffff8041379a>] start_xmit+0x48/0x12e [17180730.943115] RSP: 0018:ffff8100117939e8 EFLAGS: 00010202 [17180730.943115] RAX: ffff810011d5bcc0 RBX: ffff810011dc3880 RCX: ffff810011dc7000 [17180730.943115] RDX: 0000000000000000 RSI: ffff8100117939fc RDI: ffff8100117bddc0 [17180730.943115] RBP: ffff810011793a28 R08: ffff8100117939a8 R09: 0000000000000002 [17180730.943115] R10: 00000000a43eb07b R11: ffff810011dc3318 R12: ffff810011dc3000 [17180730.943115] R13: ffff810011d5b940 R14: ffff810011dc3928 R15: ffff8100117939fc [17180730.943115] FS: 0000000040d89960(0063) GS:ffffffff806c0000(0000) knlGS:0000000000000000 [17180730.943115] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [17180730.943115] CR2: 0000000000000008 CR3: 0000000011deb000 CR4: 00000000000006e0 [17180730.943115] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [17180730.943115] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [17180730.943115] Process iperf (pid: 2552, threadinfo ffff810011792000, task ffff8100117be280) [17180730.943115] Stack: ffff810011793a38 ffff810011dc3318 000005f400000246 0000000000000000 [17180730.943115] ffff810011d5b940 ffff810011d5b940 ffff810011dc3000 ffff810011dc3300 [17180730.943115] ffff810011793a58 ffffffff80480778 0000000000000000 ffff810011dc3000 [17180730.943115] Call Trace: [17180730.943115] [<ffffffff80480778>] dev_hard_start_xmit+0x205/0x279 [17180730.943115] [<ffffffff8048e0cb>] __qdisc_run+0xcf/0x1d3 [17180730.943115] [<ffffffff80482e43>] dev_queue_xmit+0x15f/0x2c8 [17180730.943115] [<ffffffff8049a61c>] ip_finish_output+0x1ed/0x22f [17180730.943115] [<ffffffff8049a91c>] ip_output+0x52/0x54 [17180730.943115] [<ffffffff80499128>] ip_local_out+0x20/0x24 [17180730.943115] [<ffffffff8049ad2f>] ip_queue_xmit+0x2a5/0x2fa [17180730.943115] [<ffffffff80265441>] ? mark_held_locks+0x59/0x75 [17180730.943115] [<ffffffff8029a714>] ? kmem_cache_alloc_node+0x150/0x185 [17180730.943115] [<ffffffff80265606>] ? trace_hardirqs_on+0xff/0x12a [17180730.943115] [<ffffffff804aa8d7>] tcp_transmit_skb+0x6b7/0x6ea [17180730.943115] [<ffffffff8029a76d>] ? __kmalloc_node+0x24/0x29 [17180730.943115] [<ffffffff804ac7fa>] tcp_push_one+0xa7/0xc7 [17180730.943115] [<ffffffff804a14c7>] tcp_sendmsg+0x7d3/0xa5e [17180730.943115] [<ffffffff8025c036>] ? hrtimer_start+0x118/0x13a [17180730.943115] [<ffffffff8025c036>] ? hrtimer_start+0x118/0x13a [17180730.943115] [<ffffffff804749df>] sock_aio_write+0xe2/0xf2 [17180730.943115] [<ffffffff802a015c>] do_sync_write+0xeb/0x132 [17180730.943115] [<ffffffff802592f8>] ? autoremove_wake_function+0x0/0x38 [17180730.943115] [<ffffffff80224a11>] ? native_sched_clock+0x68/0x8f [17180730.943115] [<ffffffff802a1655>] ? fget_light+0xc0/0xe6 [17180730.943115] [<ffffffff80224929>] ? sched_clock+0x9/0xc [17180730.943115] [<ffffffff802a1655>] ? fget_light+0xc0/0xe6 [17180730.943115] [<ffffffff802a0907>] vfs_write+0xc1/0x137 [17180730.943115] [<ffffffff802a0e5d>] sys_write+0x47/0x70 [17180730.943115] [<ffffffff8021dd6a>] system_call_after_swapgs+0x8a/0x8f [17180730.943115] [17180730.943115] [17180730.943115] Code: 9e 40 03 00 00 4c 8d b3 a8 00 00 00 eb 3f 41 ff 4e 10 48 8b 17 48 8b 47 08 48 c7 07 00 00 00 00 48 c7 47 08 00 00 00 00 48 89 10 <48> 89 42 08 48 8b 53 18 8b 47 68 48 01 82 98 00 00 00 48 8b 43 [17180730.943115] RIP [<ffffffff8041379a>] start_xmit+0x48/0x12e [17180730.943115] RSP <ffff8100117939e8> [17180730.943115] CR2: 0000000000000008 [17180731.066868] ---[ end trace deb46891ec66565a ]--- [17180731.070868] Kernel panic - not syncing: Aiee, killing interrupt handler! Thanks, Bernd |
From: Anthony L. <an...@co...> - 2008-05-15 15:43:51
|
Avi Kivity wrote: > Anthony Liguori wrote: >> Avi Kivity wrote: >>> Anthony Liguori wrote: >>>> FWIW, virtio-net is much better with my patches applied. >>> >>> The can_receive patches? >>> >>> Again, I'm not opposed to them in principle, I just think that if >>> they help that this points at a virtio deficiency. Virtio should >>> never leave the rx queue empty. Consider the case where the virtio >>> queue isn't tied to a socket buffer, but directly to hardware. >> >> For RX performance: >> >> >> right now >> [ 3] 0.0-10.0 sec 1016 MBytes 852 Mbits/sec >> >> revert tap hack >> [ 3] 0.0-10.0 sec 564 MBytes 473 Mbits/sec >> >> all patches applied >> [ 3] 0.0-10.0 sec 1.17 GBytes 1.01 Gbits/sec >> >> drop lots of packets >> [ 3] 0.0-10.0 sec 1.05 GBytes 905 Mbits/sec >> >> >> The last patch is not in my series but it basically makes the ring >> size 512 and drops packets when we run out of descriptors. That was >> to valid that we're not hiding a virtio deficiency. The reason I >> want to buffer packets is that it avoids having to deal with >> tuning. For vringfd/vmdq, we'll have to make sure to get the tuning >> right though. > > Okay; I'll apply the patches. Hopefully we won't diverge too much > from upstream qemu. I am going to push these upstream. I need to finish the page_desc cache first b/c right now the version of virtio that could go into upstream QEMU has unacceptable performance for KVM. Regards, Anthony Liguori |
From: Avi K. <av...@qu...> - 2008-05-15 15:30:31
|
Anthony Liguori wrote: > Avi Kivity wrote: >> Anthony Liguori wrote: >>> FWIW, virtio-net is much better with my patches applied. >> >> The can_receive patches? >> >> Again, I'm not opposed to them in principle, I just think that if >> they help that this points at a virtio deficiency. Virtio should >> never leave the rx queue empty. Consider the case where the virtio >> queue isn't tied to a socket buffer, but directly to hardware. > > For RX performance: > > > right now > [ 3] 0.0-10.0 sec 1016 MBytes 852 Mbits/sec > > revert tap hack > [ 3] 0.0-10.0 sec 564 MBytes 473 Mbits/sec > > all patches applied > [ 3] 0.0-10.0 sec 1.17 GBytes 1.01 Gbits/sec > > drop lots of packets > [ 3] 0.0-10.0 sec 1.05 GBytes 905 Mbits/sec > > > The last patch is not in my series but it basically makes the ring > size 512 and drops packets when we run out of descriptors. That was > to valid that we're not hiding a virtio deficiency. The reason I want > to buffer packets is that it avoids having to deal with tuning. For > vringfd/vmdq, we'll have to make sure to get the tuning right though. Okay; I'll apply the patches. Hopefully we won't diverge too much from upstream qemu. -- error compiling committee.c: too many arguments to function |
From: Paul B. <pa...@co...> - 2008-05-15 14:59:55
|
> Why not just bypass the whole config file idea and just use enviornment > variables? Absolutely not. Environment variables are a horrid way of configuring things. Paul |
From: Ian J. <Ian...@eu...> - 2008-05-15 14:59:15
|
andrzej zaborowski writes ("Re: [Qemu-devel] Re: [PATCH] Add support for a configuration file"): > What I'd love, though, but expect others will consider bloat, is that > files are passed through cpp before interpreting. cpp is a terrible preprocessor. It mostly works for C source code (although it has some serious deficiences there - for example, that you can't have macros that generate macros). But for anything whose lexical structure is not much like C it causes terrible trouble - randomly inserting spaces, need for explicit token pasting (dependent on the C operator set), etc. It breaks even something as simple as #-comments, which are obviously what we would want in our plain text config file. If you really want a preprocessor, use m4 (one that supports -p and using a suitable m4_changequote). m4 isn't particularly pretty but it doesn't interfere with the core of the syntax. Better, make the configuration defaults sufficiently good that it is not necessary to reproduce lots of boilerplate to get things done. Then macros aren't needed for human-written files - and of course program-written config files can don't need a macro system anyway. Ian. |
From: Glauber C. <gc...@re...> - 2008-05-15 14:10:37
|
this is for the case in which we run more than one cpu --- kqemu.c | 3 ++- vl.c | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/kqemu.c b/kqemu.c index 6d46dfb..94366ec 100644 --- a/kqemu.c +++ b/kqemu.c @@ -164,6 +164,7 @@ static void kqemu_update_cpuid(CPUState *env) } QEMUAccel kqemu_accel; +extern int smp_cpus; int kqemu_start(void) { @@ -173,7 +174,7 @@ int kqemu_start(void) DWORD temp; #endif - if (!kqemu_allowed) + if (!kqemu_allowed || smp_cpus > 1) return -1; #ifdef _WIN32 diff --git a/vl.c b/vl.c index 26c1677..8104e33 100644 --- a/vl.c +++ b/vl.c @@ -8357,10 +8357,6 @@ int main(int argc, char **argv) exit(1); } -#ifdef USE_KQEMU - if (smp_cpus > 1) - kqemu_allowed = 0; -#endif linux_boot = (kernel_filename != NULL); net_boot = (boot_devices_bitmap >> ('n' - 'a')) & 0xF; -- 1.5.5 |
From: Glauber C. <gc...@re...> - 2008-05-15 14:10:32
|
instead of hardcoding kqemu_start() in exec.c, which would require such a hack for all available accelerators, semantics of register_qemu_accel() is changed a little bit. It only builds a list of available accelerators. The last one registered is the first tried. This is a temporary solution, since we don't control exactly the order in which things are loaded by the constructor attributes. The final goal is to have command line switches and priority lists to determine that. "info accelerator" is changed to accomodate it. It now prints a list of available accelerators, and only if one of them is active, a detailed description of it is printed. --- exec-all.h | 43 +++++++++++++++++++++++++++++++++++++++++-- exec.c | 4 +--- kqemu.c | 11 +++++++++-- monitor.c | 18 ++++++++++++++++-- vl.c | 1 + 5 files changed, 68 insertions(+), 9 deletions(-) diff --git a/exec-all.h b/exec-all.h index f62ff38..eca5cdb 100644 --- a/exec-all.h +++ b/exec-all.h @@ -579,8 +579,10 @@ static inline target_ulong get_phys_addr_code(CPUState *env1, target_ulong addr) #endif typedef struct QEMUAccel { + char *name; void (*cpu_interrupt)(CPUState *env); void (*init_env)(CPUState *env); + int (*start)(void); void (*flush_cache)(CPUState *env, int global); void (*flush_page)(CPUState *env, target_ulong addr); int (*info)(CPUState *env, char *buf); @@ -590,11 +592,33 @@ typedef struct QEMUAccel { uint64_t (*get_real_ticks)(void); } QEMUAccel; +typedef struct QEMUCont { + QEMUAccel *acc; + int active; + struct QEMUCont *next; +} QEMUCont; + extern QEMUAccel *current_accel; +extern QEMUCont *head; +void *qemu_mallocz(size_t size); + +static inline int register_qemu_accel(QEMUAccel *accel) +{ + QEMUCont *new; + + new = qemu_mallocz(sizeof(*head)); + + new->acc = accel; + new->active = 0; + new->next = head; + head = new; + + return 0; +} -static inline void register_qemu_accel(QEMUAccel *accel) +static inline QEMUCont *get_accel_head(void) { - current_accel = accel; + return head; } static inline void accel_cpu_interrupt(CPUState *env) @@ -603,6 +627,21 @@ static inline void accel_cpu_interrupt(CPUState *env) current_accel->cpu_interrupt(env); } +static inline void accel_start(void) +{ + /* The top accelerator in the list gets tried first, but if it fails, + * keep trying until one of them succeeds or we exhaust the list */ + QEMUCont *tmp = head; + while (tmp) { + if (tmp->acc && tmp->acc->start && (!(tmp->acc->start())) ) { + tmp->active = 1; + current_accel = tmp->acc; + break; + } + tmp = tmp->next; + } +} + static inline void accel_init_env(CPUState *env) { if (current_accel && current_accel->init_env) diff --git a/exec.c b/exec.c index 92f1552..c885f7d 100644 --- a/exec.c +++ b/exec.c @@ -334,9 +334,7 @@ void exec_init(void) code_gen_ptr = code_gen_buffer; page_init(); io_mem_init(); -#ifdef USE_KQEMU - kqemu_start(); -#endif + accel_start(); } void cpu_exec_init(CPUState *env) diff --git a/kqemu.c b/kqemu.c index fbd8b66..996538d 100644 --- a/kqemu.c +++ b/kqemu.c @@ -163,7 +163,6 @@ static void kqemu_update_cpuid(CPUState *env) accelerated code */ } -QEMUAccel kqemu_accel; extern int smp_cpus; int kqemu_start(void) @@ -247,7 +246,6 @@ int kqemu_start(void) } nb_pages_to_flush = 0; nb_ram_pages_to_update = 0; - register_qemu_accel(&kqemu_accel); return 0; } @@ -404,8 +402,10 @@ void kqemu_modify_page(ram_addr_t ram_addr, int dirty_flags) } QEMUAccel kqemu_accel = { + .name = "kqemu", .cpu_interrupt = kqemu_cpu_interrupt, .init_env = kqemu_init_env, + .start = kqemu_start, .flush_cache = kqemu_flush, .flush_page = kqemu_flush_page, .info = kqemu_info, @@ -418,6 +418,13 @@ QEMUAccel kqemu_accel = { .get_real_ticks = cpu_get_real_ticks, }; +static void __attribute__((constructor)) register_kqemu(void) +{ + if (register_qemu_accel(&kqemu_accel) < 0) + fprintf(logfile, "kqemu: could not register accelerator \n"); +} + + struct fpstate { uint16_t fpuc; diff --git a/monitor.c b/monitor.c index 2ee5b0c..49efa2d 100644 --- a/monitor.c +++ b/monitor.c @@ -1166,6 +1166,18 @@ static void mem_info(void) } #endif +static int do_accel_do_list(void) +{ + QEMUCont *tmp; + int active = 0; + for (tmp= get_accel_head(); tmp != NULL; tmp = tmp->next) + { + term_printf("%c %s\n", tmp->active ? '*' : ' ', tmp->acc->name); + active |= tmp->active; + } + return active; +} + #define MAX_BUF 1024 static void do_info_accelerator(void) { @@ -1179,8 +1191,10 @@ static void do_info_accelerator(void) return; } - if (accel_info(env, buf)) - term_printf(buf); + if (do_accel_do_list()) { + if (accel_info(env, buf)) + term_printf(buf); + } else term_printf("No accelerator present\n"); } diff --git a/vl.c b/vl.c index 8104e33..cd9af69 100644 --- a/vl.c +++ b/vl.c @@ -240,6 +240,7 @@ static CPUState *cur_cpu; static CPUState *next_cpu; static int event_pending = 1; QEMUAccel *current_accel; +QEMUCont *head = NULL; #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) -- 1.5.5 |
From: Glauber C. <gc...@re...> - 2008-05-15 14:10:31
|
Instead, route cpu_get_ticks through accel driver. --- exec-all.h | 11 +++++++++++ hw/pc.c | 13 ++----------- kqemu.c | 4 ++++ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/exec-all.h b/exec-all.h index 04112e0..f62ff38 100644 --- a/exec-all.h +++ b/exec-all.h @@ -587,6 +587,7 @@ typedef struct QEMUAccel { int (*profile)(CPUState *env, char *buf); void (*set_notdirty)(ram_addr_t addr); void (*modify_page)(ram_addr_t addr, int dirty_flags); + uint64_t (*get_real_ticks)(void); } QEMUAccel; extern QEMUAccel *current_accel; @@ -646,6 +647,16 @@ static inline void accel_modify_page(target_ulong addr, int dirty_flags) current_accel->modify_page(addr, dirty_flags); } +int64_t cpu_get_ticks(void); + +static inline uint64_t accel_get_real_ticks(void) +{ + if (current_accel && current_accel->get_real_ticks) + return current_accel->get_real_ticks(); + return cpu_get_ticks(); +} + + #ifdef USE_KQEMU #define KQEMU_MODIFY_PAGE_MASK (0xff & ~(VGA_DIRTY_FLAG | CODE_DIRTY_FLAG)) diff --git a/hw/pc.c b/hw/pc.c index c92384c..43ff2f2 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -32,6 +32,7 @@ #include "smbus.h" #include "boards.h" #include "console.h" +#include "exec-all.h" /* output Bochs bios info messages */ //#define DEBUG_BIOS @@ -73,17 +74,7 @@ static void ioportF0_write(void *opaque, uint32_t addr, uint32_t data) /* TSC handling */ uint64_t cpu_get_tsc(CPUX86State *env) { - /* Note: when using kqemu, it is more logical to return the host TSC - because kqemu does not trap the RDTSC instruction for - performance reasons */ -#if USE_KQEMU - if (env->kqemu_enabled) { - return cpu_get_real_ticks(); - } else -#endif - { - return cpu_get_ticks(); - } + return accel_get_real_ticks(); } /* SMM support */ diff --git a/kqemu.c b/kqemu.c index 7e24bb7..fbd8b66 100644 --- a/kqemu.c +++ b/kqemu.c @@ -412,6 +412,10 @@ QEMUAccel kqemu_accel = { .profile = kqemu_profile, .set_notdirty = kqemu_set_notdirty, .modify_page = kqemu_modify_page, + /* Note: when using kqemu, it is more logical to return the host TSC + because kqemu does not trap the RDTSC instruction for + performance reasons */ + .get_real_ticks = cpu_get_real_ticks, }; -- 1.5.5 |
From: Glauber C. <gc...@re...> - 2008-05-15 14:10:31
|
--- exec-all.h | 16 ++++++++++++++-- exec.c | 12 ++---------- kqemu.c | 15 +++++++++------ 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/exec-all.h b/exec-all.h index 9e211dc..bfc6576 100644 --- a/exec-all.h +++ b/exec-all.h @@ -581,6 +581,8 @@ static inline target_ulong get_phys_addr_code(CPUState *env1, target_ulong addr) typedef struct QEMUAccel { void (*cpu_interrupt)(CPUState *env); void (*init_env)(CPUState *env); + void (*flush_cache)(CPUState *env, int global); + void (*flush_page)(CPUState *env, target_ulong addr); } QEMUAccel; extern QEMUAccel *current_accel; @@ -602,12 +604,22 @@ static inline void accel_init_env(CPUState *env) current_accel->init_env(env); } +static inline void accel_flush_cache(CPUState *env, int global) +{ + if (current_accel && current_accel->flush_cache) + current_accel->flush_cache(env, global); +} + +static inline void accel_flush_page(CPUState *env, target_ulong addr) +{ + if (current_accel && current_accel->flush_page) + current_accel->flush_page(env, addr); +} + #ifdef USE_KQEMU #define KQEMU_MODIFY_PAGE_MASK (0xff & ~(VGA_DIRTY_FLAG | CODE_DIRTY_FLAG)) int kqemu_cpu_exec(CPUState *env); -void kqemu_flush_page(CPUState *env, target_ulong addr); -void kqemu_flush(CPUState *env, int global); void kqemu_set_notdirty(CPUState *env, ram_addr_t ram_addr); void kqemu_modify_page(CPUState *env, ram_addr_t ram_addr); void kqemu_record_dump(void); diff --git a/exec.c b/exec.c index 73360d3..5b093a3 100644 --- a/exec.c +++ b/exec.c @@ -1438,11 +1438,7 @@ void tlb_flush(CPUState *env, int flush_global) #if !defined(CONFIG_SOFTMMU) munmap((void *)MMAP_AREA_START, MMAP_AREA_END - MMAP_AREA_START); #endif -#ifdef USE_KQEMU - if (env->kqemu_enabled) { - kqemu_flush(env, flush_global); - } -#endif + accel_flush_cache(env, flush_global); tlb_flush_count++; } @@ -1488,11 +1484,7 @@ void tlb_flush_page(CPUState *env, target_ulong addr) if (addr < MMAP_AREA_END) munmap((void *)addr, TARGET_PAGE_SIZE); #endif -#ifdef USE_KQEMU - if (env->kqemu_enabled) { - kqemu_flush_page(env, addr); - } -#endif + accel_flush_page(env, addr); } /* update the TLBs so that writes to code in the virtual page 'addr' diff --git a/kqemu.c b/kqemu.c index e0422de..524c74d 100644 --- a/kqemu.c +++ b/kqemu.c @@ -261,12 +261,6 @@ void kqemu_cpu_interrupt(CPUState *env) #endif } -QEMUAccel kqemu_accel = { - .cpu_interrupt = kqemu_cpu_interrupt, - .init_env = kqemu_init_env, -}; - - void kqemu_flush_page(CPUState *env, target_ulong addr) { #if defined(DEBUG) @@ -290,6 +284,15 @@ void kqemu_flush(CPUState *env, int global) nb_pages_to_flush = KQEMU_FLUSH_ALL; } +QEMUAccel kqemu_accel = { + .cpu_interrupt = kqemu_cpu_interrupt, + .init_env = kqemu_init_env, + .flush_cache = kqemu_flush, + .flush_page = kqemu_flush_page, +}; + + + void kqemu_set_notdirty(CPUState *env, ram_addr_t ram_addr) { #ifdef DEBUG -- 1.5.5 |
From: Glauber C. <gc...@re...> - 2008-05-15 14:10:28
|
--- exec-all.h | 8 +++++++- exec.c | 18 +++++++----------- kqemu.c | 23 +++++++++++------------ 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/exec-all.h b/exec-all.h index 689973d..ed96a22 100644 --- a/exec-all.h +++ b/exec-all.h @@ -585,6 +585,7 @@ typedef struct QEMUAccel { void (*flush_page)(CPUState *env, target_ulong addr); int (*info)(CPUState *env, char *buf); int (*profile)(CPUState *env, char *buf); + void (*set_notdirty)(ram_addr_t addr); } QEMUAccel; extern QEMUAccel *current_accel; @@ -632,11 +633,16 @@ static inline int accel_profile(CPUState *env, char *buf) return 0; } +static inline void accel_set_notdirty(target_ulong addr) +{ + if (current_accel && current_accel->set_notdirty) + current_accel->set_notdirty(addr); +} + #ifdef USE_KQEMU #define KQEMU_MODIFY_PAGE_MASK (0xff & ~(VGA_DIRTY_FLAG | CODE_DIRTY_FLAG)) int kqemu_cpu_exec(CPUState *env); -void kqemu_set_notdirty(CPUState *env, ram_addr_t ram_addr); void kqemu_modify_page(CPUState *env, ram_addr_t ram_addr); void kqemu_record_dump(void); diff --git a/exec.c b/exec.c index 5b093a3..6d05f75 100644 --- a/exec.c +++ b/exec.c @@ -1531,18 +1531,14 @@ void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end, if (length == 0) return; len = length >> TARGET_PAGE_BITS; -#ifdef USE_KQEMU - /* XXX: should not depend on cpu context */ - env = first_cpu; - if (env->kqemu_enabled) { - ram_addr_t addr; - addr = start; - for(i = 0; i < len; i++) { - kqemu_set_notdirty(env, addr); - addr += TARGET_PAGE_SIZE; - } + + ram_addr_t addr; + addr = start; + for(i = 0; i < len; i++) { + accel_set_notdirty(addr); + addr += TARGET_PAGE_SIZE; } -#endif + mask = ~dirty_flags; p = phys_ram_dirty + (start >> TARGET_PAGE_BITS); for(i = 0; i < len; i++) diff --git a/kqemu.c b/kqemu.c index 94366ec..44c1a55 100644 --- a/kqemu.c +++ b/kqemu.c @@ -342,18 +342,7 @@ int kqemu_profile(CPUState *env, char *buf) return len; } -QEMUAccel kqemu_accel = { - .cpu_interrupt = kqemu_cpu_interrupt, - .init_env = kqemu_init_env, - .flush_cache = kqemu_flush, - .flush_page = kqemu_flush_page, - .info = kqemu_info, - .profile = kqemu_profile, -}; - - - -void kqemu_set_notdirty(CPUState *env, ram_addr_t ram_addr) +void kqemu_set_notdirty(ram_addr_t ram_addr) { #ifdef DEBUG if (loglevel & CPU_LOG_INT) { @@ -369,6 +358,16 @@ void kqemu_set_notdirty(CPUState *env, ram_addr_t ram_addr) ram_pages_to_update[nb_ram_pages_to_update++] = ram_addr; } +QEMUAccel kqemu_accel = { + .cpu_interrupt = kqemu_cpu_interrupt, + .init_env = kqemu_init_env, + .flush_cache = kqemu_flush, + .flush_page = kqemu_flush_page, + .info = kqemu_info, + .profile = kqemu_profile, + .set_notdirty = kqemu_set_notdirty, +}; + static void kqemu_reset_modified_ram_pages(void) { int i; -- 1.5.5 |
From: Glauber C. <gc...@re...> - 2008-05-15 14:10:24
|
--- exec-all.h | 8 ++++++++ kqemu.c | 24 ++++++++++++++++++++++++ monitor.c | 36 +++++++++++++----------------------- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/exec-all.h b/exec-all.h index bfc6576..f1bd7ae 100644 --- a/exec-all.h +++ b/exec-all.h @@ -583,6 +583,7 @@ typedef struct QEMUAccel { void (*init_env)(CPUState *env); void (*flush_cache)(CPUState *env, int global); void (*flush_page)(CPUState *env, target_ulong addr); + int (*info)(CPUState *env, char *buf); } QEMUAccel; extern QEMUAccel *current_accel; @@ -616,6 +617,13 @@ static inline void accel_flush_page(CPUState *env, target_ulong addr) current_accel->flush_page(env, addr); } +static inline int accel_info(CPUState *env, char *buf) +{ + if (current_accel && current_accel->info) + return current_accel->info(env, buf); + return 0; +} + #ifdef USE_KQEMU #define KQEMU_MODIFY_PAGE_MASK (0xff & ~(VGA_DIRTY_FLAG | CODE_DIRTY_FLAG)) diff --git a/kqemu.c b/kqemu.c index 524c74d..451d1d4 100644 --- a/kqemu.c +++ b/kqemu.c @@ -284,11 +284,35 @@ void kqemu_flush(CPUState *env, int global) nb_pages_to_flush = KQEMU_FLUSH_ALL; } +int kqemu_info(CPUState *env, char *buf) +{ + int val, len; + val = 0; + val = env->kqemu_enabled; + len = sprintf(buf, "kqemu support: "); + buf += len; + + switch(val) { + default: + len += sprintf(buf, "present, but bogus value\n"); + break; + case 1: + len += sprintf(buf, "enabled for user code\n"); + break; + case 2: + len += sprintf(buf, "enabled for user and kernel code\n"); + break; + } + + return len; +} + QEMUAccel kqemu_accel = { .cpu_interrupt = kqemu_cpu_interrupt, .init_env = kqemu_init_env, .flush_cache = kqemu_flush, .flush_page = kqemu_flush_page, + .info = kqemu_info, }; diff --git a/monitor.c b/monitor.c index 236b827..cb9faef 100644 --- a/monitor.c +++ b/monitor.c @@ -34,6 +34,7 @@ #include "block.h" #include "audio/audio.h" #include "disas.h" +#include "exec-all.h" #include <dirent.h> #ifdef CONFIG_PROFILER @@ -1165,34 +1166,23 @@ static void mem_info(void) } #endif -static void do_info_kqemu(void) +#define MAX_BUF 1024 +static void do_info_accelerator(void) { -#ifdef USE_KQEMU + char buf[MAX_BUF]; CPUState *env; - int val; - val = 0; + env = mon_get_cpu(); + if (!env) { term_printf("No cpu initialized yet"); return; } - val = env->kqemu_enabled; - term_printf("kqemu support: "); - switch(val) { - default: - case 0: - term_printf("disabled\n"); - break; - case 1: - term_printf("enabled for user code\n"); - break; - case 2: - term_printf("enabled for user and kernel code\n"); - break; - } -#else - term_printf("kqemu support: not compiled\n"); -#endif + + if (accel_info(env, buf)) + term_printf(buf); + else + term_printf("No accelerator present\n"); } #ifdef CONFIG_PROFILER @@ -1422,8 +1412,8 @@ static term_cmd_t info_cmds[] = { #endif { "jit", "", do_info_jit, "", "show dynamic compiler info", }, - { "kqemu", "", do_info_kqemu, - "", "show kqemu information", }, + { "accelerator", "", do_info_accelerator, + "", "show accelerator information", }, { "usb", "", usb_info, "", "show guest USB devices", }, { "usbhost", "", usb_host_info, -- 1.5.5 |
From: Glauber C. <gc...@re...> - 2008-05-15 14:10:18
|
--- cpu-all.h | 5 ----- kqemu.h | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cpu-all.h b/cpu-all.h index 7e77f76..5336a29 100644 --- a/cpu-all.h +++ b/cpu-all.h @@ -1053,14 +1053,9 @@ static inline int64_t profile_getclock(void) return cpu_get_real_ticks(); } -extern int64_t kqemu_time, kqemu_time_start; extern int64_t qemu_time, qemu_time_start; extern int64_t tlb_flush_time; -extern int64_t kqemu_exec_count; extern int64_t dev_time; -extern int64_t kqemu_ret_int_count; -extern int64_t kqemu_ret_excp_count; -extern int64_t kqemu_ret_intr_count; extern int64_t dyngen_tb_count1; extern int64_t dyngen_tb_count; diff --git a/kqemu.h b/kqemu.h index 7b43057..88156c1 100644 --- a/kqemu.h +++ b/kqemu.h @@ -26,6 +26,12 @@ #define KQEMU_VERSION 0x010300 +extern int64_t kqemu_time, kqemu_time_start; +extern int64_t kqemu_exec_count; +extern int64_t kqemu_ret_int_count; +extern int64_t kqemu_ret_excp_count; +extern int64_t kqemu_ret_intr_count; + struct kqemu_segment_cache { uint32_t selector; unsigned long base; -- 1.5.5 |
From: Glauber C. <gc...@re...> - 2008-05-15 14:10:18
|
--- exec-all.h | 8 ++++++++ kqemu.c | 35 +++++++++++++++++++++++++++++++++++ monitor.c | 27 ++++++--------------------- 3 files changed, 49 insertions(+), 21 deletions(-) diff --git a/exec-all.h b/exec-all.h index f1bd7ae..689973d 100644 --- a/exec-all.h +++ b/exec-all.h @@ -584,6 +584,7 @@ typedef struct QEMUAccel { void (*flush_cache)(CPUState *env, int global); void (*flush_page)(CPUState *env, target_ulong addr); int (*info)(CPUState *env, char *buf); + int (*profile)(CPUState *env, char *buf); } QEMUAccel; extern QEMUAccel *current_accel; @@ -624,6 +625,13 @@ static inline int accel_info(CPUState *env, char *buf) return 0; } +static inline int accel_profile(CPUState *env, char *buf) +{ + if (current_accel && current_accel->profile) + return current_accel->profile(env, buf); + return 0; +} + #ifdef USE_KQEMU #define KQEMU_MODIFY_PAGE_MASK (0xff & ~(VGA_DIRTY_FLAG | CODE_DIRTY_FLAG)) diff --git a/kqemu.c b/kqemu.c index 451d1d4..6d46dfb 100644 --- a/kqemu.c +++ b/kqemu.c @@ -51,6 +51,10 @@ #include <fcntl.h> #include "kqemu.h" +#ifdef CONFIG_PROFILER +#include "qemu-timer.h" /* for ticks_per_sec */ +#endif + /* compatibility stuff */ #ifndef KQEMU_RET_SYSCALL #define KQEMU_RET_SYSCALL 0x0300 /* syscall insn */ @@ -307,12 +311,43 @@ int kqemu_info(CPUState *env, char *buf) return len; } +int64_t kqemu_time; +int64_t kqemu_exec_count; +int64_t kqemu_ret_int_count; +int64_t kqemu_ret_excp_count; +int64_t kqemu_ret_intr_count; +extern int64_t qemu_time; + +int kqemu_profile(CPUState *env, char *buf) +{ + int len = 0; +#ifdef CONFIG_PROFILER + len = sprintf(buf, "kqemu time %" PRId64 " (%0.3f %0.1f%%) count=%" PRId64 + " int=%" PRId64 " excp=%" PRId64 " intr=%" PRId64 "\n", + kqemu_time, kqemu_time / (double)ticks_per_sec, + kqemu_time / qemu_time * 100.0, + kqemu_exec_count, + kqemu_ret_int_count, + kqemu_ret_excp_count, + kqemu_ret_intr_count); + + kqemu_time = 0; + kqemu_exec_count = 0; + kqemu_ret_int_count = 0; + kqemu_ret_excp_count = 0; + kqemu_ret_intr_count = 0; + kqemu_record_dump(); +#endif + return len; +} + QEMUAccel kqemu_accel = { .cpu_interrupt = kqemu_cpu_interrupt, .init_env = kqemu_init_env, .flush_cache = kqemu_flush, .flush_page = kqemu_flush_page, .info = kqemu_info, + .profile = kqemu_profile, }; diff --git a/monitor.c b/monitor.c index cb9faef..2ee5b0c 100644 --- a/monitor.c +++ b/monitor.c @@ -1187,17 +1187,14 @@ static void do_info_accelerator(void) #ifdef CONFIG_PROFILER -int64_t kqemu_time; int64_t qemu_time; -int64_t kqemu_exec_count; int64_t dev_time; -int64_t kqemu_ret_int_count; -int64_t kqemu_ret_excp_count; -int64_t kqemu_ret_intr_count; - static void do_info_profile(void) { int64_t total; + char buf[MAX_BUF]; + CPUState *env = mon_get_cpu(); + total = qemu_time; if (total == 0) total = 1; @@ -1205,24 +1202,12 @@ static void do_info_profile(void) dev_time, dev_time / (double)ticks_per_sec); term_printf("qemu time %" PRId64 " (%0.3f)\n", qemu_time, qemu_time / (double)ticks_per_sec); - term_printf("kqemu time %" PRId64 " (%0.3f %0.1f%%) count=%" PRId64 " int=%" PRId64 " excp=%" PRId64 " intr=%" PRId64 "\n", - kqemu_time, kqemu_time / (double)ticks_per_sec, - kqemu_time / (double)total * 100.0, - kqemu_exec_count, - kqemu_ret_int_count, - kqemu_ret_excp_count, - kqemu_ret_intr_count); + if (accel_profile(env, buf)) + term_printf(buf); qemu_time = 0; - kqemu_time = 0; - kqemu_exec_count = 0; dev_time = 0; - kqemu_ret_int_count = 0; - kqemu_ret_excp_count = 0; - kqemu_ret_intr_count = 0; -#ifdef USE_KQEMU - kqemu_record_dump(); -#endif } + #else static void do_info_profile(void) { -- 1.5.5 |
From: Glauber C. <gc...@re...> - 2008-05-15 14:10:18
|
--- exec-all.h | 8 +++++++- exec.c | 24 +++++++++--------------- kqemu.c | 26 +++++++++++++++----------- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/exec-all.h b/exec-all.h index ed96a22..04112e0 100644 --- a/exec-all.h +++ b/exec-all.h @@ -586,6 +586,7 @@ typedef struct QEMUAccel { int (*info)(CPUState *env, char *buf); int (*profile)(CPUState *env, char *buf); void (*set_notdirty)(ram_addr_t addr); + void (*modify_page)(ram_addr_t addr, int dirty_flags); } QEMUAccel; extern QEMUAccel *current_accel; @@ -639,11 +640,16 @@ static inline void accel_set_notdirty(target_ulong addr) current_accel->set_notdirty(addr); } +static inline void accel_modify_page(target_ulong addr, int dirty_flags) +{ + if (current_accel && current_accel->modify_page) + current_accel->modify_page(addr, dirty_flags); +} + #ifdef USE_KQEMU #define KQEMU_MODIFY_PAGE_MASK (0xff & ~(VGA_DIRTY_FLAG | CODE_DIRTY_FLAG)) int kqemu_cpu_exec(CPUState *env); -void kqemu_modify_page(CPUState *env, ram_addr_t ram_addr); void kqemu_record_dump(void); static inline int kqemu_is_ok(CPUState *env) diff --git a/exec.c b/exec.c index 6d05f75..92f1552 100644 --- a/exec.c +++ b/exec.c @@ -2185,11 +2185,9 @@ static void notdirty_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t #endif } stb_p((uint8_t *)(long)addr, val); -#ifdef USE_KQEMU - if (cpu_single_env->kqemu_enabled && - (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK) - kqemu_modify_page(cpu_single_env, ram_addr); -#endif + + accel_modify_page(ram_addr, dirty_flags); + dirty_flags |= (0xff & ~CODE_DIRTY_FLAG); phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS] = dirty_flags; /* we remove the notdirty callback only if the code has been @@ -2211,11 +2209,9 @@ static void notdirty_mem_writew(void *opaque, target_phys_addr_t addr, uint32_t #endif } stw_p((uint8_t *)(long)addr, val); -#ifdef USE_KQEMU - if (cpu_single_env->kqemu_enabled && - (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK) - kqemu_modify_page(cpu_single_env, ram_addr); -#endif + + accel_modify_page(ram_addr, dirty_flags); + dirty_flags |= (0xff & ~CODE_DIRTY_FLAG); phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS] = dirty_flags; /* we remove the notdirty callback only if the code has been @@ -2237,11 +2233,9 @@ static void notdirty_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t #endif } stl_p((uint8_t *)(long)addr, val); -#ifdef USE_KQEMU - if (cpu_single_env->kqemu_enabled && - (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK) - kqemu_modify_page(cpu_single_env, ram_addr); -#endif + + accel_modify_page(ram_addr, dirty_flags); + dirty_flags |= (0xff & ~CODE_DIRTY_FLAG); phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS] = dirty_flags; /* we remove the notdirty callback only if the code has been diff --git a/kqemu.c b/kqemu.c index 44c1a55..7e24bb7 100644 --- a/kqemu.c +++ b/kqemu.c @@ -358,16 +358,6 @@ void kqemu_set_notdirty(ram_addr_t ram_addr) ram_pages_to_update[nb_ram_pages_to_update++] = ram_addr; } -QEMUAccel kqemu_accel = { - .cpu_interrupt = kqemu_cpu_interrupt, - .init_env = kqemu_init_env, - .flush_cache = kqemu_flush, - .flush_page = kqemu_flush_page, - .info = kqemu_info, - .profile = kqemu_profile, - .set_notdirty = kqemu_set_notdirty, -}; - static void kqemu_reset_modified_ram_pages(void) { int i; @@ -380,7 +370,7 @@ static void kqemu_reset_modified_ram_pages(void) nb_modified_ram_pages = 0; } -void kqemu_modify_page(CPUState *env, ram_addr_t ram_addr) +void kqemu_modify_page(ram_addr_t ram_addr, int dirty_flags) { unsigned long page_index; int ret; @@ -388,6 +378,8 @@ void kqemu_modify_page(CPUState *env, ram_addr_t ram_addr) DWORD temp; #endif + if ((dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK) + return; page_index = ram_addr >> TARGET_PAGE_BITS; if (!modified_ram_pages_table[page_index]) { #if 0 @@ -411,6 +403,18 @@ void kqemu_modify_page(CPUState *env, ram_addr_t ram_addr) } } +QEMUAccel kqemu_accel = { + .cpu_interrupt = kqemu_cpu_interrupt, + .init_env = kqemu_init_env, + .flush_cache = kqemu_flush, + .flush_page = kqemu_flush_page, + .info = kqemu_info, + .profile = kqemu_profile, + .set_notdirty = kqemu_set_notdirty, + .modify_page = kqemu_modify_page, +}; + + struct fpstate { uint16_t fpuc; uint16_t dummy1; -- 1.5.5 |
From: Glauber C. <gc...@re...> - 2008-05-15 14:10:17
|
we put all the code that needs to be executed only at cpu0 out of cpu_exec_init(), in exec_init(). It is executed before machine_init(), and only once. With this change, code cpu_exec_init() is completely symmetric. --- exec-all.h | 1 + exec.c | 15 +++++++++------ vl.c | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/exec-all.h b/exec-all.h index d8c6c33..8c32858 100644 --- a/exec-all.h +++ b/exec-all.h @@ -82,6 +82,7 @@ int cpu_restore_state_copy(struct TranslationBlock *tb, void *puc); void cpu_resume_from_signal(CPUState *env1, void *puc); void cpu_exec_init(CPUState *env); +void exec_init(void); int page_unprotect(target_ulong address, unsigned long pc, void *puc); void tb_invalidate_phys_page_range(target_phys_addr_t start, target_phys_addr_t end, int is_cpu_write_access); diff --git a/exec.c b/exec.c index 2fd0078..5384460 100644 --- a/exec.c +++ b/exec.c @@ -327,17 +327,20 @@ static void tlb_unprotect_code_phys(CPUState *env, ram_addr_t ram_addr, target_ulong vaddr); #endif +/* Must be called once before any of attempts to call cpu_init */ +void exec_init(void) +{ + cpu_gen_init(); + code_gen_ptr = code_gen_buffer; + page_init(); + io_mem_init(); +} + void cpu_exec_init(CPUState *env) { CPUState **penv; int cpu_index; - if (!code_gen_ptr) { - cpu_gen_init(); - code_gen_ptr = code_gen_buffer; - page_init(); - io_mem_init(); - } env->next_cpu = NULL; penv = &first_cpu; cpu_index = 0; diff --git a/vl.c b/vl.c index 67712f0..5999b37 100644 --- a/vl.c +++ b/vl.c @@ -8576,6 +8576,7 @@ int main(int argc, char **argv) } } + exec_init(); machine->init(ram_size, vga_ram_size, boot_devices, ds, kernel_filename, kernel_cmdline, initrd_filename, cpu_model); -- 1.5.5 |
From: Glauber C. <gc...@re...> - 2008-05-15 14:10:00
|
--- exec-all.h | 8 +++++++- kqemu.c | 1 + target-i386/helper2.c | 4 +--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/exec-all.h b/exec-all.h index 7b2d97d..9e211dc 100644 --- a/exec-all.h +++ b/exec-all.h @@ -580,6 +580,7 @@ static inline target_ulong get_phys_addr_code(CPUState *env1, target_ulong addr) typedef struct QEMUAccel { void (*cpu_interrupt)(CPUState *env); + void (*init_env)(CPUState *env); } QEMUAccel; extern QEMUAccel *current_accel; @@ -595,10 +596,15 @@ static inline void accel_cpu_interrupt(CPUState *env) current_accel->cpu_interrupt(env); } +static inline void accel_init_env(CPUState *env) +{ + if (current_accel && current_accel->init_env) + current_accel->init_env(env); +} + #ifdef USE_KQEMU #define KQEMU_MODIFY_PAGE_MASK (0xff & ~(VGA_DIRTY_FLAG | CODE_DIRTY_FLAG)) -int kqemu_init(CPUState *env); int kqemu_cpu_exec(CPUState *env); void kqemu_flush_page(CPUState *env, target_ulong addr); void kqemu_flush(CPUState *env, int global); diff --git a/kqemu.c b/kqemu.c index f875e0e..e0422de 100644 --- a/kqemu.c +++ b/kqemu.c @@ -263,6 +263,7 @@ void kqemu_cpu_interrupt(CPUState *env) QEMUAccel kqemu_accel = { .cpu_interrupt = kqemu_cpu_interrupt, + .init_env = kqemu_init_env, }; diff --git a/target-i386/helper2.c b/target-i386/helper2.c index 1c0fcdb..b633814 100644 --- a/target-i386/helper2.c +++ b/target-i386/helper2.c @@ -112,9 +112,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model) return NULL; } cpu_reset(env); -#ifdef USE_KQEMU - kqemu_init_env(env); -#endif + accel_init_env(env); return env; } -- 1.5.5 |