All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
@ 2019-05-20  7:15 ` Cédric Le Goater
  0 siblings, 0 replies; 24+ messages in thread
From: Cédric Le Goater @ 2019-05-20  7:15 UTC (permalink / raw)
  To: kvm-ppc; +Cc: Paul Mackerras, David Gibson, kvm, Cédric Le Goater

Hello,

Here are a couple of fixes for issues in the XIVE KVM device when
testing the limits : RAM size and number of vCPUS.

Based on 5.2-rc1.

Available on GitHub:

    https://github.com/legoater/linux/commits/xive-5.2

Thanks,

C. 

Cédric Le Goater (3):
  KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
  KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
    reseting
  KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
    identifier

 arch/powerpc/kvm/book3s_xive_native.c | 46 ++++++++++++++++-----------
 1 file changed, 27 insertions(+), 19 deletions(-)

-- 
2.20.1


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

* [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
@ 2019-05-20  7:15 ` Cédric Le Goater
  0 siblings, 0 replies; 24+ messages in thread
From: Cédric Le Goater @ 2019-05-20  7:15 UTC (permalink / raw)
  To: kvm-ppc; +Cc: Paul Mackerras, David Gibson, kvm, Cédric Le Goater

Hello,

Here are a couple of fixes for issues in the XIVE KVM device when
testing the limits : RAM size and number of vCPUS.

Based on 5.2-rc1.

Available on GitHub:

    https://github.com/legoater/linux/commits/xive-5.2

Thanks,

C. 

Cédric Le Goater (3):
  KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
  KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
    reseting
  KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
    identifier

 arch/powerpc/kvm/book3s_xive_native.c | 46 ++++++++++++++++-----------
 1 file changed, 27 insertions(+), 19 deletions(-)

-- 
2.20.1

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

* [PATCH 1/3] KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
  2019-05-20  7:15 ` Cédric Le Goater
@ 2019-05-20  7:15   ` Cédric Le Goater
  -1 siblings, 0 replies; 24+ messages in thread
From: Cédric Le Goater @ 2019-05-20  7:15 UTC (permalink / raw)
  To: kvm-ppc
  Cc: Paul Mackerras, David Gibson, kvm, Cédric Le Goater, Paul Mackerras

Improve the release of the XIVE KVM device by clearing the file
address_space which is used to unmap the interrupt ESB pages when a
device is passed-through.

Suggested-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/kvm/book3s_xive_native.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
index 6a8e698c4b6e..796d86549cfe 100644
--- a/arch/powerpc/kvm/book3s_xive_native.c
+++ b/arch/powerpc/kvm/book3s_xive_native.c
@@ -979,6 +979,14 @@ static void kvmppc_xive_native_release(struct kvm_device *dev)
 
 	pr_devel("Releasing xive native device\n");
 
+	/*
+	 * Clear the KVM device file address_space which is used to
+	 * unmap the ESB pages when a device is passed-through.
+	 */
+	mutex_lock(&xive->mapping_lock);
+	xive->mapping = NULL;
+	mutex_unlock(&xive->mapping_lock);
+
 	/*
 	 * Clearing mmu_ready temporarily while holding kvm->lock
 	 * is a way of ensuring that no vcpus can enter the guest
-- 
2.20.1


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

* [PATCH 1/3] KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
@ 2019-05-20  7:15   ` Cédric Le Goater
  0 siblings, 0 replies; 24+ messages in thread
From: Cédric Le Goater @ 2019-05-20  7:15 UTC (permalink / raw)
  To: kvm-ppc
  Cc: Paul Mackerras, David Gibson, kvm, Cédric Le Goater, Paul Mackerras

Improve the release of the XIVE KVM device by clearing the file
address_space which is used to unmap the interrupt ESB pages when a
device is passed-through.

Suggested-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/kvm/book3s_xive_native.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
index 6a8e698c4b6e..796d86549cfe 100644
--- a/arch/powerpc/kvm/book3s_xive_native.c
+++ b/arch/powerpc/kvm/book3s_xive_native.c
@@ -979,6 +979,14 @@ static void kvmppc_xive_native_release(struct kvm_device *dev)
 
 	pr_devel("Releasing xive native device\n");
 
+	/*
+	 * Clear the KVM device file address_space which is used to
+	 * unmap the ESB pages when a device is passed-through.
+	 */
+	mutex_lock(&xive->mapping_lock);
+	xive->mapping = NULL;
+	mutex_unlock(&xive->mapping_lock);
+
 	/*
 	 * Clearing mmu_ready temporarily while holding kvm->lock
 	 * is a way of ensuring that no vcpus can enter the guest
-- 
2.20.1

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

* [PATCH 2/3] KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when resetting
  2019-05-20  7:15 ` Cédric Le Goater
@ 2019-05-20  7:15   ` Cédric Le Goater
  -1 siblings, 0 replies; 24+ messages in thread
From: Cédric Le Goater @ 2019-05-20  7:15 UTC (permalink / raw)
  To: kvm-ppc
  Cc: Paul Mackerras, David Gibson, kvm, Cédric Le Goater,
	Satheesh Rajendran

When a CPU is hot-unplugged, the EQ is deconfigured using a zero size
and a zero address. In this case, there is no need to check the flag
and queue size validity. Move the checks after the queue reset code
section to fix CPU hot-unplug.

Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Tested-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/kvm/book3s_xive_native.c | 36 +++++++++++++--------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
index 796d86549cfe..3fdea6bf4e97 100644
--- a/arch/powerpc/kvm/book3s_xive_native.c
+++ b/arch/powerpc/kvm/book3s_xive_native.c
@@ -565,24 +565,6 @@ static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
 		 __func__, server, priority, kvm_eq.flags,
 		 kvm_eq.qshift, kvm_eq.qaddr, kvm_eq.qtoggle, kvm_eq.qindex);
 
-	/*
-	 * sPAPR specifies a "Unconditional Notify (n) flag" for the
-	 * H_INT_SET_QUEUE_CONFIG hcall which forces notification
-	 * without using the coalescing mechanisms provided by the
-	 * XIVE END ESBs. This is required on KVM as notification
-	 * using the END ESBs is not supported.
-	 */
-	if (kvm_eq.flags != KVM_XIVE_EQ_ALWAYS_NOTIFY) {
-		pr_err("invalid flags %d\n", kvm_eq.flags);
-		return -EINVAL;
-	}
-
-	rc = xive_native_validate_queue_size(kvm_eq.qshift);
-	if (rc) {
-		pr_err("invalid queue size %d\n", kvm_eq.qshift);
-		return rc;
-	}
-
 	/* reset queue and disable queueing */
 	if (!kvm_eq.qshift) {
 		q->guest_qaddr  = 0;
@@ -604,6 +586,24 @@ static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
 		return 0;
 	}
 
+	/*
+	 * sPAPR specifies a "Unconditional Notify (n) flag" for the
+	 * H_INT_SET_QUEUE_CONFIG hcall which forces notification
+	 * without using the coalescing mechanisms provided by the
+	 * XIVE END ESBs. This is required on KVM as notification
+	 * using the END ESBs is not supported.
+	 */
+	if (kvm_eq.flags != KVM_XIVE_EQ_ALWAYS_NOTIFY) {
+		pr_err("invalid flags %d\n", kvm_eq.flags);
+		return -EINVAL;
+	}
+
+	rc = xive_native_validate_queue_size(kvm_eq.qshift);
+	if (rc) {
+		pr_err("invalid queue size %d\n", kvm_eq.qshift);
+		return rc;
+	}
+
 	if (kvm_eq.qaddr & ((1ull << kvm_eq.qshift) - 1)) {
 		pr_err("queue page is not aligned %llx/%llx\n", kvm_eq.qaddr,
 		       1ull << kvm_eq.qshift);
-- 
2.20.1


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

* [PATCH 2/3] KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when resetting
@ 2019-05-20  7:15   ` Cédric Le Goater
  0 siblings, 0 replies; 24+ messages in thread
From: Cédric Le Goater @ 2019-05-20  7:15 UTC (permalink / raw)
  To: kvm-ppc
  Cc: Paul Mackerras, David Gibson, kvm, Cédric Le Goater,
	Satheesh Rajendran

When a CPU is hot-unplugged, the EQ is deconfigured using a zero size
and a zero address. In this case, there is no need to check the flag
and queue size validity. Move the checks after the queue reset code
section to fix CPU hot-unplug.

Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Tested-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/kvm/book3s_xive_native.c | 36 +++++++++++++--------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
index 796d86549cfe..3fdea6bf4e97 100644
--- a/arch/powerpc/kvm/book3s_xive_native.c
+++ b/arch/powerpc/kvm/book3s_xive_native.c
@@ -565,24 +565,6 @@ static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
 		 __func__, server, priority, kvm_eq.flags,
 		 kvm_eq.qshift, kvm_eq.qaddr, kvm_eq.qtoggle, kvm_eq.qindex);
 
-	/*
-	 * sPAPR specifies a "Unconditional Notify (n) flag" for the
-	 * H_INT_SET_QUEUE_CONFIG hcall which forces notification
-	 * without using the coalescing mechanisms provided by the
-	 * XIVE END ESBs. This is required on KVM as notification
-	 * using the END ESBs is not supported.
-	 */
-	if (kvm_eq.flags != KVM_XIVE_EQ_ALWAYS_NOTIFY) {
-		pr_err("invalid flags %d\n", kvm_eq.flags);
-		return -EINVAL;
-	}
-
-	rc = xive_native_validate_queue_size(kvm_eq.qshift);
-	if (rc) {
-		pr_err("invalid queue size %d\n", kvm_eq.qshift);
-		return rc;
-	}
-
 	/* reset queue and disable queueing */
 	if (!kvm_eq.qshift) {
 		q->guest_qaddr  = 0;
@@ -604,6 +586,24 @@ static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
 		return 0;
 	}
 
+	/*
+	 * sPAPR specifies a "Unconditional Notify (n) flag" for the
+	 * H_INT_SET_QUEUE_CONFIG hcall which forces notification
+	 * without using the coalescing mechanisms provided by the
+	 * XIVE END ESBs. This is required on KVM as notification
+	 * using the END ESBs is not supported.
+	 */
+	if (kvm_eq.flags != KVM_XIVE_EQ_ALWAYS_NOTIFY) {
+		pr_err("invalid flags %d\n", kvm_eq.flags);
+		return -EINVAL;
+	}
+
+	rc = xive_native_validate_queue_size(kvm_eq.qshift);
+	if (rc) {
+		pr_err("invalid queue size %d\n", kvm_eq.qshift);
+		return rc;
+	}
+
 	if (kvm_eq.qaddr & ((1ull << kvm_eq.qshift) - 1)) {
 		pr_err("queue page is not aligned %llx/%llx\n", kvm_eq.qaddr,
 		       1ull << kvm_eq.qshift);
-- 
2.20.1

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

* [PATCH 3/3] KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU identifier
  2019-05-20  7:15 ` Cédric Le Goater
@ 2019-05-20  7:15   ` Cédric Le Goater
  -1 siblings, 0 replies; 24+ messages in thread
From: Cédric Le Goater @ 2019-05-20  7:15 UTC (permalink / raw)
  To: kvm-ppc
  Cc: Paul Mackerras, David Gibson, kvm, Cédric Le Goater,
	Satheesh Rajendran

When a vCPU is connected to the KVM device, it is done using its vCPU
identifier in the guest. Fix the enforced limit on the vCPU identifier
by taking into account the SMT mode.

Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Tested-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/kvm/book3s_xive_native.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
index 3fdea6bf4e97..25b6b0e2d02a 100644
--- a/arch/powerpc/kvm/book3s_xive_native.c
+++ b/arch/powerpc/kvm/book3s_xive_native.c
@@ -109,7 +109,7 @@ int kvmppc_xive_native_connect_vcpu(struct kvm_device *dev,
 		return -EPERM;
 	if (vcpu->arch.irq_type != KVMPPC_IRQ_DEFAULT)
 		return -EBUSY;
-	if (server_num >= KVM_MAX_VCPUS) {
+	if (server_num >= (KVM_MAX_VCPUS * vcpu->kvm->arch.emul_smt_mode)) {
 		pr_devel("Out of bounds !\n");
 		return -EINVAL;
 	}
-- 
2.20.1


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

* [PATCH 3/3] KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU identifier
@ 2019-05-20  7:15   ` Cédric Le Goater
  0 siblings, 0 replies; 24+ messages in thread
From: Cédric Le Goater @ 2019-05-20  7:15 UTC (permalink / raw)
  To: kvm-ppc
  Cc: Paul Mackerras, David Gibson, kvm, Cédric Le Goater,
	Satheesh Rajendran

When a vCPU is connected to the KVM device, it is done using its vCPU
identifier in the guest. Fix the enforced limit on the vCPU identifier
by taking into account the SMT mode.

Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Tested-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/kvm/book3s_xive_native.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
index 3fdea6bf4e97..25b6b0e2d02a 100644
--- a/arch/powerpc/kvm/book3s_xive_native.c
+++ b/arch/powerpc/kvm/book3s_xive_native.c
@@ -109,7 +109,7 @@ int kvmppc_xive_native_connect_vcpu(struct kvm_device *dev,
 		return -EPERM;
 	if (vcpu->arch.irq_type != KVMPPC_IRQ_DEFAULT)
 		return -EBUSY;
-	if (server_num >= KVM_MAX_VCPUS) {
+	if (server_num >= (KVM_MAX_VCPUS * vcpu->kvm->arch.emul_smt_mode)) {
 		pr_devel("Out of bounds !\n");
 		return -EINVAL;
 	}
-- 
2.20.1

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

* Re: [PATCH 2/3] KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when resetting
  2019-05-20  7:15   ` Cédric Le Goater
@ 2019-05-20  8:06     ` Greg Kurz
  -1 siblings, 0 replies; 24+ messages in thread
From: Greg Kurz @ 2019-05-20  8:06 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: kvm-ppc, Paul Mackerras, David Gibson, kvm, Satheesh Rajendran

On Mon, 20 May 2019 09:15:13 +0200
Cédric Le Goater <clg@kaod.org> wrote:

> When a CPU is hot-unplugged, the EQ is deconfigured using a zero size
> and a zero address. In this case, there is no need to check the flag
> and queue size validity. Move the checks after the queue reset code
> section to fix CPU hot-unplug.
> 
> Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> Tested-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

>  arch/powerpc/kvm/book3s_xive_native.c | 36 +++++++++++++--------------
>  1 file changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
> index 796d86549cfe..3fdea6bf4e97 100644
> --- a/arch/powerpc/kvm/book3s_xive_native.c
> +++ b/arch/powerpc/kvm/book3s_xive_native.c
> @@ -565,24 +565,6 @@ static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
>  		 __func__, server, priority, kvm_eq.flags,
>  		 kvm_eq.qshift, kvm_eq.qaddr, kvm_eq.qtoggle, kvm_eq.qindex);
>  
> -	/*
> -	 * sPAPR specifies a "Unconditional Notify (n) flag" for the
> -	 * H_INT_SET_QUEUE_CONFIG hcall which forces notification
> -	 * without using the coalescing mechanisms provided by the
> -	 * XIVE END ESBs. This is required on KVM as notification
> -	 * using the END ESBs is not supported.
> -	 */
> -	if (kvm_eq.flags != KVM_XIVE_EQ_ALWAYS_NOTIFY) {
> -		pr_err("invalid flags %d\n", kvm_eq.flags);
> -		return -EINVAL;
> -	}
> -
> -	rc = xive_native_validate_queue_size(kvm_eq.qshift);
> -	if (rc) {
> -		pr_err("invalid queue size %d\n", kvm_eq.qshift);
> -		return rc;
> -	}
> -
>  	/* reset queue and disable queueing */
>  	if (!kvm_eq.qshift) {
>  		q->guest_qaddr  = 0;
> @@ -604,6 +586,24 @@ static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
>  		return 0;
>  	}
>  
> +	/*
> +	 * sPAPR specifies a "Unconditional Notify (n) flag" for the
> +	 * H_INT_SET_QUEUE_CONFIG hcall which forces notification
> +	 * without using the coalescing mechanisms provided by the
> +	 * XIVE END ESBs. This is required on KVM as notification
> +	 * using the END ESBs is not supported.
> +	 */
> +	if (kvm_eq.flags != KVM_XIVE_EQ_ALWAYS_NOTIFY) {
> +		pr_err("invalid flags %d\n", kvm_eq.flags);
> +		return -EINVAL;
> +	}
> +
> +	rc = xive_native_validate_queue_size(kvm_eq.qshift);
> +	if (rc) {
> +		pr_err("invalid queue size %d\n", kvm_eq.qshift);
> +		return rc;
> +	}
> +
>  	if (kvm_eq.qaddr & ((1ull << kvm_eq.qshift) - 1)) {
>  		pr_err("queue page is not aligned %llx/%llx\n", kvm_eq.qaddr,
>  		       1ull << kvm_eq.qshift);


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

* Re: [PATCH 2/3] KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when resetting
@ 2019-05-20  8:06     ` Greg Kurz
  0 siblings, 0 replies; 24+ messages in thread
From: Greg Kurz @ 2019-05-20  8:06 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: kvm-ppc, Paul Mackerras, David Gibson, kvm, Satheesh Rajendran

On Mon, 20 May 2019 09:15:13 +0200
Cédric Le Goater <clg@kaod.org> wrote:

> When a CPU is hot-unplugged, the EQ is deconfigured using a zero size
> and a zero address. In this case, there is no need to check the flag
> and queue size validity. Move the checks after the queue reset code
> section to fix CPU hot-unplug.
> 
> Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> Tested-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

>  arch/powerpc/kvm/book3s_xive_native.c | 36 +++++++++++++--------------
>  1 file changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
> index 796d86549cfe..3fdea6bf4e97 100644
> --- a/arch/powerpc/kvm/book3s_xive_native.c
> +++ b/arch/powerpc/kvm/book3s_xive_native.c
> @@ -565,24 +565,6 @@ static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
>  		 __func__, server, priority, kvm_eq.flags,
>  		 kvm_eq.qshift, kvm_eq.qaddr, kvm_eq.qtoggle, kvm_eq.qindex);
>  
> -	/*
> -	 * sPAPR specifies a "Unconditional Notify (n) flag" for the
> -	 * H_INT_SET_QUEUE_CONFIG hcall which forces notification
> -	 * without using the coalescing mechanisms provided by the
> -	 * XIVE END ESBs. This is required on KVM as notification
> -	 * using the END ESBs is not supported.
> -	 */
> -	if (kvm_eq.flags != KVM_XIVE_EQ_ALWAYS_NOTIFY) {
> -		pr_err("invalid flags %d\n", kvm_eq.flags);
> -		return -EINVAL;
> -	}
> -
> -	rc = xive_native_validate_queue_size(kvm_eq.qshift);
> -	if (rc) {
> -		pr_err("invalid queue size %d\n", kvm_eq.qshift);
> -		return rc;
> -	}
> -
>  	/* reset queue and disable queueing */
>  	if (!kvm_eq.qshift) {
>  		q->guest_qaddr  = 0;
> @@ -604,6 +586,24 @@ static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
>  		return 0;
>  	}
>  
> +	/*
> +	 * sPAPR specifies a "Unconditional Notify (n) flag" for the
> +	 * H_INT_SET_QUEUE_CONFIG hcall which forces notification
> +	 * without using the coalescing mechanisms provided by the
> +	 * XIVE END ESBs. This is required on KVM as notification
> +	 * using the END ESBs is not supported.
> +	 */
> +	if (kvm_eq.flags != KVM_XIVE_EQ_ALWAYS_NOTIFY) {
> +		pr_err("invalid flags %d\n", kvm_eq.flags);
> +		return -EINVAL;
> +	}
> +
> +	rc = xive_native_validate_queue_size(kvm_eq.qshift);
> +	if (rc) {
> +		pr_err("invalid queue size %d\n", kvm_eq.qshift);
> +		return rc;
> +	}
> +
>  	if (kvm_eq.qaddr & ((1ull << kvm_eq.qshift) - 1)) {
>  		pr_err("queue page is not aligned %llx/%llx\n", kvm_eq.qaddr,
>  		       1ull << kvm_eq.qshift);

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

* Re: [PATCH 3/3] KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU identifier
  2019-05-20  7:15   ` Cédric Le Goater
@ 2019-05-20  9:23     ` Greg Kurz
  -1 siblings, 0 replies; 24+ messages in thread
From: Greg Kurz @ 2019-05-20  9:23 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: kvm-ppc, Paul Mackerras, David Gibson, kvm, Satheesh Rajendran

On Mon, 20 May 2019 09:15:14 +0200
Cédric Le Goater <clg@kaod.org> wrote:

> When a vCPU is connected to the KVM device, it is done using its vCPU
> identifier in the guest. Fix the enforced limit on the vCPU identifier
> by taking into account the SMT mode.
> 

Reviewed-by: Greg Kurz <groug@kaod.org>

> Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> Tested-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>  arch/powerpc/kvm/book3s_xive_native.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
> index 3fdea6bf4e97..25b6b0e2d02a 100644
> --- a/arch/powerpc/kvm/book3s_xive_native.c
> +++ b/arch/powerpc/kvm/book3s_xive_native.c
> @@ -109,7 +109,7 @@ int kvmppc_xive_native_connect_vcpu(struct kvm_device *dev,
>  		return -EPERM;
>  	if (vcpu->arch.irq_type != KVMPPC_IRQ_DEFAULT)
>  		return -EBUSY;
> -	if (server_num >= KVM_MAX_VCPUS) {
> +	if (server_num >= (KVM_MAX_VCPUS * vcpu->kvm->arch.emul_smt_mode)) {
>  		pr_devel("Out of bounds !\n");
>  		return -EINVAL;
>  	}


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

* Re: [PATCH 3/3] KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU identifier
@ 2019-05-20  9:23     ` Greg Kurz
  0 siblings, 0 replies; 24+ messages in thread
From: Greg Kurz @ 2019-05-20  9:23 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: kvm-ppc, Paul Mackerras, David Gibson, kvm, Satheesh Rajendran

On Mon, 20 May 2019 09:15:14 +0200
Cédric Le Goater <clg@kaod.org> wrote:

> When a vCPU is connected to the KVM device, it is done using its vCPU
> identifier in the guest. Fix the enforced limit on the vCPU identifier
> by taking into account the SMT mode.
> 

Reviewed-by: Greg Kurz <groug@kaod.org>

> Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> Tested-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>  arch/powerpc/kvm/book3s_xive_native.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
> index 3fdea6bf4e97..25b6b0e2d02a 100644
> --- a/arch/powerpc/kvm/book3s_xive_native.c
> +++ b/arch/powerpc/kvm/book3s_xive_native.c
> @@ -109,7 +109,7 @@ int kvmppc_xive_native_connect_vcpu(struct kvm_device *dev,
>  		return -EPERM;
>  	if (vcpu->arch.irq_type != KVMPPC_IRQ_DEFAULT)
>  		return -EBUSY;
> -	if (server_num >= KVM_MAX_VCPUS) {
> +	if (server_num >= (KVM_MAX_VCPUS * vcpu->kvm->arch.emul_smt_mode)) {
>  		pr_devel("Out of bounds !\n");
>  		return -EINVAL;
>  	}

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

* Re: [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
  2019-05-20  7:15 ` Cédric Le Goater
@ 2019-05-22 23:30   ` David Gibson
  -1 siblings, 0 replies; 24+ messages in thread
From: David Gibson @ 2019-05-22 23:30 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: kvm-ppc, Paul Mackerras, kvm

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

On Mon, May 20, 2019 at 09:15:11AM +0200, Cédric Le Goater wrote:
> Hello,
> 
> Here are a couple of fixes for issues in the XIVE KVM device when
> testing the limits : RAM size and number of vCPUS.

How serious are the problems these patches fix?  I'm wondering if I
need to make a backport for RHEL8.1.

> 
> Based on 5.2-rc1.
> 
> Available on GitHub:
> 
>     https://github.com/legoater/linux/commits/xive-5.2
> 
> Thanks,
> 
> C. 
> 
> Cédric Le Goater (3):
>   KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
>   KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
>     reseting
>   KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
>     identifier
> 
>  arch/powerpc/kvm/book3s_xive_native.c | 46 ++++++++++++++++-----------
>  1 file changed, 27 insertions(+), 19 deletions(-)
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
@ 2019-05-22 23:30   ` David Gibson
  0 siblings, 0 replies; 24+ messages in thread
From: David Gibson @ 2019-05-22 23:30 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: kvm-ppc, Paul Mackerras, kvm

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

On Mon, May 20, 2019 at 09:15:11AM +0200, Cédric Le Goater wrote:
> Hello,
> 
> Here are a couple of fixes for issues in the XIVE KVM device when
> testing the limits : RAM size and number of vCPUS.

How serious are the problems these patches fix?  I'm wondering if I
need to make a backport for RHEL8.1.

> 
> Based on 5.2-rc1.
> 
> Available on GitHub:
> 
>     https://github.com/legoater/linux/commits/xive-5.2
> 
> Thanks,
> 
> C. 
> 
> Cédric Le Goater (3):
>   KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
>   KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
>     reseting
>   KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
>     identifier
> 
>  arch/powerpc/kvm/book3s_xive_native.c | 46 ++++++++++++++++-----------
>  1 file changed, 27 insertions(+), 19 deletions(-)
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
  2019-05-22 23:30   ` David Gibson
@ 2019-05-23  6:01     ` Greg Kurz
  -1 siblings, 0 replies; 24+ messages in thread
From: Greg Kurz @ 2019-05-23  6:01 UTC (permalink / raw)
  To: David Gibson; +Cc: Cédric Le Goater, kvm-ppc, Paul Mackerras, kvm

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

On Thu, 23 May 2019 09:30:43 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Mon, May 20, 2019 at 09:15:11AM +0200, Cédric Le Goater wrote:
> > Hello,
> > 
> > Here are a couple of fixes for issues in the XIVE KVM device when
> > testing the limits : RAM size and number of vCPUS.  
> 
> How serious are the problems these patches fix?  I'm wondering if I
> need to make a backport for RHEL8.1.
> 

Patch 2/3 fixes a QEMU error when hot-unplugging a vCPU:

qemu-system-ppc64: KVM_SET_DEVICE_ATTR failed: Group 4 attr 0x0000000000000046: Invalid argument


Patch 3/3 fixes an issue where the guest freezes at some point when doing
vCPU hot-plug/unplug in a loop.


Both issues have a BZ at IBM. They can be mirrored to RH if needed.

> > 
> > Based on 5.2-rc1.
> > 
> > Available on GitHub:
> > 
> >     https://github.com/legoater/linux/commits/xive-5.2
> > 
> > Thanks,
> > 
> > C. 
> > 
> > Cédric Le Goater (3):
> >   KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
> >   KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
> >     reseting
> >   KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
> >     identifier
> > 
> >  arch/powerpc/kvm/book3s_xive_native.c | 46 ++++++++++++++++-----------
> >  1 file changed, 27 insertions(+), 19 deletions(-)
> >   
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
@ 2019-05-23  6:01     ` Greg Kurz
  0 siblings, 0 replies; 24+ messages in thread
From: Greg Kurz @ 2019-05-23  6:01 UTC (permalink / raw)
  To: David Gibson; +Cc: Cédric Le Goater, kvm-ppc, Paul Mackerras, kvm

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

On Thu, 23 May 2019 09:30:43 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Mon, May 20, 2019 at 09:15:11AM +0200, Cédric Le Goater wrote:
> > Hello,
> > 
> > Here are a couple of fixes for issues in the XIVE KVM device when
> > testing the limits : RAM size and number of vCPUS.  
> 
> How serious are the problems these patches fix?  I'm wondering if I
> need to make a backport for RHEL8.1.
> 

Patch 2/3 fixes a QEMU error when hot-unplugging a vCPU:

qemu-system-ppc64: KVM_SET_DEVICE_ATTR failed: Group 4 attr 0x0000000000000046: Invalid argument


Patch 3/3 fixes an issue where the guest freezes at some point when doing
vCPU hot-plug/unplug in a loop.


Both issues have a BZ at IBM. They can be mirrored to RH if needed.

> > 
> > Based on 5.2-rc1.
> > 
> > Available on GitHub:
> > 
> >     https://github.com/legoater/linux/commits/xive-5.2
> > 
> > Thanks,
> > 
> > C. 
> > 
> > Cédric Le Goater (3):
> >   KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
> >   KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
> >     reseting
> >   KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
> >     identifier
> > 
> >  arch/powerpc/kvm/book3s_xive_native.c | 46 ++++++++++++++++-----------
> >  1 file changed, 27 insertions(+), 19 deletions(-)
> >   
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
  2019-05-22 23:30   ` David Gibson
@ 2019-05-23  6:06     ` Cédric Le Goater
  -1 siblings, 0 replies; 24+ messages in thread
From: Cédric Le Goater @ 2019-05-23  6:06 UTC (permalink / raw)
  To: David Gibson; +Cc: kvm-ppc, Paul Mackerras, kvm

On 5/23/19 1:30 AM, David Gibson wrote:
> On Mon, May 20, 2019 at 09:15:11AM +0200, Cédric Le Goater wrote:
>> Hello,
>>
>> Here are a couple of fixes for issues in the XIVE KVM device when
>> testing the limits : RAM size and number of vCPUS.

This summary is wrong. RAM size was fixed in QEMU.

> How serious are the problems these patches fix?  I'm wondering if I
> need to make a backport for RHEL8.1.

Patch 1 is a cleanup patch. It does not fix any critical issues.

Patch 2 fixes CPU hotplug. The test on the EQ flag is at the wrong 
place :/ This is important I think.

Patch 3 fixes the maximum number of vCPUS supported. This one is 
less important maybe, unless we want to run a guest with 1024 vCPUs.
Which is quite slow to run on most P9 systems. 

QEMU emits a warning :

  warning: Number of SMP cpus requested (1024) exceeds the recommended cpus supported by KVM (120)

May be we should refuse to run QEMU when that number is above a 
certain threshold ? 

C. 



>>
>> Based on 5.2-rc1.
>>
>> Available on GitHub:
>>
>>     https://github.com/legoater/linux/commits/xive-5.2
>>
>> Thanks,
>>
>> C. 
>>
>> Cédric Le Goater (3):
>>   KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
>>   KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
>>     reseting
>>   KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
>>     identifier
>>
>>  arch/powerpc/kvm/book3s_xive_native.c | 46 ++++++++++++++++-----------
>>  1 file changed, 27 insertions(+), 19 deletions(-)
>>
> 


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

* Re: [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
@ 2019-05-23  6:06     ` Cédric Le Goater
  0 siblings, 0 replies; 24+ messages in thread
From: Cédric Le Goater @ 2019-05-23  6:06 UTC (permalink / raw)
  To: David Gibson; +Cc: kvm-ppc, Paul Mackerras, kvm

On 5/23/19 1:30 AM, David Gibson wrote:
> On Mon, May 20, 2019 at 09:15:11AM +0200, Cédric Le Goater wrote:
>> Hello,
>>
>> Here are a couple of fixes for issues in the XIVE KVM device when
>> testing the limits : RAM size and number of vCPUS.

This summary is wrong. RAM size was fixed in QEMU.

> How serious are the problems these patches fix?  I'm wondering if I
> need to make a backport for RHEL8.1.

Patch 1 is a cleanup patch. It does not fix any critical issues.

Patch 2 fixes CPU hotplug. The test on the EQ flag is at the wrong 
place :/ This is important I think.

Patch 3 fixes the maximum number of vCPUS supported. This one is 
less important maybe, unless we want to run a guest with 1024 vCPUs.
Which is quite slow to run on most P9 systems. 

QEMU emits a warning :

  warning: Number of SMP cpus requested (1024) exceeds the recommended cpus supported by KVM (120)

May be we should refuse to run QEMU when that number is above a 
certain threshold ? 

C. 



>>
>> Based on 5.2-rc1.
>>
>> Available on GitHub:
>>
>>     https://github.com/legoater/linux/commits/xive-5.2
>>
>> Thanks,
>>
>> C. 
>>
>> Cédric Le Goater (3):
>>   KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
>>   KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
>>     reseting
>>   KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
>>     identifier
>>
>>  arch/powerpc/kvm/book3s_xive_native.c | 46 ++++++++++++++++-----------
>>  1 file changed, 27 insertions(+), 19 deletions(-)
>>
> 

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

* Re: [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
  2019-05-23  6:01     ` Greg Kurz
@ 2019-05-23  6:27       ` David Gibson
  -1 siblings, 0 replies; 24+ messages in thread
From: David Gibson @ 2019-05-23  6:27 UTC (permalink / raw)
  To: Greg Kurz; +Cc: Cédric Le Goater, kvm-ppc, Paul Mackerras, kvm

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

On Thu, May 23, 2019 at 08:01:23AM +0200, Greg Kurz wrote:
> On Thu, 23 May 2019 09:30:43 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > On Mon, May 20, 2019 at 09:15:11AM +0200, Cédric Le Goater wrote:
> > > Hello,
> > > 
> > > Here are a couple of fixes for issues in the XIVE KVM device when
> > > testing the limits : RAM size and number of vCPUS.  
> > 
> > How serious are the problems these patches fix?  I'm wondering if I
> > need to make a backport for RHEL8.1.
> > 
> 
> Patch 2/3 fixes a QEMU error when hot-unplugging a vCPU:
> 
> qemu-system-ppc64: KVM_SET_DEVICE_ATTR failed: Group 4 attr 0x0000000000000046: Invalid argument
> 
> 
> Patch 3/3 fixes an issue where the guest freezes at some point when doing
> vCPU hot-plug/unplug in a loop.

Oh.. weird.  It's not clear to me how it would do that.

> Both issues have a BZ at IBM. They can be mirrored to RH if needed.

That would be helpful, thanks.




> 
> > > 
> > > Based on 5.2-rc1.
> > > 
> > > Available on GitHub:
> > > 
> > >     https://github.com/legoater/linux/commits/xive-5.2
> > > 
> > > Thanks,
> > > 
> > > C. 
> > > 
> > > Cédric Le Goater (3):
> > >   KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
> > >   KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
> > >     reseting
> > >   KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
> > >     identifier
> > > 
> > >  arch/powerpc/kvm/book3s_xive_native.c | 46 ++++++++++++++++-----------
> > >  1 file changed, 27 insertions(+), 19 deletions(-)
> > >   
> > 
> 



-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
@ 2019-05-23  6:27       ` David Gibson
  0 siblings, 0 replies; 24+ messages in thread
From: David Gibson @ 2019-05-23  6:27 UTC (permalink / raw)
  To: Greg Kurz; +Cc: Cédric Le Goater, kvm-ppc, Paul Mackerras, kvm

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

On Thu, May 23, 2019 at 08:01:23AM +0200, Greg Kurz wrote:
> On Thu, 23 May 2019 09:30:43 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > On Mon, May 20, 2019 at 09:15:11AM +0200, Cédric Le Goater wrote:
> > > Hello,
> > > 
> > > Here are a couple of fixes for issues in the XIVE KVM device when
> > > testing the limits : RAM size and number of vCPUS.  
> > 
> > How serious are the problems these patches fix?  I'm wondering if I
> > need to make a backport for RHEL8.1.
> > 
> 
> Patch 2/3 fixes a QEMU error when hot-unplugging a vCPU:
> 
> qemu-system-ppc64: KVM_SET_DEVICE_ATTR failed: Group 4 attr 0x0000000000000046: Invalid argument
> 
> 
> Patch 3/3 fixes an issue where the guest freezes at some point when doing
> vCPU hot-plug/unplug in a loop.

Oh.. weird.  It's not clear to me how it would do that.

> Both issues have a BZ at IBM. They can be mirrored to RH if needed.

That would be helpful, thanks.




> 
> > > 
> > > Based on 5.2-rc1.
> > > 
> > > Available on GitHub:
> > > 
> > >     https://github.com/legoater/linux/commits/xive-5.2
> > > 
> > > Thanks,
> > > 
> > > C. 
> > > 
> > > Cédric Le Goater (3):
> > >   KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
> > >   KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
> > >     reseting
> > >   KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
> > >     identifier
> > > 
> > >  arch/powerpc/kvm/book3s_xive_native.c | 46 ++++++++++++++++-----------
> > >  1 file changed, 27 insertions(+), 19 deletions(-)
> > >   
> > 
> 



-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
  2019-05-23  6:27       ` David Gibson
@ 2019-05-23 12:44         ` Greg Kurz
  -1 siblings, 0 replies; 24+ messages in thread
From: Greg Kurz @ 2019-05-23 12:44 UTC (permalink / raw)
  To: David Gibson; +Cc: Cédric Le Goater, kvm-ppc, Paul Mackerras, kvm

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

On Thu, 23 May 2019 16:27:15 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Thu, May 23, 2019 at 08:01:23AM +0200, Greg Kurz wrote:
> > On Thu, 23 May 2019 09:30:43 +1000
> > David Gibson <david@gibson.dropbear.id.au> wrote:
> >   
> > > On Mon, May 20, 2019 at 09:15:11AM +0200, Cédric Le Goater wrote:  
> > > > Hello,
> > > > 
> > > > Here are a couple of fixes for issues in the XIVE KVM device when
> > > > testing the limits : RAM size and number of vCPUS.    
> > > 
> > > How serious are the problems these patches fix?  I'm wondering if I
> > > need to make a backport for RHEL8.1.
> > >   
> > 
> > Patch 2/3 fixes a QEMU error when hot-unplugging a vCPU:
> > 
> > qemu-system-ppc64: KVM_SET_DEVICE_ATTR failed: Group 4 attr 0x0000000000000046: Invalid argument
> > 
> > 
> > Patch 3/3 fixes an issue where the guest freezes at some point when doing
> > vCPU hot-plug/unplug in a loop.  
> 
> Oh.. weird.  It's not clear to me how it would do that.
> 

Cedric provided a better description in some other mail: guest with 1024
vCPUs.

> > Both issues have a BZ at IBM. They can be mirrored to RH if needed.  
> 
> That would be helpful, thanks.
> 

Ok, I'll take care of that.

> 
> 
> 
> >   
> > > > 
> > > > Based on 5.2-rc1.
> > > > 
> > > > Available on GitHub:
> > > > 
> > > >     https://github.com/legoater/linux/commits/xive-5.2
> > > > 
> > > > Thanks,
> > > > 
> > > > C. 
> > > > 
> > > > Cédric Le Goater (3):
> > > >   KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
> > > >   KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
> > > >     reseting
> > > >   KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
> > > >     identifier
> > > > 
> > > >  arch/powerpc/kvm/book3s_xive_native.c | 46 ++++++++++++++++-----------
> > > >  1 file changed, 27 insertions(+), 19 deletions(-)
> > > >     
> > >   
> >   
> 
> 
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
@ 2019-05-23 12:44         ` Greg Kurz
  0 siblings, 0 replies; 24+ messages in thread
From: Greg Kurz @ 2019-05-23 12:44 UTC (permalink / raw)
  To: David Gibson; +Cc: Cédric Le Goater, kvm-ppc, Paul Mackerras, kvm

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

On Thu, 23 May 2019 16:27:15 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Thu, May 23, 2019 at 08:01:23AM +0200, Greg Kurz wrote:
> > On Thu, 23 May 2019 09:30:43 +1000
> > David Gibson <david@gibson.dropbear.id.au> wrote:
> >   
> > > On Mon, May 20, 2019 at 09:15:11AM +0200, Cédric Le Goater wrote:  
> > > > Hello,
> > > > 
> > > > Here are a couple of fixes for issues in the XIVE KVM device when
> > > > testing the limits : RAM size and number of vCPUS.    
> > > 
> > > How serious are the problems these patches fix?  I'm wondering if I
> > > need to make a backport for RHEL8.1.
> > >   
> > 
> > Patch 2/3 fixes a QEMU error when hot-unplugging a vCPU:
> > 
> > qemu-system-ppc64: KVM_SET_DEVICE_ATTR failed: Group 4 attr 0x0000000000000046: Invalid argument
> > 
> > 
> > Patch 3/3 fixes an issue where the guest freezes at some point when doing
> > vCPU hot-plug/unplug in a loop.  
> 
> Oh.. weird.  It's not clear to me how it would do that.
> 

Cedric provided a better description in some other mail: guest with 1024
vCPUs.

> > Both issues have a BZ at IBM. They can be mirrored to RH if needed.  
> 
> That would be helpful, thanks.
> 

Ok, I'll take care of that.

> 
> 
> 
> >   
> > > > 
> > > > Based on 5.2-rc1.
> > > > 
> > > > Available on GitHub:
> > > > 
> > > >     https://github.com/legoater/linux/commits/xive-5.2
> > > > 
> > > > Thanks,
> > > > 
> > > > C. 
> > > > 
> > > > Cédric Le Goater (3):
> > > >   KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
> > > >   KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
> > > >     reseting
> > > >   KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
> > > >     identifier
> > > > 
> > > >  arch/powerpc/kvm/book3s_xive_native.c | 46 ++++++++++++++++-----------
> > > >  1 file changed, 27 insertions(+), 19 deletions(-)
> > > >     
> > >   
> >   
> 
> 
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
  2019-05-20  7:15 ` Cédric Le Goater
@ 2019-05-31  6:33   ` Paul Mackerras
  -1 siblings, 0 replies; 24+ messages in thread
From: Paul Mackerras @ 2019-05-31  6:33 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: kvm-ppc, David Gibson, kvm

On Mon, May 20, 2019 at 09:15:11AM +0200, Cédric Le Goater wrote:
> Hello,
> 
> Here are a couple of fixes for issues in the XIVE KVM device when
> testing the limits : RAM size and number of vCPUS.
> 
> Based on 5.2-rc1.
> 
> Available on GitHub:
> 
>     https://github.com/legoater/linux/commits/xive-5.2
> 
> Thanks,
> 
> C. 
> 
> Cédric Le Goater (3):
>   KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
>   KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
>     reseting
>   KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
>     identifier

Thanks, series applied to my kvm-ppc-fixes branch.

Paul.

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

* Re: [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits
@ 2019-05-31  6:33   ` Paul Mackerras
  0 siblings, 0 replies; 24+ messages in thread
From: Paul Mackerras @ 2019-05-31  6:33 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: kvm-ppc, David Gibson, kvm

On Mon, May 20, 2019 at 09:15:11AM +0200, Cédric Le Goater wrote:
> Hello,
> 
> Here are a couple of fixes for issues in the XIVE KVM device when
> testing the limits : RAM size and number of vCPUS.
> 
> Based on 5.2-rc1.
> 
> Available on GitHub:
> 
>     https://github.com/legoater/linux/commits/xive-5.2
> 
> Thanks,
> 
> C. 
> 
> Cédric Le Goater (3):
>   KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released
>   KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when
>     reseting
>   KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU
>     identifier

Thanks, series applied to my kvm-ppc-fixes branch.

Paul.

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

end of thread, other threads:[~2019-05-31  6:38 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-20  7:15 [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits Cédric Le Goater
2019-05-20  7:15 ` Cédric Le Goater
2019-05-20  7:15 ` [PATCH 1/3] KVM: PPC: Book3S HV: XIVE: clear file mapping when device is released Cédric Le Goater
2019-05-20  7:15   ` Cédric Le Goater
2019-05-20  7:15 ` [PATCH 2/3] KVM: PPC: Book3S HV: XIVE: do not test the EQ flag validity when resetting Cédric Le Goater
2019-05-20  7:15   ` Cédric Le Goater
2019-05-20  8:06   ` Greg Kurz
2019-05-20  8:06     ` Greg Kurz
2019-05-20  7:15 ` [PATCH 3/3] KVM: PPC: Book3S HV: XIVE: fix the enforced limit on the vCPU identifier Cédric Le Goater
2019-05-20  7:15   ` Cédric Le Goater
2019-05-20  9:23   ` Greg Kurz
2019-05-20  9:23     ` Greg Kurz
2019-05-22 23:30 ` [PATCH 0/3] KVM: PPC: Book3S HV: XIVE: assorted fixes on vCPU and RAM limits David Gibson
2019-05-22 23:30   ` David Gibson
2019-05-23  6:01   ` Greg Kurz
2019-05-23  6:01     ` Greg Kurz
2019-05-23  6:27     ` David Gibson
2019-05-23  6:27       ` David Gibson
2019-05-23 12:44       ` Greg Kurz
2019-05-23 12:44         ` Greg Kurz
2019-05-23  6:06   ` Cédric Le Goater
2019-05-23  6:06     ` Cédric Le Goater
2019-05-31  6:33 ` Paul Mackerras
2019-05-31  6:33   ` Paul Mackerras

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.