Re: [kvm-devel] [PATCH] virtio_blk: allow read-only disks

2008-05-16 Thread Rusty Russell
On Friday 16 May 2008 19:17:03 Christian Borntraeger wrote: Hello Rusty, sometimes it is useful to share a disk (e.g. usr). To avoid file system corruption, the disk should be mounted read-only in that case. This patch adds a new feature flag, that allows the host to specify, if the disk

Re: [kvm-devel] [PATCH] virtio_blk: allow read-only disks

2008-05-16 Thread Rusty Russell
On Friday 16 May 2008 19:28:27 Tomasz Chmielewski wrote: Christian Borntraeger schrieb: Hello Rusty, sometimes it is useful to share a disk (e.g. usr). To avoid file system corruption, the disk should be mounted read-only in that case. Although it is done at a different level here, I

Re: [kvm-devel] [PATCH/RFC] stop_machine: make stop_machine_run more virtualization friendly

2008-05-08 Thread Rusty Russell
On Thursday 08 May 2008 23:20:38 Christian Borntraeger wrote: Changing stop_machine to yield the cpu to the hypervisor when yielding inside the guest fixed the problem for me. While I am not completely happy with this patch, I think it causes no harm and it really improves the situation for

Re: [kvm-devel] s390 kvm_virtio.c build error

2008-05-04 Thread Rusty Russell
-by: Rusty Russell [EMAIL PROTECTED] diff -r 219d6c116996 drivers/s390/kvm/kvm_virtio.c --- a/drivers/s390/kvm/kvm_virtio.c Mon May 05 10:03:16 2008 +1000 +++ b/drivers/s390/kvm/kvm_virtio.c Mon May 05 10:17:25 2008 +1000 @@ -78,27 +78,34 @@ static unsigned desc_size(const struct k

Re: [kvm-devel] [PATCH/RFC] virtio: export more headers to userspace

2008-04-23 Thread Rusty Russell
On Wednesday 23 April 2008 20:57:00 Christian Borntraeger wrote: Rusty, is there a reason why we dont export the virtio headers for 9p, balloon, console, pci, and virtio_ring? kvm uses make sync, but I think it is still useful to heave these headers exported as they might be useful for other

Re: [kvm-devel] [RFC PATCH] virtio: change config to guest endian.

2008-04-22 Thread Rusty Russell
On Tuesday 22 April 2008 21:22:48 Avi Kivity wrote: The virtio config space was originally chosen to be little-endian, because we thought the config might be part of the PCI config space for virtio_pci. It's actually a separate mmio region, so that argument holds little water; as only x86

Re: [kvm-devel] [RFC PATCH] virtio: change config to guest endian.

2008-04-22 Thread Rusty Russell
On Tuesday 22 April 2008 17:44:08 Christian Borntraeger wrote: Am Dienstag, 22. April 2008 schrieb Rusty Russell: [Christian, Hollis, how much is this ABI breakage going to hurt you?] It is ok for s390 at the moment. We are still working on making userspace ready and I plan to change

Re: [kvm-devel] [RFC PATCH] virtio: change config to guest endian.

2008-04-22 Thread Rusty Russell
On Wednesday 23 April 2008 06:29:14 Hollis Blanchard wrote: On Tuesday 22 April 2008 09:31:35 Rusty Russell wrote: We may still regret not doing *everything* little-endian, but this doesn't make it worse. Hmm, why *don't* we just do everything LE, including the ring? Mainly because when

[kvm-devel] [RFC PATCH] virtio: change config to guest endian.

2008-04-21 Thread Rusty Russell
changes: - __virtio_config_val() just becomes a striaght vdev-config_get() call. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/block/virtio_blk.c |4 +-- drivers/virtio/virtio_balloon.c |6 ++--- include/linux/virtio_config.h | 47

Re: [kvm-devel] [PATCH] add virtio disk geometry feature

2008-04-16 Thread Rusty Russell
option. Keep the old geo code around for compatibility. Signed-off-by: Ryan Harper [EMAIL PROTECTED] Reviewed-by: Anthony Liguori [EMAIL PROTECTED] Signed-off-by: Rusty Russell [EMAIL PROTECTED] (modified to single struct) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c

Re: [kvm-devel] kernel BUG at drivers/virtio/virtio_ring.c:218!

2008-04-06 Thread Rusty Russell
On Sunday 06 April 2008 00:53:39 Balaji Rao wrote: On Friday 04 April 2008 01:46:21 pm Balaji Rao wrote: Hi Rusty, I hit a bug in virtio_ring.c:218 when I was stressing virtio_net using kvm with -smp 4. static void vring_disable_cb(struct virtqueue *_vq) { struct

Re: [kvm-devel] [RFC PATCH 0/4] Inter-guest virtio I/O example with lguest

2008-03-23 Thread Rusty Russell
On Friday 21 March 2008 01:11:35 Anthony Liguori wrote: Rusty Russell wrote: There are three possible solutions: 1) Just offer the lowest common denominator to both sides (ie. no features). This is what I do with lguest in these patches. 2) Offer something and handle the case where one

Re: [kvm-devel] [RFC/PATCH 15/15] guest: virtio device support, and kvm hypercalls

2008-03-21 Thread Rusty Russell
On Friday 21 March 2008 19:15:47 Christian Borntraeger wrote: Am Freitag, 21. März 2008 schrieb Rusty Russell: Hmm, panic on device_register fail, but -ENOMEM on add_shared_memory fail? My theory was that since this is boot time, panic() is the right thing. Good spot, but I agree

[kvm-devel] [RFC PATCH 0/4] Inter-guest virtio I/O example with lguest

2008-03-20 Thread Rusty Russell
Hi all, Just finished my prototype of inter-guest virtio, using networking as an example. Each guest mmaps the other's address space and uses a FIFO for notifications. There are two issues with this approach. The first is that neither guest can change its mappings. See patch 1. The

[kvm-devel] [RFC PATCH 1/5] lguest: mmap backing file

2008-03-20 Thread Rusty Russell
From: Paul TBBle Hampson [EMAIL PROTECTED] This creates a file in $HOME/.lguest/ to directly back the RAM and DMA memory mappings created by map_zeroed_pages. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- Documentation/lguest/lguest.c | 59 -- 1

[kvm-devel] [RFC PATCH 2/5] lguest: Encapsulate Guest memory ready for dealing with other Guests.

2008-03-20 Thread Rusty Russell
We currently keep Guest memory pointer and size in globals. We move this into a structure and explicitly hand that to to_guest_phys() and from_guest_phys() so we can deal with other Guests' memory. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- Documentation/lguest/lguest.c | 89

[kvm-devel] [RFC PATCH 3/5] lguest: separate out virtqueue info from device info.

2008-03-20 Thread Rusty Russell
To deal with other Guest's virtqueue, we need to separate out the parts of the structure which deal with the actual virtqueue from configuration information and the device. Then we can change the virtqueue descriptor handling functions to take that smaller structure. Signed-off-by: Rusty Russell

Re: [kvm-devel] [RFC PATCH 1/5] lguest: mmap backing file

2008-03-20 Thread Rusty Russell
On Friday 21 March 2008 01:04:17 Anthony Liguori wrote: Rusty Russell wrote: From: Paul TBBle Hampson [EMAIL PROTECTED] This creates a file in $HOME/.lguest/ to directly back the RAM and DMA memory mappings created by map_zeroed_pages. I created a test program recently that measured

Re: [kvm-devel] [RFC PATCH 0/4] Inter-guest virtio I/O example with lguest

2008-03-20 Thread Rusty Russell
On Thursday 20 March 2008 17:54:45 Avi Kivity wrote: Rusty Russell wrote: Hi all, Just finished my prototype of inter-guest virtio, using networking as an example. Each guest mmaps the other's address space and uses a FIFO for notifications. Isn't that a security hole (hole? chasm

Re: [kvm-devel] [RFC/PATCH 15/15] guest: virtio device support, and kvm hypercalls

2008-03-20 Thread Rusty Russell
On Friday 21 March 2008 03:25:28 Carsten Otte wrote: +static void kvm_set_status(struct virtio_device *vdev, u8 status) +{ + BUG_ON(!status); + to_kvmdev(vdev)-desc-status = status; +} + +/* + * To reset the device, we (ab)use the NOTIFY hypercall, with the descriptor + * address

Re: [kvm-devel] [Lguest] [RFC PATCH 1/5] lguest: mmap backing file

2008-03-20 Thread Rusty Russell
On Thursday 20 March 2008 19:16:00 Tim Post wrote: On Thu, 2008-03-20 at 17:05 +1100, Rusty Russell wrote: + snprintf(memfile_path, PATH_MAX, %s/.lguest, getenv(HOME) ?: ); Hi Rusty, Is that safe if being run via setuid/gid or shared root? It might be better to just look it up

Re: [kvm-devel] [PATCH] virtio_pci: unregister virtio device at device remove

2008-03-19 Thread Rusty Russell
On Thursday 20 March 2008 12:35:04 Anthony Liguori wrote: Make sure to call unregister_virtio_device() when a virtio device is removed. Otherwise, virtio_pci.ko cannot be rmmod'd. This was spotted by Marcelo Tosatti. Signed-off-by: Anthony Liguori [EMAIL PROTECTED] Thanks, applied. Rusty.

Re: [kvm-devel] [PATCH] virtio-balloon: do not attempt to release more than available pages

2008-03-11 Thread Rusty Russell
On Tuesday 11 March 2008 11:52:46 Anthony Liguori wrote: Rusty Russell wrote: 2) Handle the case where we get nonsense from the host, which causes us to wrap around. Here's my neither compiled nor tested version which should fix this problem without breaking the ABI. Hmm, we could just

Re: [kvm-devel] [PATCH] virtio-balloon: do not attempt to release more than available pages

2008-03-10 Thread Rusty Russell
On Sunday 09 March 2008 06:06:38 Marcelo Tosatti wrote: But making the driver robust against it seems sensate. I agree that zeroing num_pages is hackish. What do you suggest? OK, after more discussion on IRC, this seems like the correct thing to do. 1) Allow more than 2G of pages. It doesn't

Re: [kvm-devel] [PATCH] Use spin_lock_irqsave/restore for virtio-pci

2008-03-03 Thread Rusty Russell
On Monday 03 March 2008 09:37:48 Anthony Liguori wrote: virtio-pci acquires its spin lock in an interrupt context so it's necessary to use spin_lock_irqsave/restore variants. This patch fixes guest SMP when using virtio devices in KVM. Signed-off-by: Anthony Liguori [EMAIL PROTECTED]

Re: [kvm-devel] kvm-lite status

2008-03-02 Thread Rusty Russell
On Thursday 21 February 2008 10:24:57 Fabio Checconi wrote: Hi, what's the status of kvm-lite? Has anybody worked on it since the last september posting[1]? Hi Fabio, No, not really. I'll have to drag it up to date again and submit it for merging so it doesn't keep bitrotting. Thanks,

Re: [kvm-devel] [Patch] virtio_blk: implement naming for vda-vdz, vdaa-vdzz, vdaaa-vdzzz

2008-02-04 Thread Rusty Russell
On Friday 01 February 2008 19:05:00 Christian Borntraeger wrote: Am Freitag, 1. Februar 2008 schrieb Christian Borntraeger: Right. I will fix that with an additional patch. This patch goes on top of the minor number patch. Please let me know if you want a merged patch: Currently virtio_blk

Re: [kvm-devel] [PATCH] QEMU support for virtio balloon driver

2008-01-25 Thread Rusty Russell
On Saturday 26 January 2008 03:08:57 Marcelo Tosatti wrote: On Thu, Jan 24, 2008 at 04:29:51PM -0600, Anthony Liguori wrote: I'm inclined to think that we should have a capability check for MM notifiers and just not do madvise if they aren't present. I don't think the ioctl approach that

Re: [kvm-devel] [PATCH 2/2] virtio reset support

2008-01-24 Thread Rusty Russell
On Friday 25 January 2008 00:09:07 Dor Laor wrote: The patches really fix/simplify things :) Yes, that's why I like reset, it solves multiple problems. Did you test device open-close-open? It was broken in my last test, Well, it's not really fair, since I moved the buffer allocation and

[kvm-devel] [PATCH 1/2] reset support: make net driver alloc/cleanup in probe and remove

2008-01-23 Thread Rusty Russell
Since we want to reset the device to remove them, this is simpler (device is reset for us on driver remove). Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net/virtio_net.c | 44 +--- 1 file changed, 25 insertions(+), 19 deletions(-) diff -r

[kvm-devel] [PATCH 2/2] virtio reset support

2008-01-23 Thread Rusty Russell
that the buffers won't be used by the guest, and 3) It helps the guest recover from messed-up drivers. So we remove the -shutdown hook, and the only way we now remove feature bits is via reset. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/char/hw_random/virtio-rng.c |1 - drivers/lguest

Re: [kvm-devel] [Virtio-for-kvm] [PATCH 12/13] [Mostly resend] virtio additions

2008-01-23 Thread Rusty Russell
On Saturday 22 December 2007 02:27:04 Dor Laor wrote: From 20a01e0c24f47e9805a88bebc9310163f99b5e99 Mon Sep 17 00:00:00 2001 From: Dor Laor [EMAIL PROTECTED] Date: Sun, 16 Dec 2007 23:35:35 +0200 Subject: [PATCH] Handle module unload Add the device release function. Hi Dor, It looks

Re: [kvm-devel] [PATCH 1/3] Make virtio modules GPL

2008-01-23 Thread Rusty Russell
On Thursday 03 January 2008 08:01:32 Anthony Liguori wrote: The virtio modules do not advertise themselves as GPL but rely on exported GPL symbols. This makes them unloadable as modules. This patch adds the appropriate MODULE_LICENSE(). Hmm, this is already at the bottom of virtio_blk and

Re: [kvm-devel] [PATCH] KVM simplified virtio balloon driver

2008-01-23 Thread Rusty Russell
Here's the latest. Hope this works for everyone (putting in a oom handler or shrinker requires a lock, but can be done quite easily). Untested. === After discussions with Anthony Liguori, it seems that the virtio balloon can be made even simpler. Here's my attempt. Signed-off-by: Rusty Russell

Re: [kvm-devel] [PATCH] virtio: remove explicit pci ids from virtio_pci.c

2008-01-21 Thread Rusty Russell
On Monday 21 January 2008 20:12:46 Avi Kivity wrote: Anthony Liguori wrote: Rusty Russell wrote: Qumranet let us use their PCI vendor ID, with device ids = 0x1000. We can specify that we accept all of them in the device ID table, and then return -ENODEV in the probe routine. I thought

[kvm-devel] [PATCH] virtio: remove explicit pci ids from virtio_pci.c

2008-01-20 Thread Rusty Russell
the worst that can happen. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/virtio/virtio_pci.c |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff -r 4edff5e24614 drivers/virtio/virtio_pci.c --- a/drivers/virtio/virtio_pci.c Sun Jan 20 21:01:32 2008 +1100 +++ b

[kvm-devel] [PATCH] KVM simplified virtio balloon driver

2008-01-16 Thread Rusty Russell
, the target is best expressed in balloon size, since there is no portable way of getting the total RAM in the system. The host can do the math. Tested with a (fairly hacky) lguest patch. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/virtio/Kconfig | 10 + drivers/virtio

Re: [kvm-devel] virtio_net and SMP guests

2008-01-11 Thread Rusty Russell
On Friday 11 January 2008 02:51:58 Christian Borntraeger wrote: What about the following patch: Looks correct and in fact pretty orthodox. I've folded this in, thanks! Rusty. - Check out the new SourceForge.net

Re: [kvm-devel] virtio_net backport performance

2008-01-07 Thread Rusty Russell
On Saturday 05 January 2008 09:24:40 Anthony Liguori wrote: Hey Rusty et al, I've got automatic backports of the virtio modules[1] working back to 2.6.18. Everything seems okay except that for any kernel with the older NAPI api, performance is extremely bad. I get about 1gbit on TX with

Re: [kvm-devel] [RFC] Remove tx_timer from virtio_net

2008-01-07 Thread Rusty Russell
On Tuesday 08 January 2008 07:36:45 Anthony Liguori wrote: Avi and I were talking this afternoon and he suggested that we should remove the tx_timer from the virtio_net front-end and replace it with a tx_timer in the backend. Since the backend can suppress notifications, this is appealing

Re: [kvm-devel] virtio_net backport performance

2008-01-04 Thread Rusty Russell
On Saturday 05 January 2008 09:24:40 Anthony Liguori wrote: @@ -215,17 +231,40 @@ struct virtnet_info *vi = rvq-vdev-priv; /* Suppress further interrupts. */ rvq-vq_ops-disable_cb(rvq); +#ifdef COMPAT_napi +   vi-rvq-vq_ops-enable_cb(vi-rvq); +   if

Re: [kvm-devel] [PATCH] Use memset(0) instead of setting cb_mode explicitly

2008-01-03 Thread Rusty Russell
On Friday 04 January 2008 02:57:14 Anthony Liguori wrote: hrtimer's only have a cb_mode if CONFIG_HIGH_RES_TIMER is enabled. This patch memset()s the tx_timer structure to 0 which has the same effect as setting cb_mode to HRTIMER_CB_SOFTIRQ without requiring CONFIG_HIGH_RES_TIMER to be set.

Re: [kvm-devel] [PATCH 3/3] Use Qumranet donated PCI vendor/device IDs

2008-01-02 Thread Rusty Russell
On Thursday 03 January 2008 08:01:34 Anthony Liguori wrote: Qumranet was kind enough to donate a set of vendor/device IDs for virtio devices. This patch switches over to using them instead of an unreserved vendor ID. Signed-off-by: Anthony Liguori [EMAIL PROTECTED] All applied, thanks!

Re: [kvm-devel] virtio_net and SMP guests

2007-12-25 Thread Rusty Russell
On Tuesday 25 December 2007 23:22:37 Dor Laor wrote: btw: I checked your Linux tree and found it a bit old, there was no tx coalescing timer, it's probably good for 2.6.24. Do you plan to post patchset for 25 windows? Thanks, Dor Hmm, should be updated now. Will be pushing all these virtio

Re: [kvm-devel] virtio_net and SMP guests

2007-12-23 Thread Rusty Russell
On Monday 24 December 2007 10:19:19 Dor Laor wrote: Rusty Russell wrote: Looks good to me. The only thing is the naming.. Maybe one can find better name than [dis|en]able_cb since it is more like disable interrupts than disable_cb and enable_cb is more like run_callbacks (and enable

Re: [kvm-devel] [Virtio-for-kvm] [PATCH 13/13] [Mostly resend] virtio additions

2007-12-21 Thread Rusty Russell
On Saturday 22 December 2007 02:27:33 Dor Laor wrote: From 9f5a551d7e2a00eb019b158f8f3130e8176ec27c Mon Sep 17 00:00:00 2001 From: Dor Laor [EMAIL PROTECTED] Date: Mon, 17 Dec 2007 01:40:15 +0200 Subject: [PATCH] Update all status fields on driver unload OK, looks like I missed the last 4

Re: [kvm-devel] [virtio-net][PATCH] Don't arm tx hrtimer with a constant 500us each transmit

2007-12-17 Thread Rusty Russell
On Wednesday 12 December 2007 23:54:00 Dor Laor wrote: commit 763769621d271d92204ed27552d75448587c1ac0 Author: Dor Laor [EMAIL PROTECTED] Date: Wed Dec 12 14:52:00 2007 +0200 [virtio-net][PATCH] Don't arm tx hrtimer with a constant 50us each transmit The current start_xmit sets

Re: [kvm-devel] virtio_net and SMP guests

2007-12-17 Thread Rusty Russell
that virtio_net wants to disable callbacks (interrupts) before calling netif_rx_schedule(), so we can't use the return value to do so. Rename restart to cb_enable and introduce cb_disable hook: callback now returns void, rather than a boolean. Signed-off-by: Rusty Russell [EMAIL PROTECTED] diff -r

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-17 Thread Rusty Russell
on open. Signed-off-by: Rusty Russell [EMAIL PROTECTED] diff -r 1dd61213039c drivers/net/virtio_net.c --- a/drivers/net/virtio_net.c Tue Dec 18 17:34:18 2007 +1100 +++ b/drivers/net/virtio_net.c Tue Dec 18 17:47:39 2007 +1100 @@ -326,6 +326,13 @@ static int virtnet_open(struct net_devic

Re: [kvm-devel] [virtio-net][PATCH] Don't ar m tx hrtimer with a constant 500us each transmit

2007-12-17 Thread Rusty Russell
On Tuesday 18 December 2007 16:30:08 Avi Kivity wrote: Rusty Russell wrote: Yes, I pondered this when I wrote the code. On the one hand, it's a low-probability pathological corner case, on the other, your patch reduces the number of timer reprograms in the normal case. One thing

Re: [kvm-devel] [PATCH resend] virtio_net: remove double ether_setup

2007-12-11 Thread Rusty Russell
On Tuesday 11 December 2007 22:38:53 Christian Borntraeger wrote: Hello Rusty, this is a small fix for virtio_net. virtnet_probe already calls alloc_etherdev, which calls ether_setup. There is no need to do that again. Signed-off-by: Christian Borntraeger [EMAIL PROTECTED] Acked-by: Rusty

Re: [kvm-devel] [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets

2007-12-11 Thread Rusty Russell
On Wednesday 12 December 2007 00:16:12 Christian Borntraeger wrote: That would also work. We already have VRING_AVAIL_F_NO_INTERRUPT in virtio_ring.c - maybe we can use that. Its hidden in callback and restart handling, what about adding an explicit startup? Yes, I debated whether to make this

Re: [kvm-devel] [PATCH 7/24] consolidate msr.h

2007-11-20 Thread Rusty Russell
On Tuesday 20 November 2007 17:16:45 Steven Rostedt wrote: On Tue, 20 Nov 2007, Ingo Molnar wrote: i dont think there's ever any true need (and good cause) to force integer type casts like that at the callee site. Unless you mean we should do something like this: static inline void

Re: [kvm-devel] [PATCH 2/6] virtio block driver for QEMU (v2)

2007-11-12 Thread Rusty Russell
On Tuesday 13 November 2007 10:25:54 Anthony Liguori wrote: Dor Laor wrote: Anthony Liguori wrote: Dor Laor wrote: In general I think we need to add another feature or even version number ( I know you guys hate it). The reason is - Let's say you dont change functionality but change

Re: [kvm-devel] [PATCH] raise tsc clocksource rating

2007-10-30 Thread Rusty Russell
On Tuesday 30 October 2007 18:37:36 Ingo Molnar wrote: * Rusty Russell [EMAIL PROTECTED] wrote: No. tsc is very good, it's not perfect. If a paravirt clock registers 400 it really means pick me over the tsc. often the TSC is not perfect, but _IF_ it's perfect, using the paravirt driver

Re: [kvm-devel] [PATCH] raise tsc clocksource rating

2007-10-29 Thread Rusty Russell
On Tuesday 30 October 2007 09:17:38 Thomas Gleixner wrote: On Mon, 29 Oct 2007, Glauber de Oliveira Costa wrote: CC'ed John and removed [EMAIL PROTECTED] :) From: Glauber de Oliveira Costa [EMAIL PROTECTED] tsc is very good time source (when it does not have drifts, does not change

[kvm-devel] [PATCH 1/3] kvm_free_lapic() to pair with kvm_create_lapic()

2007-10-07 Thread Rusty Russell
-regs_page to zero before freeing apic. Signed-off-by: Rusty Russell [EMAIL PROTECTED] diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h index 11fc014..508280e 100644 --- a/drivers/kvm/irq.h +++ b/drivers/kvm/irq.h @@ -139,7 +139,7 @@ int kvm_apic_accept_pic_intr(struct kvm_vcpu *vcpu); int

[kvm-devel] [PATCH 2/3] Hoist kvm_create_lapic() into kvm_vcpu_init()

2007-10-07 Thread Rusty Russell
Move kvm_create_lapic() into kvm_vcpu_init(), rather than having svm and vmx do it. And make it return the error rather than a fairly random -ENOMEM. This also solves the problem that neither svm.c nor vmx.c actually handles the error path properly. Signed-off-by: Rusty Russell [EMAIL PROTECTED

[kvm-devel] [PATCH 3/3] Remove gratuitous casts from lapic.c

2007-10-07 Thread Rusty Russell
Since vcpu-apic is of the correct type, there's not need to cast. Perhaps this will be required in future? Signed-off-by: Rusty Russell [EMAIL PROTECTED] diff --git a/drivers/kvm/lapic.c b/drivers/kvm/lapic.c index 27e6249..68aa9e4 100644 --- a/drivers/kvm/lapic.c +++ b/drivers/kvm/lapic.c

Re: [kvm-devel] [RFC] KVM Source layout Proposal to accommodate new CPU architecture

2007-10-02 Thread Rusty Russell
On Tue, 2007-10-02 at 01:01 -0500, Hollis Blanchard wrote: On Tue, 2007-10-02 at 14:11 +1000, Rusty Russell wrote: On Tue, 2007-10-02 at 01:19 +, Hollis Blanchard wrote: On Sun, 30 Sep 2007 15:56:16 +0200, Avi Kivity wrote: Eventually I'd like to see the code in arch/*/kvm

[kvm-devel] Backwards compat for 2.6.16?

2007-10-02 Thread Rusty Russell
Hi all, The lapic code uses ktime_t and hrtimers, which means we no longer build for kernels 2.6.15 and below. Is it worth trying to fake this infrastructure up, building without lapic, or abandoning 2.6.16? Thanks, Rusty.

[kvm-devel] [PATCH] Script to help check compatibility against a range of kernels.

2007-10-02 Thread Rusty Russell
This makes it easier to check kvm-userspace compatibility layer. --- check-compat.sh | 27 +++ 1 files changed, 27 insertions(+), 0 deletions(-) create mode 100755 check-compat.sh diff --git a/check-compat.sh b/check-compat.sh new file mode 100755 index

Re: [kvm-devel] [RFC] KVM Source layout Proposal to accommodate new CPU architecture

2007-10-01 Thread Rusty Russell
On Tue, 2007-10-02 at 01:19 +, Hollis Blanchard wrote: On Sun, 30 Sep 2007 15:56:16 +0200, Avi Kivity wrote: Eventually I'd like to see the code in arch/*/kvm. That's probably not easily doable right now because modules cannot span directories, but once that's solved, we'll do

[kvm-devel] [PATCH] kvm-userspace: fix kzalloc macro

2007-10-01 Thread Rusty Russell
This was committed in 1d55c096cce99f069d9ac8e3b2195d45adce9549 on Feb 7, and clearly never actually compiled. --- kernel/external-module-compat.h |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/external-module-compat.h b/kernel/external-module-compat.h index

Re: [kvm-devel] [RFC] KVM Source layout Proposal to accommodate new CPU architecture

2007-09-29 Thread Rusty Russell
On Thu, 2007-09-27 at 11:18 +0200, Avi Kivity wrote: The whole drivers/kvm/ thing was just a trick to get merged quickly. I think the new layout should be something like virt/kvm/, include/linux/kvm*.h - common code virt/lguest/ - the other hypervisor virt/virtio/ - shared I/O

Re: [kvm-devel] [PATCH 1/3] virtio interface

2007-09-25 Thread Rusty Russell
On Tue, 2007-09-25 at 08:36 +0200, Arnd Bergmann wrote: On Tuesday 25 September 2007, Rusty Russell wrote: I don't mind: we could expose it. What I mean with setting the parent appropriately is not to have a global device that is used by the hv-specific probing code, but to make sure

Re: [kvm-devel] [PATCH 2/3] virtio ring implementation

2007-09-25 Thread Rusty Russell
On Tue, 2007-09-25 at 19:15 +0200, Dor Laor wrote: At the moment it's not good enough, there is a potential race were the guest optimistically turn off the VRING_AVAIL_F_NO_INTERRUPT in the vring_restart and afterwards finds there are more_used so it consume them in the poll function. If in

[kvm-devel] [PATCH 0/3] virtio implementation (draft VI)

2007-09-24 Thread Rusty Russell
I'm not reposting the drivers this time since they haven't changed significantly. See http://lguest.ozlabs.org/patches for the whole thing, from new-io.patch onwards). Changes since last version: - Switch to our own bus implementation, rather than relying on an

[kvm-devel] [PATCH 1/3] virtio interface

2007-09-24 Thread Rusty Russell
are invoked. There is also a generic implementation of config space which drivers can query to get setup information from the host. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/Kconfig |2 drivers/Makefile|1 drivers/virtio/Kconfig

[kvm-devel] [PATCH 2/3] virtio ring implementation

2007-09-24 Thread Rusty Russell
(KVM wants the guest to allocate the rings, lguest does it sanely). Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- arch/i386/lguest/Kconfig |1 drivers/virtio/Kconfig |5 drivers/virtio/Makefile |1 drivers/virtio/virtio_ring.c | 316

[kvm-devel] [PATCH 3/3] virtio module alias support

2007-09-24 Thread Rusty Russell
This adds the logic to convert the virtio ids into module aliases, and includes a modalias entry in sysfs. Unfortunately this does not seem sufficient to have the module autoprobed at startup on my Ubuntu system. Greg? Am I missing some udev magic? Signed-off-by: Rusty Russell [EMAIL PROTECTED

Re: [kvm-devel] [PATCH 2/3] virtio ring implementation

2007-09-24 Thread Rusty Russell
On Mon, 2007-09-24 at 15:44 +0200, Dor Laor wrote: Seems like there is a problem with shared irq line, the interrupt handler always returns IRQ_HANDLED (except for the trivial case were the callback is null). It can be solved by having a host irq counter (in the shared ring) and a guest irq

Re: [kvm-devel] [PATCH 3/3] virtio module alias support

2007-09-24 Thread Rusty Russell
On Mon, 2007-09-24 at 09:02 -0700, Greg KH wrote: On Mon, Sep 24, 2007 at 07:16:34PM +1000, Rusty Russell wrote: This adds the logic to convert the virtio ids into module aliases, and includes a modalias entry in sysfs. Unfortunately this does not seem sufficient to have the module

Re: [kvm-devel] [PATCH 3/3] virtio module alias support

2007-09-24 Thread Rusty Russell
On Mon, 2007-09-24 at 18:57 -0700, Greg KH wrote: On Tue, Sep 25, 2007 at 10:50:04AM +1000, Rusty Russell wrote: Not sure why I need the modalias here when it's in sysfs. But, it works. udev does not read from sysfs anymore, it just uses the environment variables. It's faster and race

Re: [kvm-devel] [PATCH 4/6] virtio block driver

2007-09-23 Thread Rusty Russell
On Fri, 2007-09-21 at 14:27 +0200, Jens Axboe wrote: On Fri, Sep 21 2007, Rusty Russell wrote: I shall look through the code and see if I can figure out how to fix it. I'm assuming from your response that there's not some strange reason to preserve current behaviour. It surely sounds

Re: [kvm-devel] [PATCH 3/6] virtio net driver

2007-09-23 Thread Rusty Russell
On Fri, 2007-09-21 at 16:42 +0200, Christian Borntraeger wrote: Am Freitag, 21. September 2007 schrieb Herbert Xu: Please don't use LLTX in new drivers. We're trying to get rid of it since it's 1) unnecessary; 2) causes problems with AF_PACKET seeing things twice. Ok, but then I

Re: [kvm-devel] [PATCH 1/6] virtio interace

2007-09-23 Thread Rusty Russell
On Sat, 2007-09-22 at 12:01 +0200, Arnd Bergmann wrote: On Saturday 22 September 2007, Rusty Russell wrote: But now each virtio device has two struct devices, not one. And you've made up a fictional bus to do it. Yet for PCI systems, it really is a PCI device; exposing a second bus

Re: [kvm-devel] [PATCH 6/6] virtio ring helper

2007-09-23 Thread Rusty Russell
On Sun, 2007-09-23 at 12:05 +0200, Avi Kivity wrote: Rusty Russell wrote: On Thu, 2007-09-20 at 14:43 +0200, Avi Kivity wrote: 32 bits of page numbers give 44 bits of physical address on x86. That's 16TB per guest. Admittedly it's smaller on a VAX. I like to feel that I make

Re: [kvm-devel] [PATCH -rc][RESEND] KVM: Fix virtualization menu help text

2007-09-22 Thread Rusty Russell
On Sat, 2007-09-22 at 14:43 +0200, Avi Kivity wrote: What guest drivers? Cc: Jan Engelhardt [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] Yes, agreed. Rusty. - This SF.net email is sponsored by:

Re: [kvm-devel] [PATCH 2/6] virtio_config

2007-09-21 Thread Rusty Russell
On Thu, 2007-09-20 at 14:55 +0200, Avi Kivity wrote: Avi Kivity wrote: Rusty Russell wrote: Previous versions of virtio didn't commonalize probing. For every driver, every virtio implementation (KVM, lguest, etc) needed an in-kernel stub to join their bus to the probe code. To solve

Re: [kvm-devel] [PATCH 6/6] virtio ring helper

2007-09-21 Thread Rusty Russell
On Thu, 2007-09-20 at 14:43 +0200, Avi Kivity wrote: Rusty Russell wrote: These helper routines supply most of the virtqueue_ops for hypervisors which want to use a ring for virtio. Unlike the previous lguest implementation: 3) The page numbers are always 64 bit (PAE anyone

Re: [kvm-devel] [PATCH 4/6] virtio block driver

2007-09-21 Thread Rusty Russell
On Thu, 2007-09-20 at 14:27 +0200, Jens Axboe wrote: On Thu, Sep 20 2007, Rusty Russell wrote: The block driver uses scatter-gather lists with sg[0] being the request information (struct virtio_blk_outhdr) with the type, sector and inbuf id. The next N sg entries are the bio itself

Re: [kvm-devel] [PATCH 4/6] virtio block driver

2007-09-21 Thread Rusty Russell
On Thu, 2007-09-20 at 15:05 +0200, Jens Axboe wrote: On Thu, Sep 20 2007, Rusty Russell wrote: +static void end_dequeued_request(struct request *req, +struct request_queue *q, int uptodate) +{ + /* And so the insanity of the block layer infects us here

Re: [kvm-devel] [PATCH 1/6] virtio interace

2007-09-21 Thread Rusty Russell
On Fri, 2007-09-21 at 14:05 +0200, Arnd Bergmann wrote: On Thursday 20 September 2007, Rusty Russell wrote: +int register_virtio_driver(struct virtio_driver *drv); +void unregister_virtio_driver(struct virtio_driver *drv); + +/* The particular virtio backend supplies these. */ +struct

[kvm-devel] [PATCH 6/6] virtio ring helper

2007-09-20 Thread Rusty Russell
-off-by: Rusty Russell [EMAIL PROTECTED] --- arch/i386/lguest/Kconfig |1 drivers/virtio/Kconfig |5 drivers/virtio/Makefile |1 drivers/virtio/virtio_ring.c | 301 ++ drivers/virtio/vring.h | 50 ++ include/linux

Re: [kvm-devel] [PATCH 048/104] KVM: Add and use pr_unimpl for standard formatting of unimplemented features

2007-09-17 Thread Rusty Russell
On Mon, 2007-09-17 at 09:16 -0700, Joe Perches wrote: On Mon, 2007-09-17 at 10:31 +0200, Avi Kivity wrote: diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index cfda3ab..6d25826 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -474,6 +474,14 @@ struct kvm_arch_ops {

Re: [kvm-devel] virtio hypercall interface?

2007-09-16 Thread Rusty Russell
On Sun, 2007-09-16 at 10:57 +0200, Avi Kivity wrote: Rusty Russell wrote: On Sat, 2007-09-15 at 12:38 +0300, Avi Kivity wrote: I don't see why there is a difference. With mmio, the host tells the guest where the ring is. With dma, the guest tells the host where the ring

Re: [kvm-devel] virtio hypercall interface?

2007-09-15 Thread Rusty Russell
On Sat, 2007-09-15 at 11:05 +0300, Avi Kivity wrote: Rusty Russell wrote: On Sat, 2007-09-15 at 01:31 +0300, Dor Laor wrote: Second, regardless of the channel signal notification, there are still real necessities for userspace hypercall handling: 1. For virtio drivers there is also

Re: [kvm-devel] [PATCH] Refactor hypercall infrastructure

2007-09-14 Thread Rusty Russell
On Fri, 2007-09-14 at 13:53 -0700, Jeremy Fitzhardinge wrote: Anthony Liguori wrote: This patch refactors the current hypercall infrastructure to better support live migration and SMP. It eliminates the hypercall page by trapping the UD exception that would occur if you used the wrong

Re: [kvm-devel] virtio hypercall interface?

2007-09-14 Thread Rusty Russell
On Sat, 2007-09-15 at 01:31 +0300, Dor Laor wrote: Second, regardless of the channel signal notification, there are still real necessities for userspace hypercall handling: 1. For virtio drivers there is also registration hypercall for passing the shared memory pfns. Sure there are

[kvm-devel] virtio hypercall interface?

2007-09-13 Thread Rusty Russell
Hi all, I've finally started looking at Dor's git tree, and it struck me that it conflicts with Anthony's hypercall patches. FWIW I like Anthony's patching thing, and don't really care about arg order. It'd be nice if we could pull in the same direction tho 8) Thanks, Rusty.

Re: [kvm-devel] virtio hypercall interface?

2007-09-13 Thread Rusty Russell
On Thu, 2007-09-13 at 14:21 -0500, Anthony Liguori wrote: Rusty Russell wrote: Hi all, I've finally started looking at Dor's git tree, and it struck me that it conflicts with Anthony's hypercall patches. FWIW I like Anthony's patching thing, and don't really care about arg order

[kvm-devel] [PATCH 1/5] Clean up unloved invlpg: remove kvm_arch_ops.invlpg and tweak emulator.

2007-09-05 Thread Rusty Russell
. Signed-off-by: Rusty Russell [EMAIL PROTECTED] diff -r 01dea2154ac6 drivers/kvm/kvm.h --- a/drivers/kvm/kvm.h Tue Aug 21 10:11:26 2007 +1000 +++ b/drivers/kvm/kvm.h Thu Aug 30 11:17:45 2007 +1000 @@ -459,7 +460,6 @@ struct kvm_arch_ops { unsigned long (*get_rflags)(struct kvm_vcpu *vcpu

[kvm-devel] [PATCH 2/5] Keep control regs in sync

2007-09-05 Thread Rusty Russell
We don't update the vcpu control registers in various places. We should do so. Signed-off-by: Rusty Russell [EMAIL PROTECTED] diff -r 039995825488 drivers/kvm/kvm_main.c --- a/drivers/kvm/kvm_main.cFri Aug 31 15:38:42 2007 +1000 +++ b/drivers/kvm/kvm_main.cTue Sep 04 10:30:56 2007 +1000

[kvm-devel] [PATCH 3/5] Hoist SVM's get_cs_db_l_bits into core code.

2007-09-05 Thread Rusty Russell
SVM gets the DB and L bits for the cs by decoding the segment. This is in fact the completely generic code, so hoist it for kvm-lite to use. Signed-off-by: Rusty Russell [EMAIL PROTECTED] diff -r 01dea2154ac6 drivers/kvm/kvm.h --- a/drivers/kvm/kvm.h Tue Aug 21 10:11:26 2007 +1000 +++ b/drivers

[kvm-devel] [PATCH 5/5] kvm-lite qemu patch

2007-09-05 Thread Rusty Russell
-M pclite requires -kernel, requires kvm. Also changes --enable-kvm to --disable-kvm (it's enabled on supported archs, so we need a disable not an enable flag). index d9292fe..bf4c8ba 100755 --- a/configure +++ b/configure @@ -84,7 +84,7 @@ target_cpu() { (cd qemu; ./configure

Re: [kvm-devel] [PATCH 4/5] kvm-lite: The Unbearable Liteness

2007-09-05 Thread Rusty Russell
On Wed, 2007-09-05 at 10:47 -0500, Anthony Liguori wrote: On Thu, 2007-09-06 at 01:42 +1000, Rusty Russell wrote: This patch is not for serious application, but makes interesting reading. Requires Anthony's new hypercall patches. Comments: 1) asm-offsets are required for lite's

Re: [kvm-devel] [PATCH 1/5] Clean up unloved invlpg: remove kvm_arch_ops.invlpg and tweak emulator.

2007-09-05 Thread Rusty Russell
On Wed, 2007-09-05 at 18:30 +0300, Avi Kivity wrote: Rusty Russell wrote: invlpg shouldn't fetch the src address, since it may not be valid, however SVM's solution which neuters emulation of all group 7 instruction is horrible and breaks kvm-lite. The simplest fix is to put a special

Re: [kvm-devel] [PATCH 5/5] kvm-lite qemu patch

2007-09-05 Thread Rusty Russell
On Wed, 2007-09-05 at 20:02 +0300, Avi Kivity wrote: Rusty Russell wrote: +QEMUMachine pclite_machine = { +pclite, +kvm-lite PC, +pc_init_lite, +}; +#endif /* USE_KVM */ + Most of this hunk should go into a separate file. This currently doesn't use much of the rest

Re: [kvm-devel] [PATCH][RFC] pte notifiers -- support for external page tables

2007-09-05 Thread Rusty Russell
On Wed, 2007-09-05 at 22:32 +0300, Avi Kivity wrote: [resend due to bad alias expansion resulting in some recipients being bogus] Some hardware and software systems maintain page tables outside the normal Linux page tables, which reference userspace memory. This includes Infiniband, other

  1   2   3   >