kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] kvm tools: virtio-balloon fix and cleaning
@ 2012-10-24 12:51 William Dauchy
  2012-10-24 12:51 ` [PATCH 1/5] kvm tools: check ioctl return value for msi signal William Dauchy
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: William Dauchy @ 2012-10-24 12:51 UTC (permalink / raw)
  To: penberg; +Cc: kvm, levinsasha928, William Dauchy

Hi,

This set of patches fixes the virtio ballooning and also clean a few non
important things around ballooning functionnality.
Tested on top of a v3.6.3 for both guest and host.

William Dauchy (5):
  kvm tools: check ioctl return value for msi signal
  kvm tools: use the correct config vector interrupt
  kvm tools: correctly handle mem ballooning
  kvm tools: initialize msi flags to zero even is not used yet
  kvm tools: specify in help the amount to balloon is in MB

 tools/kvm/builtin-balloon.c |    4 ++--
 tools/kvm/virtio/balloon.c  |    8 ++++----
 tools/kvm/virtio/pci.c      |    7 +++++--
 3 files changed, 11 insertions(+), 8 deletions(-)

-- 
William


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

* [PATCH 1/5] kvm tools: check ioctl return value for msi signal
  2012-10-24 12:51 [PATCH 0/5] kvm tools: virtio-balloon fix and cleaning William Dauchy
@ 2012-10-24 12:51 ` William Dauchy
  2012-10-25  7:01   ` Pekka Enberg
  2012-10-24 12:51 ` [PATCH 2/5] kvm tools: use the correct config vector interrupt William Dauchy
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 17+ messages in thread
From: William Dauchy @ 2012-10-24 12:51 UTC (permalink / raw)
  To: penberg; +Cc: kvm, levinsasha928, William Dauchy

Signed-off-by: William Dauchy <william@gandi.net>
---
 tools/kvm/virtio/pci.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c
index b6ac571..ab1119a 100644
--- a/tools/kvm/virtio/pci.c
+++ b/tools/kvm/virtio/pci.c
@@ -245,7 +245,9 @@ static void virtio_pci__signal_msi(struct kvm *kvm, struct virtio_pci *vpci, int
 		.data = vpci->msix_table[vec].msg.data,
 	};
 
-	ioctl(kvm->vm_fd, KVM_SIGNAL_MSI, &msi);
+	if (ioctl(kvm->vm_fd, KVM_SIGNAL_MSI, &msi) < 0) {
+		pr_warning("Config pci device error: %s", strerror(errno));
+	}
 }
 
 int virtio_pci__signal_vq(struct kvm *kvm, struct virtio_device *vdev, u32 vq)
-- 
1.7.10.4


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

* [PATCH 2/5] kvm tools: use the correct config vector interrupt
  2012-10-24 12:51 [PATCH 0/5] kvm tools: virtio-balloon fix and cleaning William Dauchy
  2012-10-24 12:51 ` [PATCH 1/5] kvm tools: check ioctl return value for msi signal William Dauchy
@ 2012-10-24 12:51 ` William Dauchy
  2012-10-25  7:03   ` Pekka Enberg
  2012-10-24 12:51 ` [PATCH 3/5] kvm tools: correctly handle mem ballooning William Dauchy
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 17+ messages in thread
From: William Dauchy @ 2012-10-24 12:51 UTC (permalink / raw)
  To: penberg; +Cc: kvm, levinsasha928, William Dauchy

when registering the config interrupt, the later is registered in
vcpi->config_vector and not in vpci->vq_vector

introduced in:
a841f15 kvm tools: Use the new KVM_SIGNAL_MSI ioctl to inject
interrupts directly.

Signed-off-by: William Dauchy <william@gandi.net>
---
 tools/kvm/virtio/pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c
index ab1119a..f4ea3c9 100644
--- a/tools/kvm/virtio/pci.c
+++ b/tools/kvm/virtio/pci.c
@@ -288,7 +288,7 @@ int virtio_pci__signal_config(struct kvm *kvm, struct virtio_device *vdev)
 		}
 
 		if (vpci->features & VIRTIO_PCI_F_SIGNAL_MSI)
-			virtio_pci__signal_msi(kvm, vpci, vpci->vq_vector[vpci->config_vector]);
+			virtio_pci__signal_msi(kvm, vpci, vpci->config_vector);
 		else
 			kvm__irq_trigger(kvm, vpci->config_gsi);
 	} else {
-- 
1.7.10.4


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

* [PATCH 3/5] kvm tools: correctly handle mem ballooning
  2012-10-24 12:51 [PATCH 0/5] kvm tools: virtio-balloon fix and cleaning William Dauchy
  2012-10-24 12:51 ` [PATCH 1/5] kvm tools: check ioctl return value for msi signal William Dauchy
  2012-10-24 12:51 ` [PATCH 2/5] kvm tools: use the correct config vector interrupt William Dauchy
@ 2012-10-24 12:51 ` William Dauchy
  2012-10-24 17:43   ` Sasha Levin
  2012-10-24 12:51 ` [PATCH 4/5] kvm tools: initialize msi flags to zero even is not used yet William Dauchy
  2012-10-24 12:51 ` [PATCH 5/5] kvm tools: specify the amount to balloon is in MB William Dauchy
  4 siblings, 1 reply; 17+ messages in thread
From: William Dauchy @ 2012-10-24 12:51 UTC (permalink / raw)
  To: penberg; +Cc: kvm, levinsasha928, William Dauchy

from the virtio_balloon.h:
num_pages is the number of pages host wants Guest to give up.

Our implementation is doing the reverse, resulting in decreasing pages
when increasing needed and so on.
Reverse the implementation.

Signed-off-by: William Dauchy <william@gandi.net>
---
 tools/kvm/virtio/balloon.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/kvm/virtio/balloon.c b/tools/kvm/virtio/balloon.c
index e08f628..2201b9f 100644
--- a/tools/kvm/virtio/balloon.c
+++ b/tools/kvm/virtio/balloon.c
@@ -162,12 +162,12 @@ static void handle_mem(struct kvm *kvm, int fd, u32 type, u32 len, u8 *msg)
 
 	mem = *(int *)msg;
 	if (mem > 0) {
-		bdev.config.num_pages += 256 * mem;
-	} else if (mem < 0) {
-		if (bdev.config.num_pages < (u32)(256 * (-mem)))
+		if (bdev.config.num_pages < ((u32)(256 * mem)))
 			return;
 
-		bdev.config.num_pages += 256 * mem;
+		bdev.config.num_pages -= 256 * mem;
+	} else if (mem < 0) {
+		bdev.config.num_pages -= 256 * mem;
 	}
 
 	/* Notify that the configuration space has changed */
-- 
1.7.10.4


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

* [PATCH 4/5] kvm tools: initialize msi flags to zero even is not used yet
  2012-10-24 12:51 [PATCH 0/5] kvm tools: virtio-balloon fix and cleaning William Dauchy
                   ` (2 preceding siblings ...)
  2012-10-24 12:51 ` [PATCH 3/5] kvm tools: correctly handle mem ballooning William Dauchy
@ 2012-10-24 12:51 ` William Dauchy
  2012-10-25  7:07   ` Pekka Enberg
  2012-10-24 12:51 ` [PATCH 5/5] kvm tools: specify the amount to balloon is in MB William Dauchy
  4 siblings, 1 reply; 17+ messages in thread
From: William Dauchy @ 2012-10-24 12:51 UTC (permalink / raw)
  To: penberg; +Cc: kvm, levinsasha928, William Dauchy

kvm explictly checks if msi flags is equal to zero before going
further; just make sure it is correctly initialized.

Signed-off-by: William Dauchy <william@gandi.net>
---
 tools/kvm/virtio/pci.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c
index f4ea3c9..02970fc 100644
--- a/tools/kvm/virtio/pci.c
+++ b/tools/kvm/virtio/pci.c
@@ -243,6 +243,7 @@ static void virtio_pci__signal_msi(struct kvm *kvm, struct virtio_pci *vpci, int
 		.address_lo = vpci->msix_table[vec].msg.address_lo,
 		.address_hi = vpci->msix_table[vec].msg.address_hi,
 		.data = vpci->msix_table[vec].msg.data,
+		.flags = 0,
 	};
 
 	if (ioctl(kvm->vm_fd, KVM_SIGNAL_MSI, &msi) < 0) {
-- 
1.7.10.4


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

* [PATCH 5/5] kvm tools: specify the amount to balloon is in MB
  2012-10-24 12:51 [PATCH 0/5] kvm tools: virtio-balloon fix and cleaning William Dauchy
                   ` (3 preceding siblings ...)
  2012-10-24 12:51 ` [PATCH 4/5] kvm tools: initialize msi flags to zero even is not used yet William Dauchy
@ 2012-10-24 12:51 ` William Dauchy
  2012-10-25  7:10   ` Pekka Enberg
  4 siblings, 1 reply; 17+ messages in thread
From: William Dauchy @ 2012-10-24 12:51 UTC (permalink / raw)
  To: penberg; +Cc: kvm, levinsasha928, William Dauchy

Signed-off-by: William Dauchy <william@gandi.net>
---
 tools/kvm/builtin-balloon.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/kvm/builtin-balloon.c b/tools/kvm/builtin-balloon.c
index 5bd2291..d158ace 100644
--- a/tools/kvm/builtin-balloon.c
+++ b/tools/kvm/builtin-balloon.c
@@ -22,8 +22,8 @@ static const struct option balloon_options[] = {
 	OPT_GROUP("Instance options:"),
 	OPT_STRING('n', "name", &instance_name, "name", "Instance name"),
 	OPT_GROUP("Balloon options:"),
-	OPT_U64('i', "inflate", &inflate, "Amount to inflate"),
-	OPT_U64('d', "deflate", &deflate, "Amount to deflate"),
+	OPT_U64('i', "inflate", &inflate, "Amount to inflate (in MB)"),
+	OPT_U64('d', "deflate", &deflate, "Amount to deflate (in MB)"),
 	OPT_END(),
 };
 
-- 
1.7.10.4


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

* Re: [PATCH 3/5] kvm tools: correctly handle mem ballooning
  2012-10-24 12:51 ` [PATCH 3/5] kvm tools: correctly handle mem ballooning William Dauchy
@ 2012-10-24 17:43   ` Sasha Levin
  2012-10-24 17:50     ` William Dauchy
  0 siblings, 1 reply; 17+ messages in thread
From: Sasha Levin @ 2012-10-24 17:43 UTC (permalink / raw)
  To: William Dauchy; +Cc: penberg, kvm

This one was actually correct originally.

When we inflate (-i) the balloon we increase num_pages, which is a
counter of how many pages the balloon has.


Thanks,
Sasha

On Wed, Oct 24, 2012 at 8:51 AM, William Dauchy <william@gandi.net> wrote:
> from the virtio_balloon.h:
> num_pages is the number of pages host wants Guest to give up.
>
> Our implementation is doing the reverse, resulting in decreasing pages
> when increasing needed and so on.
> Reverse the implementation.
>
> Signed-off-by: William Dauchy <william@gandi.net>
> ---
>  tools/kvm/virtio/balloon.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/kvm/virtio/balloon.c b/tools/kvm/virtio/balloon.c
> index e08f628..2201b9f 100644
> --- a/tools/kvm/virtio/balloon.c
> +++ b/tools/kvm/virtio/balloon.c
> @@ -162,12 +162,12 @@ static void handle_mem(struct kvm *kvm, int fd, u32 type, u32 len, u8 *msg)
>
>         mem = *(int *)msg;
>         if (mem > 0) {
> -               bdev.config.num_pages += 256 * mem;
> -       } else if (mem < 0) {
> -               if (bdev.config.num_pages < (u32)(256 * (-mem)))
> +               if (bdev.config.num_pages < ((u32)(256 * mem)))
>                         return;
>
> -               bdev.config.num_pages += 256 * mem;
> +               bdev.config.num_pages -= 256 * mem;
> +       } else if (mem < 0) {
> +               bdev.config.num_pages -= 256 * mem;
>         }
>
>         /* Notify that the configuration space has changed */
> --
> 1.7.10.4
>

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

* Re: [PATCH 3/5] kvm tools: correctly handle mem ballooning
  2012-10-24 17:43   ` Sasha Levin
@ 2012-10-24 17:50     ` William Dauchy
  0 siblings, 0 replies; 17+ messages in thread
From: William Dauchy @ 2012-10-24 17:50 UTC (permalink / raw)
  To: Sasha Levin; +Cc: William Dauchy, penberg, kvm

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

On Oct24 13:43, Sasha Levin wrote:
> This one was actually correct originally.
> 
> When we inflate (-i) the balloon we increase num_pages, which is a
> counter of how many pages the balloon has.

Sorry, I misunderstood the option; please ignore this patch.

Thanks,
-- 
William

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH 1/5] kvm tools: check ioctl return value for msi signal
  2012-10-24 12:51 ` [PATCH 1/5] kvm tools: check ioctl return value for msi signal William Dauchy
@ 2012-10-25  7:01   ` Pekka Enberg
  2012-10-25  9:15     ` William Dauchy
  0 siblings, 1 reply; 17+ messages in thread
From: Pekka Enberg @ 2012-10-25  7:01 UTC (permalink / raw)
  To: William Dauchy; +Cc: kvm, levinsasha928, mingo, asias.hejun, gorcunov

On Wed, 24 Oct 2012, William Dauchy wrote:
> Signed-off-by: William Dauchy <william@gandi.net>
> ---
>  tools/kvm/virtio/pci.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c
> index b6ac571..ab1119a 100644
> --- a/tools/kvm/virtio/pci.c
> +++ b/tools/kvm/virtio/pci.c
> @@ -245,7 +245,9 @@ static void virtio_pci__signal_msi(struct kvm *kvm, struct virtio_pci *vpci, int
>  		.data = vpci->msix_table[vec].msg.data,
>  	};
>  
> -	ioctl(kvm->vm_fd, KVM_SIGNAL_MSI, &msi);
> +	if (ioctl(kvm->vm_fd, KVM_SIGNAL_MSI, &msi) < 0) {
> +		pr_warning("Config pci device error: %s", strerror(errno));
> +	}
>  }

Is this something that happens on your machine? I wonder if it makes more 
sense to return the error from virtio_pci__signal_vq() and 
virtio_pci__signal_config() and make the callers deal with it.

			Pekka

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

* Re: [PATCH 2/5] kvm tools: use the correct config vector interrupt
  2012-10-24 12:51 ` [PATCH 2/5] kvm tools: use the correct config vector interrupt William Dauchy
@ 2012-10-25  7:03   ` Pekka Enberg
  2012-10-25 19:20     ` Sasha Levin
  0 siblings, 1 reply; 17+ messages in thread
From: Pekka Enberg @ 2012-10-25  7:03 UTC (permalink / raw)
  To: William Dauchy; +Cc: kvm, levinsasha928, mingo, asias.hejun, gorcunov

On Wed, 24 Oct 2012, William Dauchy wrote:
> when registering the config interrupt, the later is registered in
> vcpi->config_vector and not in vpci->vq_vector
> 
> introduced in:
> a841f15 kvm tools: Use the new KVM_SIGNAL_MSI ioctl to inject
> interrupts directly.
> 
> Signed-off-by: William Dauchy <william@gandi.net>
> ---
>  tools/kvm/virtio/pci.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c
> index ab1119a..f4ea3c9 100644
> --- a/tools/kvm/virtio/pci.c
> +++ b/tools/kvm/virtio/pci.c
> @@ -288,7 +288,7 @@ int virtio_pci__signal_config(struct kvm *kvm, struct virtio_device *vdev)
>  		}
>  
>  		if (vpci->features & VIRTIO_PCI_F_SIGNAL_MSI)
> -			virtio_pci__signal_msi(kvm, vpci, vpci->vq_vector[vpci->config_vector]);
> +			virtio_pci__signal_msi(kvm, vpci, vpci->config_vector);
>  		else
>  			kvm__irq_trigger(kvm, vpci->config_gsi);
>  	} else {

Sasha?

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

* Re: [PATCH 4/5] kvm tools: initialize msi flags to zero even is not used yet
  2012-10-24 12:51 ` [PATCH 4/5] kvm tools: initialize msi flags to zero even is not used yet William Dauchy
@ 2012-10-25  7:07   ` Pekka Enberg
  2012-10-25  9:17     ` William Dauchy
  0 siblings, 1 reply; 17+ messages in thread
From: Pekka Enberg @ 2012-10-25  7:07 UTC (permalink / raw)
  To: William Dauchy; +Cc: kvm, levinsasha928

On Wed, 24 Oct 2012, William Dauchy wrote:
> kvm explictly checks if msi flags is equal to zero before going
> further; just make sure it is correctly initialized.
> 
> Signed-off-by: William Dauchy <william@gandi.net>
> ---
>  tools/kvm/virtio/pci.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c
> index f4ea3c9..02970fc 100644
> --- a/tools/kvm/virtio/pci.c
> +++ b/tools/kvm/virtio/pci.c
> @@ -243,6 +243,7 @@ static void virtio_pci__signal_msi(struct kvm *kvm, struct virtio_pci *vpci, int
>  		.address_lo = vpci->msix_table[vec].msg.address_lo,
>  		.address_hi = vpci->msix_table[vec].msg.address_hi,
>  		.data = vpci->msix_table[vec].msg.data,
> +		.flags = 0,
>  	};
>  
>  	if (ioctl(kvm->vm_fd, KVM_SIGNAL_MSI, &msi) < 0) {

It is initialized to zero by default as per C struct initialization, isn't 
it? Does this fix a problem you are experiencing?

			Pekka

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

* Re: [PATCH 5/5] kvm tools: specify the amount to balloon is in MB
  2012-10-24 12:51 ` [PATCH 5/5] kvm tools: specify the amount to balloon is in MB William Dauchy
@ 2012-10-25  7:10   ` Pekka Enberg
  0 siblings, 0 replies; 17+ messages in thread
From: Pekka Enberg @ 2012-10-25  7:10 UTC (permalink / raw)
  To: William Dauchy; +Cc: kvm, levinsasha928, michael, matt


> Signed-off-by: William Dauchy <william@gandi.net>
> ---
>  tools/kvm/builtin-balloon.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/kvm/builtin-balloon.c b/tools/kvm/builtin-balloon.c
> index 5bd2291..d158ace 100644
> --- a/tools/kvm/builtin-balloon.c
> +++ b/tools/kvm/builtin-balloon.c
> @@ -22,8 +22,8 @@ static const struct option balloon_options[] = {
>  	OPT_GROUP("Instance options:"),
>  	OPT_STRING('n', "name", &instance_name, "name", "Instance name"),
>  	OPT_GROUP("Balloon options:"),
> -	OPT_U64('i', "inflate", &inflate, "Amount to inflate"),
> -	OPT_U64('d', "deflate", &deflate, "Amount to deflate"),
> +	OPT_U64('i', "inflate", &inflate, "Amount to inflate (in MB)"),
> +	OPT_U64('d', "deflate", &deflate, "Amount to deflate (in MB)"),
>  	OPT_END(),
>  };

Applied, thanks!

Btw, looks like tools/kvm/virtio/ballon.c::handle_mem() is broken on 
architectures that don't use 4K pages. I'm happy to apply a patch that 
fixes it :-)

			Pekka

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

* Re: [PATCH 1/5] kvm tools: check ioctl return value for msi signal
  2012-10-25  7:01   ` Pekka Enberg
@ 2012-10-25  9:15     ` William Dauchy
  2012-10-25 19:18       ` Sasha Levin
  0 siblings, 1 reply; 17+ messages in thread
From: William Dauchy @ 2012-10-25  9:15 UTC (permalink / raw)
  To: Pekka Enberg
  Cc: William Dauchy, kvm, levinsasha928, mingo, asias.hejun, gorcunov

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

On Oct25 10:01, Pekka Enberg wrote:
> Is this something that happens on your machine? I wonder if it makes more 
> sense to return the error from virtio_pci__signal_vq() and 
> virtio_pci__signal_config() and make the callers deal with it.

no but I thought it was worth not keeping a system call unchecked;
particularly when you are debugging something (ballooning in my case),
just wanted to make sure the call was indeed ok.
-- 
William

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH 4/5] kvm tools: initialize msi flags to zero even is not used yet
  2012-10-25  7:07   ` Pekka Enberg
@ 2012-10-25  9:17     ` William Dauchy
  0 siblings, 0 replies; 17+ messages in thread
From: William Dauchy @ 2012-10-25  9:17 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: William Dauchy, kvm, levinsasha928

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

On Oct25 10:07, Pekka Enberg wrote:
> It is initialized to zero by default as per C struct initialization, isn't 
> it? Does this fix a problem you are experiencing?

no, just a security since kvm checks it.
Anyway you can ignore this patch if you want.
-- 
William

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH 1/5] kvm tools: check ioctl return value for msi signal
  2012-10-25  9:15     ` William Dauchy
@ 2012-10-25 19:18       ` Sasha Levin
  0 siblings, 0 replies; 17+ messages in thread
From: Sasha Levin @ 2012-10-25 19:18 UTC (permalink / raw)
  To: William Dauchy; +Cc: Pekka Enberg, kvm, mingo, asias.hejun, gorcunov

On Thu, Oct 25, 2012 at 5:15 AM, William Dauchy <william@gandi.net> wrote:
> On Oct25 10:01, Pekka Enberg wrote:
>> Is this something that happens on your machine? I wonder if it makes more
>> sense to return the error from virtio_pci__signal_vq() and
>> virtio_pci__signal_config() and make the callers deal with it.
>
> no but I thought it was worth not keeping a system call unchecked;
> particularly when you are debugging something (ballooning in my case),
> just wanted to make sure the call was indeed ok.

I wonder if we should revert to using good old IRQ injection in case
this one fails.


Thanks,
Sasha

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

* Re: [PATCH 2/5] kvm tools: use the correct config vector interrupt
  2012-10-25  7:03   ` Pekka Enberg
@ 2012-10-25 19:20     ` Sasha Levin
  2012-10-26 15:29       ` Pekka Enberg
  0 siblings, 1 reply; 17+ messages in thread
From: Sasha Levin @ 2012-10-25 19:20 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: William Dauchy, kvm, mingo, asias.hejun, gorcunov

On Thu, Oct 25, 2012 at 3:03 AM, Pekka Enberg <penberg@kernel.org> wrote:
> On Wed, 24 Oct 2012, William Dauchy wrote:
>> when registering the config interrupt, the later is registered in
>> vcpi->config_vector and not in vpci->vq_vector
>>
>> introduced in:
>> a841f15 kvm tools: Use the new KVM_SIGNAL_MSI ioctl to inject
>> interrupts directly.
>>
>> Signed-off-by: William Dauchy <william@gandi.net>
>> ---
>>  tools/kvm/virtio/pci.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c
>> index ab1119a..f4ea3c9 100644
>> --- a/tools/kvm/virtio/pci.c
>> +++ b/tools/kvm/virtio/pci.c
>> @@ -288,7 +288,7 @@ int virtio_pci__signal_config(struct kvm *kvm, struct virtio_device *vdev)
>>               }
>>
>>               if (vpci->features & VIRTIO_PCI_F_SIGNAL_MSI)
>> -                     virtio_pci__signal_msi(kvm, vpci, vpci->vq_vector[vpci->config_vector]);
>> +                     virtio_pci__signal_msi(kvm, vpci, vpci->config_vector);
>>               else
>>                       kvm__irq_trigger(kvm, vpci->config_gsi);
>>       } else {
>
> Sasha?

Indeed, we tried signaling the config vector by signaling vq0, woops.

Acked-by: Sasha Levin <levinsasha928@gmail.com>

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

* Re: [PATCH 2/5] kvm tools: use the correct config vector interrupt
  2012-10-25 19:20     ` Sasha Levin
@ 2012-10-26 15:29       ` Pekka Enberg
  0 siblings, 0 replies; 17+ messages in thread
From: Pekka Enberg @ 2012-10-26 15:29 UTC (permalink / raw)
  To: Sasha Levin; +Cc: William Dauchy, kvm, mingo, asias.hejun, gorcunov

On Thu, 25 Oct 2012, Sasha Levin wrote:
> On Thu, Oct 25, 2012 at 3:03 AM, Pekka Enberg <penberg@kernel.org> wrote:
> > On Wed, 24 Oct 2012, William Dauchy wrote:
> >> when registering the config interrupt, the later is registered in
> >> vcpi->config_vector and not in vpci->vq_vector
> >>
> >> introduced in:
> >> a841f15 kvm tools: Use the new KVM_SIGNAL_MSI ioctl to inject
> >> interrupts directly.
> >>
> >> Signed-off-by: William Dauchy <william@gandi.net>
> >> ---
> >>  tools/kvm/virtio/pci.c |    2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c
> >> index ab1119a..f4ea3c9 100644
> >> --- a/tools/kvm/virtio/pci.c
> >> +++ b/tools/kvm/virtio/pci.c
> >> @@ -288,7 +288,7 @@ int virtio_pci__signal_config(struct kvm *kvm, struct virtio_device *vdev)
> >>               }
> >>
> >>               if (vpci->features & VIRTIO_PCI_F_SIGNAL_MSI)
> >> -                     virtio_pci__signal_msi(kvm, vpci, vpci->vq_vector[vpci->config_vector]);
> >> +                     virtio_pci__signal_msi(kvm, vpci, vpci->config_vector);
> >>               else
> >>                       kvm__irq_trigger(kvm, vpci->config_gsi);
> >>       } else {
> >
> > Sasha?
> 
> Indeed, we tried signaling the config vector by signaling vq0, woops.
> 
> Acked-by: Sasha Levin <levinsasha928@gmail.com>

Applied, thanks guys!

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

end of thread, other threads:[~2012-10-26 15:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-24 12:51 [PATCH 0/5] kvm tools: virtio-balloon fix and cleaning William Dauchy
2012-10-24 12:51 ` [PATCH 1/5] kvm tools: check ioctl return value for msi signal William Dauchy
2012-10-25  7:01   ` Pekka Enberg
2012-10-25  9:15     ` William Dauchy
2012-10-25 19:18       ` Sasha Levin
2012-10-24 12:51 ` [PATCH 2/5] kvm tools: use the correct config vector interrupt William Dauchy
2012-10-25  7:03   ` Pekka Enberg
2012-10-25 19:20     ` Sasha Levin
2012-10-26 15:29       ` Pekka Enberg
2012-10-24 12:51 ` [PATCH 3/5] kvm tools: correctly handle mem ballooning William Dauchy
2012-10-24 17:43   ` Sasha Levin
2012-10-24 17:50     ` William Dauchy
2012-10-24 12:51 ` [PATCH 4/5] kvm tools: initialize msi flags to zero even is not used yet William Dauchy
2012-10-25  7:07   ` Pekka Enberg
2012-10-25  9:17     ` William Dauchy
2012-10-24 12:51 ` [PATCH 5/5] kvm tools: specify the amount to balloon is in MB William Dauchy
2012-10-25  7:10   ` Pekka Enberg

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