Re: [kvm-devel] [ANNOUNCE] kvm-guest-drivers-windows-2

2008-05-15 Thread Anthony Liguori
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

Re: [kvm-devel] pinning, tsc and apic

2008-05-15 Thread Anthony Liguori
Chris Wright wrote: > * Anthony Liguori ([EMAIL PROTECTED]) 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 t

Re: [kvm-devel] [ANNOUNCE] kvm-guest-drivers-windows-2

2008-05-15 Thread Anthony Liguori
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 shoul

Re: [kvm-devel] pinning, tsc and apic

2008-05-14 Thread Anthony Liguori
1995.046 MHz processor. 8_serial.log:time.c: Detected 1994.951 MHz processor. 9_serial.log:time.c: Detected 2184.754 MHz processor. Regards, Anthony Liguori > So can you try setting KVM_MAX_PIT_INTR_INTERVAL to a lower value? HZ/10 > or something

Re: [kvm-devel] [ANNOUNCE] kvm-guest-drivers-windows-2

2008-05-14 Thread Anthony Liguori
uest to host? >> >> That would be about 20% improvement? >> FWIW, virtio-net is much better with my patches applied. The difference between the e1000 and virtio-net is that e1000 consumes almost twice as much CPU as virtio-net so in my testing, the performance improvement with

Re: [kvm-devel] [Qemu-devel] Re: [PATCH] Add support for a configuration file

2008-05-14 Thread Anthony Liguori
would probably require more code to support the dependency than all of QEMU itself. Regards, Anthony Liguori - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http:/

Re: [kvm-devel] [Qemu-devel] Re: [PATCH] Add support for a configuration file

2008-05-14 Thread Anthony Liguori
We'll have to start adjusting option names keeping them only valid on the command line (for things like -m). However, I think it would grow pretty well into a machine description mechanism. Regards, Anthony Liguori > Thoughts? > > Paul >

Re: [kvm-devel] [Qemu-devel] Re: [PATCH] Add support for a configuration file

2008-05-14 Thread Anthony Liguori
as an association whereas semantically, we want it to be a sequence. To make it a sequence, we would have to prefix every line with '-'. I'm not against following some sort of standard (or even best practice). I just don't like YAML. Regards, Anthony Liguori --

Re: [kvm-devel] [Qemu-devel] Re: [PATCH] Add support for a configuration file

2008-05-14 Thread Anthony Liguori
arily because it provides a means to associate arbitrary data with a VM. It also provides a sane way to keep track of which device is which so that the "config" can be updated while the VM is running. I'll update the patch. Regards, Anthony Liguori > mynetworkcard.class="ne

Re: [kvm-devel] [PATCH] Add support for a configuration file

2008-05-13 Thread Anthony Liguori
Anthony Liguori wrote: > I think this is pretty useful as-is. I think it also gives us a reasonable > way to move forward that will keep everyone pretty happy. > > Here's a short example: > > qemu-system-x86_64 -hda ~/images/linux.img -snapshot -vnc :2 > > Would be

[kvm-devel] [PATCH] Add support for a configuration file

2008-05-13 Thread Anthony Liguori
me/anthony/images/linux.img # Redirect disk writes to a temporary image snapshot # Make the graphical display available on port 5902 vnc=:2 With: qemu-system-x86_64 -config foo.qemu Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu-doc.texi b/qemu-doc.texi index cca483c

[kvm-devel] [PATCH 1/4] Add method to send fragmented packets

2008-05-13 Thread Anthony Liguori
We need to be able to send fragmented packets in KVM to avoid an extra copy in the TX path. This patch adds a qemu_sendv_packet() function to send fragemented packets. It also provides backwards compatibility for old clients that don't support the new interface. Signed-off-by: Anthony Li

[kvm-devel] [PATCH 2/4] Add fd_readv handler to tap

2008-05-13 Thread Anthony Liguori
This allows fragmented packets to be sent with no additional copies over the tap interface. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/vl.c b/qemu/vl.c index 1f0a6ac..7900b76 100644 --- a/qemu/vl.c +++ b/qemu/vl.c @@ -4086,6 +4086,19 @@ static void tap_receiv

[kvm-devel] [PATCH 3/4] Use fragmented send for virtio

2008-05-13 Thread Anthony Liguori
This patch converts virtio-net to use the new fragmented send interface. We should have always supported this. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c index 85cc9d2..93bca1d 100644 --- a/qemu/hw/virtio-net.c +++ b/qemu/hw/

[kvm-devel] [PATCH 4/4] Validate virtio-net TX header

2008-05-13 Thread Anthony Liguori
Missed this one in my last series. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c index 93bca1d..ca45775 100644 --- a/qemu/hw/virtio-net.c +++ b/qemu/hw/virtio-net.c @@ -246,6 +246,12 @@ static void virtio_net_flush_tx(VirtIO

Re: [kvm-devel] pinning, tsc and apic

2008-05-12 Thread Anthony Liguori
Ryan Harper wrote: > * Anthony Liguori <[EMAIL PROTECTED]> [2008-05-12 15:05]: > >> Ryan Harper wrote: >> >>> I've been digging into some of the instability we see when running >>> larger numbers of guests at the same time. The test I&#x

Re: [kvm-devel] pinning, tsc and apic

2008-05-12 Thread Anthony Liguori
pic; > struct hrtimer *timer; > > if (!apic) > return; > > timer = &apic->timer.dev; > if (hrtimer_cancel(timer)) > hrtimer_start(timer, timer->expires, HRTIMER_MODE_ABS); > } > > There's a big FIXME in the __apic_

Re: [kvm-devel] [PATCH] qemu-kvm: Consolidate kvm_eat_signals

2008-05-12 Thread Anthony Liguori
ut that. >> In the very least, we could just select() on nothing and allow >> SIG_IPI to break us out of the select. > > sigtimedwait() (or just sigwait, now) doesn't require the signal to be > delivered, so it's faster. Yeah, sigtimedwait() is probably the right thi

Re: [kvm-devel] [PATCH] qemu-kvm: Consolidate kvm_eat_signals

2008-05-12 Thread Anthony Liguori
SIG_IPI and we only use SIG_IPI to break out of sleeping. I don't see any reason why we couldn't switch over to using a file descriptor for notification (or a pthread condition). In the very least, we could just select() on nothing and allow SIG_IPI to break us out of the select. Reg

Re: [kvm-devel] [PATCH 5/5] Stop dropping so many RX packets in tap (v3)

2008-05-11 Thread Anthony Liguori
Avi Kivity wrote: > Anthony Liguori wrote: > >>> How about the other way round: when the vlan consumer detects it can >>> no longer receive packets, it tells that to the vlan. When all vlan >>> consumers can no longer receive, tell the producer to stop >

Re: [kvm-devel] [PATCH 5/5] Stop dropping so many RX packets in tap (v3)

2008-05-11 Thread Anthony Liguori
Avi Kivity wrote: > Anthony Liguori wrote: >> Normally, tap always reads packets and simply lets the client drop >> them if it >> cannot receive them. For virtio-net, this results in massive packet >> loss and >> about an 80% performance loss in TCP thro

Re: [kvm-devel] [PATCH] qemu-kvm: fix guest resetting

2008-05-09 Thread Anthony Liguori
= env; > -} > +cpu_single_env = NULL; > } > Personally, I prefer it the old way. All of the open-coded cpu_single_env's are tough to understand and I believe error-prone. I think a strategy of explicitly preserving cpu_single_env whenever we drop qemu_mutex is mor

Re: [kvm-devel] [PATCH 1/5] Support more than 3.5GB with virtio (v3)

2008-05-09 Thread Anthony Liguori
Avi Kivity wrote: > Anthony Liguori wrote: >> We're pretty sloppy in virtio right now about phys_ram_base >> assumptions. This >> patch is an incremental step between what we have today and a full >> blown DMA >> API. I backported the DMA API but the per

Re: [kvm-devel] qemu/kvm: support for pci passthrough

2008-05-08 Thread Anthony Liguori
crubbing. The good thing is that >it can live withing the kvm module and does not have to wait for >kernel inclusion like the two below. Nope, it uses the existing Linux VT-d support and requires patches to the existing code. It can't live entirely within the external

[kvm-devel] [PATCH 1/3] Virtio save/restore support (v2)

2008-05-08 Thread Anthony Liguori
rectly. I will submit a patch in the near future that addresses that problem. Since v1, I fixed the Signed-off-by line. Sorry about that. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio.c b/qemu/hw/virtio.c index a4c9d10..440cc69 100644 --- a/qemu/hw/virtio

[kvm-devel] [PATCH 1/3] Virtio save/restore support

2008-05-08 Thread Anthony Liguori
rectly. I will submit a patch in the near future that addresses that problem. Signed-off-by: Anthony Liguori diff --git a/qemu/hw/virtio.c b/qemu/hw/virtio.c index a4c9d10..440cc69 100644 --- a/qemu/hw/virtio.c +++ b/qemu/hw/virtio.c @@ -420,7 +420,6 @@ VirtQueue *virtio_add_queue(VirtIODevice

[kvm-devel] [PATCH 3/3] virtio-blk save/restore support

2008-05-08 Thread Anthony Liguori
No additional state needs to be saved. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio-blk.c b/qemu/hw/virtio-blk.c index 048285a..148cb75 100644 --- a/qemu/hw/virtio-blk.c +++ b/qemu/hw/virtio-blk.c @@ -162,11 +162,30 @@ static uint32_t virtio_blk_get_fe

[kvm-devel] [PATCH 2/3] virtio-net save/restore support

2008-05-08 Thread Anthony Liguori
The only interesting bit here is that we have to ensure that we rearm the timer if necessary. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c index d15c2f4..5fe66ac 100644 --- a/qemu/hw/virtio-net.c +++ b/qemu/hw/virtio-net.c @@

Re: [kvm-devel] [PATCH] Fix e1000 can_receive handler

2008-05-08 Thread Anthony Liguori
Avi Kivity wrote: > Anthony Liguori wrote: >> Aurelien Jarno wrote: >>> On Wed, May 07, 2008 at 04:40:58PM -0500, Anthony Liguori wrote: >>> >>>> The current logic of the can_receive handler is to allow packets >>>> whenever the >>>&g

Re: [kvm-devel] [PATCH] Fix e1000 can_receive handler

2008-05-08 Thread Anthony Liguori
Aurelien Jarno wrote: > On Wed, May 07, 2008 at 04:40:58PM -0500, Anthony Liguori wrote: > >> The current logic of the can_receive handler is to allow packets whenever the >> receiver is disabled or when there are descriptors available in the ring. >> >> I think

[kvm-devel] [PATCH] Make sure to restore cpu_single_env when after cond_wait

2008-05-07 Thread Anthony Liguori
I discovered this while testing virtio save/restore this evening. After sleeping, cpu_single_env can change so we have to make sure to restore it. This applies on top of my IO thread series. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c

Re: [kvm-devel] [RFC][PATCH] svm.c: tsc unsigned delta calculation

2008-05-07 Thread Anthony Liguori
a potentially large amount depending on how out of sync the TSC is on CPU migration. The question is why this would make things work out better for you.. Do you have Gerd's kvm-clock most recent patch applied? Regards, Anthony Liguori > This check makes sense to me in that we only need

[kvm-devel] [PATCH] Fix e1000 can_receive handler

2008-05-07 Thread Anthony Liguori
: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/e1000.c b/qemu/hw/e1000.c index 0728539..01f8983 100644 --- a/qemu/hw/e1000.c +++ b/qemu/hw/e1000.c @@ -520,8 +520,8 @@ e1000_can_receive(void *opaque) { E1000State *s = opaque; -return (!(s->mac_reg[RCTL] &

Re: [kvm-devel] [RFC] [VTD][patch 1/3] vt-d support for pci passthrough: kvm-vtd--kernel.patch

2008-05-07 Thread Anthony Liguori
Avi Kivity wrote: > Anthony Liguori wrote: > > >>> What should be done for unmodified guest where there is no PV driver in >>> the guest? Would a call to mlock() from >>> qemu/hw/pci-passthrough.c/add_pci_passthrough_device() a reasonable >>> thing

[kvm-devel] [PATCH 4/5] Make virtio-net can_receive more accurate (v3)

2008-05-07 Thread Anthony Liguori
one pending). This particular change makes RX performance very consistent. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c index 8d26832..5538979 100644 --- a/qemu/hw/virtio-net.c +++ b/qemu/hw/virtio-net.c @@ -14,6 +14,7 @@ #in

[kvm-devel] [PATCH 5/5] Stop dropping so many RX packets in tap (v3)

2008-05-07 Thread Anthony Liguori
again. This patch also modifies the tap code to only read from the tap fd if at least one client on the VLAN is able to receive a packet. Finally, this patch changes the tap code to drain all possible packets from the tap device when the tap fd is readable. Signed-off-by: Anthony Liguori &l

[kvm-devel] [PATCH 3/5] Revert virtio tap hack (v3)

2008-05-07 Thread Anthony Liguori
which is apparently a significant problem with the tap implementation in QEMU. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/pc.h b/qemu/hw/pc.h index 73e3918..c284bf1 100644 --- a/qemu/hw/pc.h +++ b/qemu/hw/pc.h @@ -155,7 +155,6 @@ void isa_ne2000_init(in

[kvm-devel] [PATCH 2/5] Validate the SG list layouts in virtio

2008-05-07 Thread Anthony Liguori
We should check that the first element is the size we expect instead of just casting blindly. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio-blk.c b/qemu/hw/virtio-blk.c index 3af36db..048285a 100644 --- a/qemu/hw/virtio-blk.c +++ b/qemu/hw/virtio-blk.c @@

[kvm-devel] [PATCH 1/5] Support more than 3.5GB with virtio (v3)

2008-05-07 Thread Anthony Liguori
with this particular patch. Since we're no longer assuming guest physical memory is contiguous, we need a more complex way to validate the memory regions than just checking if it's within ram_size. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio.c b/qemu

[kvm-devel] [PATCH 3/6] Add support for signalfd() (v3)

2008-05-07 Thread Anthony Liguori
uses sigwaitinfo() to emulate it. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/kvm-compatfd.c b/qemu/kvm-compatfd.c index 1b030ba..b1311e2 100644 --- a/qemu/kvm-compatfd.c +++ b/qemu/kvm-compatfd.c @@ -15,6 +15,97 @@ #include "qemu-kvm.h" #include

[kvm-devel] [PATCH 4/6] Use signalfd() in io-thread (v3)

2008-05-07 Thread Anthony Liguori
ed from a handler in main_loop_wait() (which is the case with qemu_kvm_aio_wait()). Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c index 7134e56..492c3c4 100644 --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -17,6 +17,7 @@ int kvm_pit = 1; #in

[kvm-devel] [PATCH 6/6] Only select once per-main_loop iteration (v3)

2008-05-07 Thread Anthony Liguori
is very large. This patch changes main_loop_wait to only select once before doing the various other things in the main loop. This generally improves responsiveness of things like SDL but also improves individual file descriptor throughput quite dramatically. Signed-off-by: Anthony Liguori <[EM

[kvm-devel] [PATCH 5/6] Interrupt io thread in qemu_set_fd_handler2 (v3)

2008-05-07 Thread Anthony Liguori
The select() in the IO thread may wait a long time before rebuilding the fd set. Whenever we do something that changes the fd set, we should interrupt the IO thread. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/vl.c b/qemu/vl.c index 1192759..e9f0ca4 100644 ---

[kvm-devel] [PATCH 1/6] Add support for eventfd() (v3)

2008-05-07 Thread Anthony Liguori
This patch adds compatibility code so that we can make use of eventfd() within QEMU. eventfd() is a pretty useful mechanism as it allows multiple notifications to be batched in a single system call. We emulate eventfd() using a standard pipe(). Signed-off-by: Anthony Liguori <[EMAIL PROTEC

[kvm-devel] [PATCH 2/6] Replace SIGUSR1 in io-thread with eventfd() (v3)

2008-05-07 Thread Anthony Liguori
It's a little odd to use signals to raise a notification on a file descriptor when we can just work directly with a file descriptor instead. This patch converts the SIGUSR1 based notification in the io-thread to instead use an eventfd file descriptor. Signed-off-by: Anthony Liguori &l

Re: [kvm-devel] strange problem with virtio on guest with over 3648M RAM

2008-05-07 Thread Anthony Liguori
ers when there > is more than 3648 MiB of ram available :), is there anyone else that > have experienced the same problems or are there people running virtio on > guest with more ram where everything is working ok? > It's a know bug. I have a fix for it locally that I'll

Re: [kvm-devel] [RFC] [VTD][patch 1/3] vt-d support for pci passthrough: kvm-vtd--kernel.patch

2008-05-06 Thread Anthony Liguori
e to it. This allows for memory reclaiming which should allow for things like NUMA page migration. We can't swap of course but that doesn't mean reclaimation isn't useful. Regards, Anthony Liguori > Allen > -

Re: [kvm-devel] [RFC] [VTD][patch 2/3] vt-d support for pci passthrough: kvm-vtd-user.patch

2008-05-06 Thread Anthony Liguori
d we should provide notifications for when the mapping changes for a given reason. Userspace can enforce the requirement that memory remains present via mlock(). This allows us to implement a PV API for DMA registration without the IOMMU code hav

Re: [kvm-devel] [RFC] [VTD][patch 3/3] vt-d support for pci passthrough: kvm-intel-iommu.patch

2008-05-06 Thread Anthony Liguori
ain reserved_iova_list; > static struct lock_class_key reserved_alloc_key; > @@ -1160,7 +1162,7 @@ static inline int guestwidth_to_adjustwidth(int > gaw) > return agaw; > } > > -static int domain_init

Re: [kvm-devel] [RFC] [VTD][patch 1/3] vt-d support for pci passthrough: kvm-vtd--kernel.patch

2008-05-06 Thread Anthony Liguori
we will no longer be holding a reference for guest memory. We have to ensure we don't swap KVM guest memory while using hardware pass-through, but AFAICT, we do not need to make the memory non-reclaimable As long as we reprogram the IOMMU with a new, valid, mapping every

Re: [kvm-devel] [PATCH 1/4] Replace SIGUSR1 in io-thread with eventfd() (v2)

2008-05-06 Thread Anthony Liguori
Marcelo Tosatti wrote: > Looks good (the whole series). > > Needs some good testing of course... Have you tested migration/loadvm? > No, but I will before resubmitting (which should be sometime tomorrow). Regards, Anthony Liguori > On Mon, May 05, 2008 at 08:47:12AM -0500,

Re: [kvm-devel] Protected mode transitions and big real mode... still an issue

2008-05-06 Thread Anthony Liguori
Guillaume Thouvenin wrote: > On Mon, 5 May 2008 16:29:21 +0300 > "Mohammed Gamal" <[EMAIL PROTECTED]> wrote: > > >> On Mon, May 5, 2008 at 3:57 PM, Anthony Liguori <[EMAIL PROTECTED]> wrote: >> >> >>> WinXP fails to boot wit

Re: [kvm-devel] [patch 0/3] QEMU/KVM: add support for 128 PCI slots (v2)

2008-05-05 Thread Anthony Liguori
handlers to avoid cache line bouncing too. Plus, we can use PCI hotplug so we don't have to reinvent a new hotplug mechanism. I'm inclined to think that ring sharing isn't as useful as it seems as long as we don't have indirect scatter gather lists. Regards, Anthony Li

[kvm-devel] [PATCH 1/4] Replace SIGUSR1 in io-thread with eventfd() (v2)

2008-05-05 Thread Anthony Liguori
use a pipe() instead. The benefit of using eventfd is that multiple notifications will be batched into a signal IO event. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/Makefile.target b/qemu/Makefile.target index 2316c92..db6912e 100644 --- a/qemu/Makefile.t

[kvm-devel] [PATCH 3/4] Interrupt io thread in qemu_set_fd_handler2 (v2)

2008-05-05 Thread Anthony Liguori
The select() in the IO thread may wait a long time before rebuilding the fd set. Whenever we do something that changes the fd set, we should interrupt the IO thread. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/vl.c b/qemu/vl.c index 1192759..e9f0ca4 100644 ---

[kvm-devel] [PATCH 2/4] Use signalfd() in io-thread (v2)

2008-05-05 Thread Anthony Liguori
e signalfd(). I've tested Windows and Linux guests with SMP without seeing an obvious regressions. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/kvm-compatfd.c b/qemu/kvm-compatfd.c index 1b030ba..3c2be28 100644 --- a/qemu/kvm-compatfd.c +++ b/qemu/kvm-compat

[kvm-devel] [PATCH 4/4] Only select once per-main_loop iteration (v2)

2008-05-05 Thread Anthony Liguori
is very large. This patch changes main_loop_wait to only select once before doing the various other things in the main loop. This generally improves responsiveness of things like SDL but also improves individual file descriptor throughput quite dramatically. Signed-off-by: Anthony Liguori <[EM

Re: [kvm-devel] Protected mode transitions and big real mode... still an issue

2008-05-05 Thread Anthony Liguori
gt; > And without the patch, can you boot the ubuntu 8.04 livecd? > WinXP fails to boot with your patch applied too. FWIW, Ubuntu 8.04 has a fixed version of gfxboot that doesn't do nasty things with SS on privileged mode

Re: [kvm-devel] [PATCH 3/3] Stop dropping so many RX packets in tap (v2)

2008-05-04 Thread Anthony Liguori
Dor Laor wrote: > On Sun, 2008-05-04 at 15:21 -0500, Anthony Liguori wrote: > > Patchset looks good and reduces some nasty hacks. It probably also > improves other devices like e1000 et al. > Yeah, we just need to make sure they have proper can_receive handlers. I took a qu

[kvm-devel] [PATCH 1/3] Revert virtio tap hack (v2)

2008-05-04 Thread Anthony Liguori
upstream QEMU significantly easier. Since v1, we're just rebasing on the new io thread patch set. This series depends on my IO thread series. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/pc.h b/qemu/hw/pc.h index 57d2123..f5157bd 100644 --- a/qemu/hw/pc.h +++ b/q

[kvm-devel] [PATCH 2/3] Make virtio-net can_receive more accurate (v2)

2008-05-04 Thread Anthony Liguori
one pending). This particular change makes RX performance very consistent. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c index 8d26832..5538979 100644 --- a/qemu/hw/virtio-net.c +++ b/qemu/hw/virtio-net.c @@ -14,6 +14,7 @@ #in

[kvm-devel] [PATCH 2/3] Interrupt io thread in qemu_set_fd_handler2

2008-05-04 Thread Anthony Liguori
The select() in the IO thread may wait a long time before rebuilding the fd set. Whenever we do something that changes the fd set, we should interrupt the IO thread. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/vl.c b/qemu/vl.c index 1192759..e9f0ca4 100644 ---

[kvm-devel] [PATCH 3/3] Only select once per-main_loop iteration

2008-05-04 Thread Anthony Liguori
is very large. This patch changes main_loop_wait to only select once before doing the various other things in the main loop. This generally improves responsiveness of things like SDL but also improves individual file descriptor throughput quite dramatically. Signed-off-by: Anthony Liguori <[EM

[kvm-devel] [PATCH 3/3] Stop dropping so many RX packets in tap (v2)

2008-05-04 Thread Anthony Liguori
again. This patch also modifies the tap code to only read from the tap fd if at least one client on the VLAN is able to receive a packet. Finally, this patch changes the tap code to drain all possible packets from the tap device when the tap fd is readable. Signed-off-by: Anthony Liguori &l

[kvm-devel] [PATCH 1/3] Use signalfd() in io-thread

2008-05-04 Thread Anthony Liguori
obvious regressions. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/Makefile.target b/qemu/Makefile.target index 2316c92..db6912e 100644 --- a/qemu/Makefile.target +++ b/qemu/Makefile.target @@ -203,7 +203,7 @@ CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc endif ifeq ($(USE_KVM

Re: [kvm-devel] [PATCH] Use pipe() to simulate signalfd() (v2)

2008-05-04 Thread Anthony Liguori
Avi Kivity wrote: > Anthony Liguori wrote: >>> We can keep the signals blocked, but run the signalfd emulation in a >>> separate thread (where it can dequeue signals using sigwait as an >>> added bonus). This will reduce the differences between the two >>

Re: [kvm-devel] [PATCH] Use pipe() to simulate signalfd() (v2)

2008-05-04 Thread Anthony Liguori
We could just not block SIGUSR1 and rely on the fact that it will break us out of select() but I that makes things a bit more subtle than I'd like. I personally prefer using pipe() within the same thread although I'm willing to also do the separate thread. Regards, Anthony LIguori

Re: [kvm-devel] [PATCH 2/4] Revert virtio tap hack

2008-05-03 Thread Anthony Liguori
Anthony Liguori wrote: While it has served us well, it is long overdue that we eliminate the virtio-net tap hack. It turns out that zero-copy has very little impact on performance. The tap hack was gaining such a significant performance boost not because of zero-copy, but because it avoided

[kvm-devel] [PATCH 3/4] Make virtio-net can_receive more accurate

2008-05-03 Thread Anthony Liguori
one pending). This particular change makes RX performance very consistent. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c index 8d26832..5538979 100644 --- a/qemu/hw/virtio-net.c +++ b/qemu/hw/virtio-net.c @@ -14,6 +14,7 @@ #in

[kvm-devel] [PATCH 4/4] Stop dropping so many RX packets in tap

2008-05-03 Thread Anthony Liguori
again. This patch also modifies the tap code to only read from the tap fd if at least one client on the VLAN is able to receive a packet. Finally, this patch changes the tap code to drain all possible packets from the tap device when the tap fd is readable. Signed-off-by: Anthony Liguori &l

[kvm-devel] [PATCH 1/4] Only select once per-main_loop iteration

2008-05-03 Thread Anthony Liguori
-timerfd.patch. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c index 0c7f49f..31c7ca7 100644 --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -401,24 +401,6 @@ void qemu_kvm_notify_work(void) pthread_kill(io_thread, SIGUSR1); } -stat

[kvm-devel] [PATCH 2/4] Revert virtio tap hack

2008-05-03 Thread Anthony Liguori
upstream QEMU significantly easier. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/pc.h b/qemu/hw/pc.h index 57d2123..f5157bd 100644 --- a/qemu/hw/pc.h +++ b/qemu/hw/pc.h @@ -154,7 +154,6 @@ void isa_ne2000_init(int base, qemu_irq irq, NICInfo *nd); /* virtio

[kvm-devel] [PATCH] Use pipe() to simulate signalfd() (v2)

2008-05-02 Thread Anthony Liguori
al handler. I've tested Windows and Linux guests with SMP without seeing an obvious regressions. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c index 9a9bf59..0c7f49f 100644 --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -12,6 +12,9 @@ int

Re: [kvm-devel] Feedback and errors

2008-05-02 Thread Anthony Liguori
the solution involves breaking backwards compatibility for legitimate use-cases (not to mention making those use-cases more awkward). I think the only way to sanely do this is as a global configuration parameter. Regards, Anthony Liguori -

Re: [kvm-devel] Feedback and errors

2008-05-02 Thread Anthony Liguori
mate more often than helping someone doing something stupid. I very frequently run multiple VMs with the same disk. I do it strictly for the purposes of benchmarking. There are ways to share a disk without using a clustered filesystem. If a higher level management tool wants to enforc

[kvm-devel] [PATCH] Handle vma regions with no backing page (v3)

2008-04-30 Thread Anthony Liguori
x27;s suggestions at using VM_PFNMAP instead of VM_IO and changed the BUG_ON to a return of bad_page. Since v2, I've incorporated comments from Avi about returning bad_page instead of NULL and fixed a typo spotted by Muli. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a

[kvm-devel] [PATCH] Don't leak EPT identity page table

2008-04-30 Thread Anthony Liguori
In vmx.c:alloc_identity_pagetable() we grab a reference to the EPT identity page table via gfn_to_page(). We never release this reference though. This patch releases the reference to this page on VM destruction. I haven't tested this with EPT. Signed-off-by: Anthony Liguori <[EMAIL P

Re: [kvm-devel] cirrusfb division by zero

2008-04-30 Thread Anthony Liguori
sed to return 0 when in VGA mode. I don't think blitting should happen when in VGA mode. Applying the patch is not a bad idea but what was the guest doing when this happened? Was it in the process of transitioning from one mode to another? Regards, Anthony Liguori > "vb

Re: [kvm-devel] [PATCH] Handle vma regions with no backing page (v2)

2008-04-30 Thread Anthony Liguori
Andrea Arcangeli wrote: > On Tue, Apr 29, 2008 at 06:12:51PM -0500, Anthony Liguori wrote: > >> IIUC PPC correctly, all IO pages have corresponding struct pages. This >> means that get_user_pages() would succeed and you can reference count them? >> In this case,

Re: [kvm-devel] [PATCH] Handle vma regions with no backing page (v2)

2008-04-30 Thread Anthony Liguori
Muli Ben-Yehuda wrote: > On Tue, Apr 29, 2008 at 02:09:20PM -0500, Anthony Liguori wrote: > >> This patch allows VMA's that contain no backing page to be used for guest >> memory. This is a drop-in replacement for Ben-Ami's first page in his direct >> mmio s

Re: [kvm-devel] [PATCH][RFC] Use pipe() to simulate signalfd()

2008-04-29 Thread Anthony Liguori
to the guest and during that time, the IO thread is going to be able to make forward progress. You won't get a signal again until a new IO request is submitted. Regards, Anthony Liguori > Its somewhat similar to what happens with NAPI and interrupt mitigation. > >

Re: [kvm-devel] [PATCH] [RFC] try to reduce kvm impact in core qemu code.

2008-04-29 Thread Anthony Liguori
n register reload call-out in the vmport hw for instance. Instead of introducing generic hooks in vmport, a more appropriate solution may be to add wrappers to read individual register values within the QEMU device code. We can then add our hooks to that. I think a good argument can be ma

Re: [kvm-devel] [PATCH][RFC] Use pipe() to simulate signalfd()

2008-04-29 Thread Anthony Liguori
t introduce buffering problems since if you're getting that many signals, the pipe will get full. No point in designing for something that isn't likely to happen in practice. Regards, Anthony Liguori >> No, they're independent of the patch. The symptom is that the guest >

Re: [kvm-devel] [PATCH][RFC] Use pipe() to simulate signalfd()

2008-04-29 Thread Anthony Liguori
w long it will hang, and at what point it will hang. It tends to hang more often in particular places. In my ubuntu server guest, for instance, it tends to hang right after partition probing, right after "Loading

Re: [kvm-devel] [PATCH][RFC] Use pipe() to simulate signalfd()

2008-04-29 Thread Anthony Liguori
s. I'm not entirely clear >> what is causing them though. >> > > Should indicate that some event previously delivered through signals and > received by sigtimedwait is not waking up the IO thread. > I'll take a look and see. I'm having time keeping

Re: [kvm-devel] [PATCH] Handle vma regions with no backing page (v2)

2008-04-29 Thread Anthony Liguori
emory up front and then create an IOMMU table from the pinned physical memory. For aware guests with a PV DMA window API, we'll be able to build that mapping on the fly (enforcing mlock allocation limits). Regards, Anthony Liguori --

Re: [kvm-devel] [PATCH] Handle vma regions with no backing page (v2)

2008-04-29 Thread Anthony Liguori
)s to track down instances of things going bad. Regards, Anthony Liguori - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time t

Re: [kvm-devel] [PATCH][RFC] Use pipe() to simulate signalfd()

2008-04-29 Thread Anthony Liguori
Marcelo Tosatti wrote: > Hi Anthony, > > How is -no-kvm-irqchip working with the patch? > Seems to work fine. What is your expectation? > On Tue, Apr 29, 2008 at 09:28:14AM -0500, Anthony Liguori wrote: > >> This patch eliminates the use of sigtimedwait() in

Re: [kvm-devel] [PATCH] Handle vma regions with no backing page (v2)

2008-04-29 Thread Anthony Liguori
Avi Kivity wrote: > Anthony Liguori wrote: > >> This patch allows VMA's that contain no backing page to be used for guest >> memory. This is a drop-in replacement for Ben-Ami's first page in his direct >> mmio series. Here, we continue to allow mmio page

[kvm-devel] [PATCH] Handle vma regions with no backing page (v2)

2008-04-29 Thread Anthony Liguori
x27;s suggestions at using VM_PFNMAP instead of VM_IO and changed the BUG_ON to a return of bad_page. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 1d7991a..64e5efe 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c

Re: [kvm-devel] Protected mode transitions and big real mode... still an issue

2008-04-29 Thread Anthony Liguori
Laurent Vivier wrote: > Le mardi 29 avril 2008 à 11:41 -0500, Anthony Liguori a écrit : > >> Guillaume Thouvenin wrote: >> >>> Hello, >>> >>> This patch should solve the problem observed during protected mode >>> transitions that appea

Re: [kvm-devel] Protected mode transitions and big real mode... still an issue

2008-04-29 Thread Anthony Liguori
Is the error I'm seeing. Regards, Anthony Liguori > Regards, > Guillaume > > > > arch/x86/kvm/vmx.c | 68 +++ > arch/x86/kvm/vmx.h |3 + > arch/x86/kvm/x86.c | 12 ++-- > arch/x86/kvm/x86_emulate.c | 112 >

Re: [kvm-devel] Protected mode transitions and big real mode... still an issue

2008-04-29 Thread Anthony Liguori
fact that it is for you indicates that you're not updating guest state correctly. My guess would be that load_segment_descriptor is not updating the values within the VMCS. Regards, Anthony Liguori - This SF.net email is

[kvm-devel] [PATCH][RFC] Use pipe() to simulate signalfd()

2008-04-29 Thread Anthony Liguori
s is a sane direction. I haven't tested this enough yet so please don't apply it. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c index 9a9bf59..46d7425 100644 --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -7,6 +7,9 @@ */ #in

Re: [kvm-devel] [PATCH] Handle vma regions with no backing page

2008-04-29 Thread Anthony Liguori
Andrea Arcangeli wrote: > On Tue, Apr 29, 2008 at 09:32:09AM -0500, Anthony Liguori wrote: > >> +vma = find_vma(current->mm, addr); >> +if (vma == NULL) { >> +get_page(bad_page); >> +

[kvm-devel] [PATCH] Handle vma regions with no backing page

2008-04-29 Thread Anthony Liguori
This patch allows VMA's that contain no backing page to be used for guest memory. This is a drop-in replacement for Ben-Ami's first page in his direct mmio series. Here, we continue to allow mmio pages to be represented in the rmap. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]

[kvm-devel] [PATCH] Don't race while creating a VCPU

2008-04-28 Thread Anthony Liguori
The first lets the VCPU create code that runs in the IO thread to wait for a VCPU to initialize. The second condition lets the VCPU thread wait for the machine to fully initialize before running. An added benefit of this patch is it makes the dependencies now explicit. Signed-off-by: Anthony Ligu

Re: [kvm-devel] [PATCH] Fix QEMU vcpu thread race with apic_reset

2008-04-28 Thread Anthony Liguori
important right now). We don't want to idle with the QEMU mutex held as that may result in dead lock so this is why we release it here. kvm_eat_signal() has to acquire the lock again in order to dispatch IO events (via kvm_process_signal()). Regards, Anthony Liguori > It wedges up in k

[kvm-devel] fork() within a VM with MMU notifiers

2008-04-28 Thread Anthony Liguori
refers to a VM that is no longer valid. Just avoiding destroying the VM in the ->release() method won't fix this use-case I don't think. In general, I think we need to think a little more about how fork() is handled with respec

Re: [kvm-devel] mmu notifier #v14

2008-04-26 Thread Anthony Liguori
Andrea Arcangeli wrote: > On Sat, Apr 26, 2008 at 01:59:23PM -0500, Anthony Liguori wrote: > >>> +static void kvm_unmap_spte(struct kvm *kvm, u64 *spte) >>> +{ >>> + struct page *page = pfn_to_page((*spte & PT64_BASE_ADDR_MASK) >&

  1   2   3   4   5   6   7   8   9   10   >