Re: [PATCH] kvm: move advertising of KVM_CAP_IRQFD to common code

2015-03-10 Thread Marcelo Tosatti
On Thu, Mar 05, 2015 at 11:54:46AM +0100, Paolo Bonzini wrote:
> POWER supports irqfds but forgot to advertise them.  Some userspace does
> not check for the capability, but others check it---thus they work on
> x86 and s390 but not POWER.
> 
> To avoid that other architectures in the future make the same mistake, let
> common code handle KVM_CAP_IRQFD the same way as KVM_CAP_IRQFD_RESAMPLE.
> 
> Reported-by: Greg Kurz 
> Cc: sta...@vger.kernel.org
> Fixes: 297e21053a52f060944e9f0de4c64fad9bcd72fc
> Signed-off-by: Paolo Bonzini 
> ---
>   Marcelo, please apply this for 4.0.

Applied, thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] kvm: move advertising of KVM_CAP_IRQFD to common code

2015-03-10 Thread Marcelo Tosatti
On Thu, Mar 05, 2015 at 11:54:46AM +0100, Paolo Bonzini wrote:
 POWER supports irqfds but forgot to advertise them.  Some userspace does
 not check for the capability, but others check it---thus they work on
 x86 and s390 but not POWER.
 
 To avoid that other architectures in the future make the same mistake, let
 common code handle KVM_CAP_IRQFD the same way as KVM_CAP_IRQFD_RESAMPLE.
 
 Reported-by: Greg Kurz gk...@linux.vnet.ibm.com
 Cc: sta...@vger.kernel.org
 Fixes: 297e21053a52f060944e9f0de4c64fad9bcd72fc
 Signed-off-by: Paolo Bonzini pbonz...@redhat.com
 ---
   Marcelo, please apply this for 4.0.

Applied, thanks.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] kvm: move advertising of KVM_CAP_IRQFD to common code

2015-03-05 Thread Greg Kurz
On Thu,  5 Mar 2015 11:54:46 +0100
Paolo Bonzini  wrote:
> POWER supports irqfds but forgot to advertise them.  Some userspace does
> not check for the capability, but others check it---thus they work on
> x86 and s390 but not POWER.
> 
> To avoid that other architectures in the future make the same mistake, let
> common code handle KVM_CAP_IRQFD the same way as KVM_CAP_IRQFD_RESAMPLE.
> 
> Reported-by: Greg Kurz 
> Cc: sta...@vger.kernel.org
> Fixes: 297e21053a52f060944e9f0de4c64fad9bcd72fc
> Signed-off-by: Paolo Bonzini 
> ---

Thanks !

Tested-by: Greg Kurz 

>   Marcelo, please apply this for 4.0.
> ---
>  arch/s390/kvm/kvm-s390.c | 1 -
>  arch/x86/kvm/x86.c   | 1 -
>  virt/kvm/kvm_main.c  | 1 +
>  3 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index 0c3623927563..17277968e50a 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -165,7 +165,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long 
> ext)
>   case KVM_CAP_ONE_REG:
>   case KVM_CAP_ENABLE_CAP:
>   case KVM_CAP_S390_CSS_SUPPORT:
> - case KVM_CAP_IRQFD:
>   case KVM_CAP_IOEVENTFD:
>   case KVM_CAP_DEVICE_CTRL:
>   case KVM_CAP_ENABLE_CAP_VM:
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index bd7a70be41b3..32bf19ef3115 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -2744,7 +2744,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long 
> ext)
>   case KVM_CAP_USER_NMI:
>   case KVM_CAP_REINJECT_CONTROL:
>   case KVM_CAP_IRQ_INJECT_STATUS:
> - case KVM_CAP_IRQFD:
>   case KVM_CAP_IOEVENTFD:
>   case KVM_CAP_IOEVENTFD_NO_LENGTH:
>   case KVM_CAP_PIT2:
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index a1093700f3a4..a2214d9609bd 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -2492,6 +2492,7 @@ static long kvm_vm_ioctl_check_extension_generic(struct 
> kvm *kvm, long arg)
>   case KVM_CAP_SIGNAL_MSI:
>  #endif
>  #ifdef CONFIG_HAVE_KVM_IRQFD
> + case KVM_CAP_IRQFD:
>   case KVM_CAP_IRQFD_RESAMPLE:
>  #endif
>   case KVM_CAP_CHECK_EXTENSION_VM:

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] kvm: move advertising of KVM_CAP_IRQFD to common code

2015-03-05 Thread Paolo Bonzini
POWER supports irqfds but forgot to advertise them.  Some userspace does
not check for the capability, but others check it---thus they work on
x86 and s390 but not POWER.

To avoid that other architectures in the future make the same mistake, let
common code handle KVM_CAP_IRQFD the same way as KVM_CAP_IRQFD_RESAMPLE.

Reported-by: Greg Kurz 
Cc: sta...@vger.kernel.org
Fixes: 297e21053a52f060944e9f0de4c64fad9bcd72fc
Signed-off-by: Paolo Bonzini 
---
Marcelo, please apply this for 4.0.
---
 arch/s390/kvm/kvm-s390.c | 1 -
 arch/x86/kvm/x86.c   | 1 -
 virt/kvm/kvm_main.c  | 1 +
 3 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 0c3623927563..17277968e50a 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -165,7 +165,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
case KVM_CAP_ONE_REG:
case KVM_CAP_ENABLE_CAP:
case KVM_CAP_S390_CSS_SUPPORT:
-   case KVM_CAP_IRQFD:
case KVM_CAP_IOEVENTFD:
case KVM_CAP_DEVICE_CTRL:
case KVM_CAP_ENABLE_CAP_VM:
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index bd7a70be41b3..32bf19ef3115 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2744,7 +2744,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long 
ext)
case KVM_CAP_USER_NMI:
case KVM_CAP_REINJECT_CONTROL:
case KVM_CAP_IRQ_INJECT_STATUS:
-   case KVM_CAP_IRQFD:
case KVM_CAP_IOEVENTFD:
case KVM_CAP_IOEVENTFD_NO_LENGTH:
case KVM_CAP_PIT2:
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index a1093700f3a4..a2214d9609bd 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2492,6 +2492,7 @@ static long kvm_vm_ioctl_check_extension_generic(struct 
kvm *kvm, long arg)
case KVM_CAP_SIGNAL_MSI:
 #endif
 #ifdef CONFIG_HAVE_KVM_IRQFD
+   case KVM_CAP_IRQFD:
case KVM_CAP_IRQFD_RESAMPLE:
 #endif
case KVM_CAP_CHECK_EXTENSION_VM:
-- 
2.3.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] kvm: move advertising of KVM_CAP_IRQFD to common code

2015-03-05 Thread Paolo Bonzini
POWER supports irqfds but forgot to advertise them.  Some userspace does
not check for the capability, but others check it---thus they work on
x86 and s390 but not POWER.

To avoid that other architectures in the future make the same mistake, let
common code handle KVM_CAP_IRQFD the same way as KVM_CAP_IRQFD_RESAMPLE.

Reported-by: Greg Kurz gk...@linux.vnet.ibm.com
Cc: sta...@vger.kernel.org
Fixes: 297e21053a52f060944e9f0de4c64fad9bcd72fc
Signed-off-by: Paolo Bonzini pbonz...@redhat.com
---
Marcelo, please apply this for 4.0.
---
 arch/s390/kvm/kvm-s390.c | 1 -
 arch/x86/kvm/x86.c   | 1 -
 virt/kvm/kvm_main.c  | 1 +
 3 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 0c3623927563..17277968e50a 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -165,7 +165,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
case KVM_CAP_ONE_REG:
case KVM_CAP_ENABLE_CAP:
case KVM_CAP_S390_CSS_SUPPORT:
-   case KVM_CAP_IRQFD:
case KVM_CAP_IOEVENTFD:
case KVM_CAP_DEVICE_CTRL:
case KVM_CAP_ENABLE_CAP_VM:
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index bd7a70be41b3..32bf19ef3115 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2744,7 +2744,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long 
ext)
case KVM_CAP_USER_NMI:
case KVM_CAP_REINJECT_CONTROL:
case KVM_CAP_IRQ_INJECT_STATUS:
-   case KVM_CAP_IRQFD:
case KVM_CAP_IOEVENTFD:
case KVM_CAP_IOEVENTFD_NO_LENGTH:
case KVM_CAP_PIT2:
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index a1093700f3a4..a2214d9609bd 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2492,6 +2492,7 @@ static long kvm_vm_ioctl_check_extension_generic(struct 
kvm *kvm, long arg)
case KVM_CAP_SIGNAL_MSI:
 #endif
 #ifdef CONFIG_HAVE_KVM_IRQFD
+   case KVM_CAP_IRQFD:
case KVM_CAP_IRQFD_RESAMPLE:
 #endif
case KVM_CAP_CHECK_EXTENSION_VM:
-- 
2.3.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] kvm: move advertising of KVM_CAP_IRQFD to common code

2015-03-05 Thread Greg Kurz
On Thu,  5 Mar 2015 11:54:46 +0100
Paolo Bonzini pbonz...@redhat.com wrote:
 POWER supports irqfds but forgot to advertise them.  Some userspace does
 not check for the capability, but others check it---thus they work on
 x86 and s390 but not POWER.
 
 To avoid that other architectures in the future make the same mistake, let
 common code handle KVM_CAP_IRQFD the same way as KVM_CAP_IRQFD_RESAMPLE.
 
 Reported-by: Greg Kurz gk...@linux.vnet.ibm.com
 Cc: sta...@vger.kernel.org
 Fixes: 297e21053a52f060944e9f0de4c64fad9bcd72fc
 Signed-off-by: Paolo Bonzini pbonz...@redhat.com
 ---

Thanks !

Tested-by: Greg Kurz gk...@linux.vnet.ibm.com

   Marcelo, please apply this for 4.0.
 ---
  arch/s390/kvm/kvm-s390.c | 1 -
  arch/x86/kvm/x86.c   | 1 -
  virt/kvm/kvm_main.c  | 1 +
  3 files changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
 index 0c3623927563..17277968e50a 100644
 --- a/arch/s390/kvm/kvm-s390.c
 +++ b/arch/s390/kvm/kvm-s390.c
 @@ -165,7 +165,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long 
 ext)
   case KVM_CAP_ONE_REG:
   case KVM_CAP_ENABLE_CAP:
   case KVM_CAP_S390_CSS_SUPPORT:
 - case KVM_CAP_IRQFD:
   case KVM_CAP_IOEVENTFD:
   case KVM_CAP_DEVICE_CTRL:
   case KVM_CAP_ENABLE_CAP_VM:
 diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
 index bd7a70be41b3..32bf19ef3115 100644
 --- a/arch/x86/kvm/x86.c
 +++ b/arch/x86/kvm/x86.c
 @@ -2744,7 +2744,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long 
 ext)
   case KVM_CAP_USER_NMI:
   case KVM_CAP_REINJECT_CONTROL:
   case KVM_CAP_IRQ_INJECT_STATUS:
 - case KVM_CAP_IRQFD:
   case KVM_CAP_IOEVENTFD:
   case KVM_CAP_IOEVENTFD_NO_LENGTH:
   case KVM_CAP_PIT2:
 diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
 index a1093700f3a4..a2214d9609bd 100644
 --- a/virt/kvm/kvm_main.c
 +++ b/virt/kvm/kvm_main.c
 @@ -2492,6 +2492,7 @@ static long kvm_vm_ioctl_check_extension_generic(struct 
 kvm *kvm, long arg)
   case KVM_CAP_SIGNAL_MSI:
  #endif
  #ifdef CONFIG_HAVE_KVM_IRQFD
 + case KVM_CAP_IRQFD:
   case KVM_CAP_IRQFD_RESAMPLE:
  #endif
   case KVM_CAP_CHECK_EXTENSION_VM:

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/