All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL
@ 2019-09-11 15:52 ` Greg Kurz
  0 siblings, 0 replies; 10+ messages in thread
From: Greg Kurz @ 2019-09-11 15:52 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linux-kernel, linuxppc-dev, Cédric Le Goater, David Gibson

There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call
to return the 32-bit value 0xffffffff when OPAL has run out of IRQs.
Unfortunatelty, OPAL return values are signed 64-bit entities and
errors are supposed to be negative. If that happens, the linux code
confusingly treats 0xffffffff as a valid IRQ number and panics at some
point.

A fix was recently merged in skiboot:

e97391ae2bb5 ("xive: fix return value of opal_xive_allocate_irq()")

but we need a workaround anyway to support older skiboots already
in the field.

Internally convert 0xffffffff to OPAL_RESOURCE which is the usual error
returned upon resource exhaustion.

Cc: stable@vger.kernel.org # v4.12+
Signed-off-by: Greg Kurz <groug@kaod.org>
---
v2: - fix syntax error in changelog
    - Cc stable
    - rename original OPAL wrapper
    - rewrite fixup wrapper (style, use s64 and u32)
---
 arch/powerpc/include/asm/opal.h            |    2 +-
 arch/powerpc/platforms/powernv/opal-call.c |    2 +-
 arch/powerpc/sysdev/xive/native.c          |   11 +++++++++++
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 57bd029c715e..d5a0807d21db 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -272,7 +272,7 @@ int64_t opal_xive_get_vp_info(uint64_t vp,
 int64_t opal_xive_set_vp_info(uint64_t vp,
 			      uint64_t flags,
 			      uint64_t report_cl_pair);
-int64_t opal_xive_allocate_irq(uint32_t chip_id);
+int64_t opal_xive_allocate_irq_raw(uint32_t chip_id);
 int64_t opal_xive_free_irq(uint32_t girq);
 int64_t opal_xive_sync(uint32_t type, uint32_t id);
 int64_t opal_xive_dump(uint32_t type, uint32_t id);
diff --git a/arch/powerpc/platforms/powernv/opal-call.c b/arch/powerpc/platforms/powernv/opal-call.c
index 29ca523c1c79..dccdc9df5213 100644
--- a/arch/powerpc/platforms/powernv/opal-call.c
+++ b/arch/powerpc/platforms/powernv/opal-call.c
@@ -257,7 +257,7 @@ OPAL_CALL(opal_xive_set_queue_info,		OPAL_XIVE_SET_QUEUE_INFO);
 OPAL_CALL(opal_xive_donate_page,		OPAL_XIVE_DONATE_PAGE);
 OPAL_CALL(opal_xive_alloc_vp_block,		OPAL_XIVE_ALLOCATE_VP_BLOCK);
 OPAL_CALL(opal_xive_free_vp_block,		OPAL_XIVE_FREE_VP_BLOCK);
-OPAL_CALL(opal_xive_allocate_irq,		OPAL_XIVE_ALLOCATE_IRQ);
+OPAL_CALL(opal_xive_allocate_irq_raw,		OPAL_XIVE_ALLOCATE_IRQ);
 OPAL_CALL(opal_xive_free_irq,			OPAL_XIVE_FREE_IRQ);
 OPAL_CALL(opal_xive_get_vp_info,		OPAL_XIVE_GET_VP_INFO);
 OPAL_CALL(opal_xive_set_vp_info,		OPAL_XIVE_SET_VP_INFO);
diff --git a/arch/powerpc/sysdev/xive/native.c b/arch/powerpc/sysdev/xive/native.c
index 37987c815913..ad8ee7dd7f57 100644
--- a/arch/powerpc/sysdev/xive/native.c
+++ b/arch/powerpc/sysdev/xive/native.c
@@ -231,6 +231,17 @@ static bool xive_native_match(struct device_node *node)
 	return of_device_is_compatible(node, "ibm,opal-xive-vc");
 }
 
+static s64 opal_xive_allocate_irq(u32 chip_id)
+{
+	s64 irq = opal_xive_allocate_irq_raw(chip_id);
+
+	/*
+	 * Old versions of skiboot can incorrectly return 0xffffffff to
+	 * indicate no space, fix it up here.
+	 */
+	return irq == 0xffffffff ? OPAL_RESOURCE : irq;
+}
+
 #ifdef CONFIG_SMP
 static int xive_native_get_ipi(unsigned int cpu, struct xive_cpu *xc)
 {


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

* [PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL
@ 2019-09-11 15:52 ` Greg Kurz
  0 siblings, 0 replies; 10+ messages in thread
From: Greg Kurz @ 2019-09-11 15:52 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Paul Mackerras, Cédric Le Goater, David Gibson, linuxppc-dev,
	linux-kernel

There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call
to return the 32-bit value 0xffffffff when OPAL has run out of IRQs.
Unfortunatelty, OPAL return values are signed 64-bit entities and
errors are supposed to be negative. If that happens, the linux code
confusingly treats 0xffffffff as a valid IRQ number and panics at some
point.

A fix was recently merged in skiboot:

e97391ae2bb5 ("xive: fix return value of opal_xive_allocate_irq()")

but we need a workaround anyway to support older skiboots already
in the field.

Internally convert 0xffffffff to OPAL_RESOURCE which is the usual error
returned upon resource exhaustion.

Cc: stable@vger.kernel.org # v4.12+
Signed-off-by: Greg Kurz <groug@kaod.org>
---
v2: - fix syntax error in changelog
    - Cc stable
    - rename original OPAL wrapper
    - rewrite fixup wrapper (style, use s64 and u32)
---
 arch/powerpc/include/asm/opal.h            |    2 +-
 arch/powerpc/platforms/powernv/opal-call.c |    2 +-
 arch/powerpc/sysdev/xive/native.c          |   11 +++++++++++
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 57bd029c715e..d5a0807d21db 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -272,7 +272,7 @@ int64_t opal_xive_get_vp_info(uint64_t vp,
 int64_t opal_xive_set_vp_info(uint64_t vp,
 			      uint64_t flags,
 			      uint64_t report_cl_pair);
-int64_t opal_xive_allocate_irq(uint32_t chip_id);
+int64_t opal_xive_allocate_irq_raw(uint32_t chip_id);
 int64_t opal_xive_free_irq(uint32_t girq);
 int64_t opal_xive_sync(uint32_t type, uint32_t id);
 int64_t opal_xive_dump(uint32_t type, uint32_t id);
diff --git a/arch/powerpc/platforms/powernv/opal-call.c b/arch/powerpc/platforms/powernv/opal-call.c
index 29ca523c1c79..dccdc9df5213 100644
--- a/arch/powerpc/platforms/powernv/opal-call.c
+++ b/arch/powerpc/platforms/powernv/opal-call.c
@@ -257,7 +257,7 @@ OPAL_CALL(opal_xive_set_queue_info,		OPAL_XIVE_SET_QUEUE_INFO);
 OPAL_CALL(opal_xive_donate_page,		OPAL_XIVE_DONATE_PAGE);
 OPAL_CALL(opal_xive_alloc_vp_block,		OPAL_XIVE_ALLOCATE_VP_BLOCK);
 OPAL_CALL(opal_xive_free_vp_block,		OPAL_XIVE_FREE_VP_BLOCK);
-OPAL_CALL(opal_xive_allocate_irq,		OPAL_XIVE_ALLOCATE_IRQ);
+OPAL_CALL(opal_xive_allocate_irq_raw,		OPAL_XIVE_ALLOCATE_IRQ);
 OPAL_CALL(opal_xive_free_irq,			OPAL_XIVE_FREE_IRQ);
 OPAL_CALL(opal_xive_get_vp_info,		OPAL_XIVE_GET_VP_INFO);
 OPAL_CALL(opal_xive_set_vp_info,		OPAL_XIVE_SET_VP_INFO);
diff --git a/arch/powerpc/sysdev/xive/native.c b/arch/powerpc/sysdev/xive/native.c
index 37987c815913..ad8ee7dd7f57 100644
--- a/arch/powerpc/sysdev/xive/native.c
+++ b/arch/powerpc/sysdev/xive/native.c
@@ -231,6 +231,17 @@ static bool xive_native_match(struct device_node *node)
 	return of_device_is_compatible(node, "ibm,opal-xive-vc");
 }
 
+static s64 opal_xive_allocate_irq(u32 chip_id)
+{
+	s64 irq = opal_xive_allocate_irq_raw(chip_id);
+
+	/*
+	 * Old versions of skiboot can incorrectly return 0xffffffff to
+	 * indicate no space, fix it up here.
+	 */
+	return irq == 0xffffffff ? OPAL_RESOURCE : irq;
+}
+
 #ifdef CONFIG_SMP
 static int xive_native_get_ipi(unsigned int cpu, struct xive_cpu *xc)
 {


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

* Re: [PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL
  2019-09-11 15:52 ` Greg Kurz
@ 2019-09-11 16:02   ` Cédric Le Goater
  -1 siblings, 0 replies; 10+ messages in thread
From: Cédric Le Goater @ 2019-09-11 16:02 UTC (permalink / raw)
  To: Greg Kurz, Michael Ellerman; +Cc: linuxppc-dev, linux-kernel, David Gibson

On 11/09/2019 17:52, Greg Kurz wrote:
> There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call
> to return the 32-bit value 0xffffffff when OPAL has run out of IRQs.
> Unfortunatelty, OPAL return values are signed 64-bit entities and
> errors are supposed to be negative. If that happens, the linux code
> confusingly treats 0xffffffff as a valid IRQ number and panics at some
> point.
> 
> A fix was recently merged in skiboot:
> 
> e97391ae2bb5 ("xive: fix return value of opal_xive_allocate_irq()")
> 
> but we need a workaround anyway to support older skiboots already
> in the field.
> 
> Internally convert 0xffffffff to OPAL_RESOURCE which is the usual error
> returned upon resource exhaustion.
> 
> Cc: stable@vger.kernel.org # v4.12+
> Signed-off-by: Greg Kurz <groug@kaod.org>



Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> ---
> v2: - fix syntax error in changelog
>     - Cc stable
>     - rename original OPAL wrapper
>     - rewrite fixup wrapper (style, use s64 and u32)
> ---
>  arch/powerpc/include/asm/opal.h            |    2 +-
>  arch/powerpc/platforms/powernv/opal-call.c |    2 +-
>  arch/powerpc/sysdev/xive/native.c          |   11 +++++++++++
>  3 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
> index 57bd029c715e..d5a0807d21db 100644
> --- a/arch/powerpc/include/asm/opal.h
> +++ b/arch/powerpc/include/asm/opal.h
> @@ -272,7 +272,7 @@ int64_t opal_xive_get_vp_info(uint64_t vp,
>  int64_t opal_xive_set_vp_info(uint64_t vp,
>  			      uint64_t flags,
>  			      uint64_t report_cl_pair);
> -int64_t opal_xive_allocate_irq(uint32_t chip_id);
> +int64_t opal_xive_allocate_irq_raw(uint32_t chip_id);
>  int64_t opal_xive_free_irq(uint32_t girq);
>  int64_t opal_xive_sync(uint32_t type, uint32_t id);
>  int64_t opal_xive_dump(uint32_t type, uint32_t id);
> diff --git a/arch/powerpc/platforms/powernv/opal-call.c b/arch/powerpc/platforms/powernv/opal-call.c
> index 29ca523c1c79..dccdc9df5213 100644
> --- a/arch/powerpc/platforms/powernv/opal-call.c
> +++ b/arch/powerpc/platforms/powernv/opal-call.c
> @@ -257,7 +257,7 @@ OPAL_CALL(opal_xive_set_queue_info,		OPAL_XIVE_SET_QUEUE_INFO);
>  OPAL_CALL(opal_xive_donate_page,		OPAL_XIVE_DONATE_PAGE);
>  OPAL_CALL(opal_xive_alloc_vp_block,		OPAL_XIVE_ALLOCATE_VP_BLOCK);
>  OPAL_CALL(opal_xive_free_vp_block,		OPAL_XIVE_FREE_VP_BLOCK);
> -OPAL_CALL(opal_xive_allocate_irq,		OPAL_XIVE_ALLOCATE_IRQ);
> +OPAL_CALL(opal_xive_allocate_irq_raw,		OPAL_XIVE_ALLOCATE_IRQ);
>  OPAL_CALL(opal_xive_free_irq,			OPAL_XIVE_FREE_IRQ);
>  OPAL_CALL(opal_xive_get_vp_info,		OPAL_XIVE_GET_VP_INFO);
>  OPAL_CALL(opal_xive_set_vp_info,		OPAL_XIVE_SET_VP_INFO);
> diff --git a/arch/powerpc/sysdev/xive/native.c b/arch/powerpc/sysdev/xive/native.c
> index 37987c815913..ad8ee7dd7f57 100644
> --- a/arch/powerpc/sysdev/xive/native.c
> +++ b/arch/powerpc/sysdev/xive/native.c
> @@ -231,6 +231,17 @@ static bool xive_native_match(struct device_node *node)
>  	return of_device_is_compatible(node, "ibm,opal-xive-vc");
>  }
>  
> +static s64 opal_xive_allocate_irq(u32 chip_id)
> +{
> +	s64 irq = opal_xive_allocate_irq_raw(chip_id);
> +
> +	/*
> +	 * Old versions of skiboot can incorrectly return 0xffffffff to
> +	 * indicate no space, fix it up here.
> +	 */
> +	return irq == 0xffffffff ? OPAL_RESOURCE : irq;
> +}
> +
>  #ifdef CONFIG_SMP
>  static int xive_native_get_ipi(unsigned int cpu, struct xive_cpu *xc)
>  {
> 


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

* Re: [PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL
@ 2019-09-11 16:02   ` Cédric Le Goater
  0 siblings, 0 replies; 10+ messages in thread
From: Cédric Le Goater @ 2019-09-11 16:02 UTC (permalink / raw)
  To: Greg Kurz, Michael Ellerman
  Cc: Paul Mackerras, David Gibson, linuxppc-dev, linux-kernel

On 11/09/2019 17:52, Greg Kurz wrote:
> There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call
> to return the 32-bit value 0xffffffff when OPAL has run out of IRQs.
> Unfortunatelty, OPAL return values are signed 64-bit entities and
> errors are supposed to be negative. If that happens, the linux code
> confusingly treats 0xffffffff as a valid IRQ number and panics at some
> point.
> 
> A fix was recently merged in skiboot:
> 
> e97391ae2bb5 ("xive: fix return value of opal_xive_allocate_irq()")
> 
> but we need a workaround anyway to support older skiboots already
> in the field.
> 
> Internally convert 0xffffffff to OPAL_RESOURCE which is the usual error
> returned upon resource exhaustion.
> 
> Cc: stable@vger.kernel.org # v4.12+
> Signed-off-by: Greg Kurz <groug@kaod.org>



Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> ---
> v2: - fix syntax error in changelog
>     - Cc stable
>     - rename original OPAL wrapper
>     - rewrite fixup wrapper (style, use s64 and u32)
> ---
>  arch/powerpc/include/asm/opal.h            |    2 +-
>  arch/powerpc/platforms/powernv/opal-call.c |    2 +-
>  arch/powerpc/sysdev/xive/native.c          |   11 +++++++++++
>  3 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
> index 57bd029c715e..d5a0807d21db 100644
> --- a/arch/powerpc/include/asm/opal.h
> +++ b/arch/powerpc/include/asm/opal.h
> @@ -272,7 +272,7 @@ int64_t opal_xive_get_vp_info(uint64_t vp,
>  int64_t opal_xive_set_vp_info(uint64_t vp,
>  			      uint64_t flags,
>  			      uint64_t report_cl_pair);
> -int64_t opal_xive_allocate_irq(uint32_t chip_id);
> +int64_t opal_xive_allocate_irq_raw(uint32_t chip_id);
>  int64_t opal_xive_free_irq(uint32_t girq);
>  int64_t opal_xive_sync(uint32_t type, uint32_t id);
>  int64_t opal_xive_dump(uint32_t type, uint32_t id);
> diff --git a/arch/powerpc/platforms/powernv/opal-call.c b/arch/powerpc/platforms/powernv/opal-call.c
> index 29ca523c1c79..dccdc9df5213 100644
> --- a/arch/powerpc/platforms/powernv/opal-call.c
> +++ b/arch/powerpc/platforms/powernv/opal-call.c
> @@ -257,7 +257,7 @@ OPAL_CALL(opal_xive_set_queue_info,		OPAL_XIVE_SET_QUEUE_INFO);
>  OPAL_CALL(opal_xive_donate_page,		OPAL_XIVE_DONATE_PAGE);
>  OPAL_CALL(opal_xive_alloc_vp_block,		OPAL_XIVE_ALLOCATE_VP_BLOCK);
>  OPAL_CALL(opal_xive_free_vp_block,		OPAL_XIVE_FREE_VP_BLOCK);
> -OPAL_CALL(opal_xive_allocate_irq,		OPAL_XIVE_ALLOCATE_IRQ);
> +OPAL_CALL(opal_xive_allocate_irq_raw,		OPAL_XIVE_ALLOCATE_IRQ);
>  OPAL_CALL(opal_xive_free_irq,			OPAL_XIVE_FREE_IRQ);
>  OPAL_CALL(opal_xive_get_vp_info,		OPAL_XIVE_GET_VP_INFO);
>  OPAL_CALL(opal_xive_set_vp_info,		OPAL_XIVE_SET_VP_INFO);
> diff --git a/arch/powerpc/sysdev/xive/native.c b/arch/powerpc/sysdev/xive/native.c
> index 37987c815913..ad8ee7dd7f57 100644
> --- a/arch/powerpc/sysdev/xive/native.c
> +++ b/arch/powerpc/sysdev/xive/native.c
> @@ -231,6 +231,17 @@ static bool xive_native_match(struct device_node *node)
>  	return of_device_is_compatible(node, "ibm,opal-xive-vc");
>  }
>  
> +static s64 opal_xive_allocate_irq(u32 chip_id)
> +{
> +	s64 irq = opal_xive_allocate_irq_raw(chip_id);
> +
> +	/*
> +	 * Old versions of skiboot can incorrectly return 0xffffffff to
> +	 * indicate no space, fix it up here.
> +	 */
> +	return irq == 0xffffffff ? OPAL_RESOURCE : irq;
> +}
> +
>  #ifdef CONFIG_SMP
>  static int xive_native_get_ipi(unsigned int cpu, struct xive_cpu *xc)
>  {
> 


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

* Re: [PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL
       [not found] ` <20190912073049.CF36B20830@mail.kernel.org>
@ 2019-09-13 11:12   ` Greg Kurz
  2019-09-17  4:09     ` Michael Ellerman
  0 siblings, 1 reply; 10+ messages in thread
From: Greg Kurz @ 2019-09-13 11:12 UTC (permalink / raw)
  To: Sasha Levin; +Cc: Michael Ellerman, Paul Mackerras, stable

On Thu, 12 Sep 2019 07:30:49 +0000
Sasha Levin <sashal@kernel.org> wrote:

> Hi,
> 
> [This is an automated email]
> 
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: 4.12+
> 
> The bot has tested the following trees: v5.2.14, v4.19.72, v4.14.143.
> 
> v5.2.14: Build OK!
> v4.19.72: Failed to apply! Possible dependencies:
>     75d9fc7fd94e ("powerpc/powernv: move OPAL call wrapper tracing and interrupt handling to C")
> 

This is the only dependency indeed.

> v4.14.143: Failed to apply! Possible dependencies:
>     104daea149c4 ("kconfig: reference environment variables directly and remove 'option env='")
>     21c54b774744 ("kconfig: show compiler version text in the top comment")
>     315bab4e972d ("kbuild: fix endless syncconfig in case arch Makefile sets CROSS_COMPILE")
>     3298b690b21c ("kbuild: Add a cache for generated variables")
>     4e56207130ed ("kbuild: Cache a few more calls to the compiler")
>     75d9fc7fd94e ("powerpc/powernv: move OPAL call wrapper tracing and interrupt handling to C")
>     8f2133cc0e1f ("powerpc/pseries: hcall_exit tracepoint retval should be signed")
>     9a234a2e3843 ("kbuild: create directory for make cache only when necessary")
>     d677a4d60193 ("Makefile: support flag -fsanitizer-coverage=trace-cmp")
>     e08d6de4e532 ("kbuild: remove kbuild cache")
>     e17c400ae194 ("kbuild: shrink .cache.mk when it exceeds 1000 lines")
>     e501ce957a78 ("x86: Force asm-goto")
>     e9666d10a567 ("jump_label: move 'asm goto' support test to Kconfig")
> 

That's quite a lot of patches to workaround a hard to hit skiboot bug.
As an alternative, the patch can be backported so that it applies the
following change:

-OPAL_CALL(opal_xive_allocate_irq,              OPAL_XIVE_ALLOCATE_IRQ);
+OPAL_CALL(opal_xive_allocate_irq_raw,          OPAL_XIVE_ALLOCATE_IRQ);

to "arch/powerpc/platforms/powernv/opal-wrappers.S"
instead of "arch/powerpc/platforms/powernv/opal-call.c" .

BTW, this could also be done for 4.19.y .

> 
> NOTE: The patch will not be queued to stable trees until it is upstream.
> 
> How should we proceed with this patch?
> 

Michael ?

> --
> Thanks,
> Sasha


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

* Re: [PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL
  2019-09-13 11:12   ` Greg Kurz
@ 2019-09-17  4:09     ` Michael Ellerman
  2019-09-17  5:06       ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Ellerman @ 2019-09-17  4:09 UTC (permalink / raw)
  To: Greg Kurz, Sasha Levin; +Cc: Paul Mackerras, stable

Greg Kurz <groug@kaod.org> writes:
> On Thu, 12 Sep 2019 07:30:49 +0000
> Sasha Levin <sashal@kernel.org> wrote:
>
>> Hi,
>> 
>> [This is an automated email]
>> 
>> This commit has been processed because it contains a -stable tag.
>> The stable tag indicates that it's relevant for the following trees: 4.12+
>> 
>> The bot has tested the following trees: v5.2.14, v4.19.72, v4.14.143.
>> 
>> v5.2.14: Build OK!
>> v4.19.72: Failed to apply! Possible dependencies:
>>     75d9fc7fd94e ("powerpc/powernv: move OPAL call wrapper tracing and interrupt handling to C")
>
> This is the only dependency indeed.

But it's a large and intrusive change, so we don't want to backport it
just for this.

>> v4.14.143: Failed to apply! Possible dependencies:
>>     104daea149c4 ("kconfig: reference environment variables directly and remove 'option env='")
>>     21c54b774744 ("kconfig: show compiler version text in the top comment")
>>     315bab4e972d ("kbuild: fix endless syncconfig in case arch Makefile sets CROSS_COMPILE")
>>     3298b690b21c ("kbuild: Add a cache for generated variables")
>>     4e56207130ed ("kbuild: Cache a few more calls to the compiler")
>>     75d9fc7fd94e ("powerpc/powernv: move OPAL call wrapper tracing and interrupt handling to C")
>>     8f2133cc0e1f ("powerpc/pseries: hcall_exit tracepoint retval should be signed")
>>     9a234a2e3843 ("kbuild: create directory for make cache only when necessary")
>>     d677a4d60193 ("Makefile: support flag -fsanitizer-coverage=trace-cmp")
>>     e08d6de4e532 ("kbuild: remove kbuild cache")
>>     e17c400ae194 ("kbuild: shrink .cache.mk when it exceeds 1000 lines")
>>     e501ce957a78 ("x86: Force asm-goto")
>>     e9666d10a567 ("jump_label: move 'asm goto' support test to Kconfig")
>> 
>
> That's quite a lot of patches to workaround a hard to hit skiboot bug.
> As an alternative, the patch can be backported so that it applies the
> following change:
>
> -OPAL_CALL(opal_xive_allocate_irq,              OPAL_XIVE_ALLOCATE_IRQ);
> +OPAL_CALL(opal_xive_allocate_irq_raw,          OPAL_XIVE_ALLOCATE_IRQ);
>
> to "arch/powerpc/platforms/powernv/opal-wrappers.S"
> instead of "arch/powerpc/platforms/powernv/opal-call.c" .
>
> BTW, this could also be done for 4.19.y .
>
>> 
>> NOTE: The patch will not be queued to stable trees until it is upstream.
>> 
>> How should we proceed with this patch?
>> 
>
> Michael ?

We should do a manual backport for v4.14 and v4.19. Greg do you have
cycles to do that?

cheers

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

* Re: [PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL
  2019-09-17  4:09     ` Michael Ellerman
@ 2019-09-17  5:06       ` Greg KH
  2019-09-17  6:13         ` Greg Kurz
  0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2019-09-17  5:06 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Greg Kurz, Sasha Levin, Paul Mackerras, stable

On Tue, Sep 17, 2019 at 02:09:43PM +1000, Michael Ellerman wrote:
> Greg Kurz <groug@kaod.org> writes:
> > On Thu, 12 Sep 2019 07:30:49 +0000
> > Sasha Levin <sashal@kernel.org> wrote:
> >
> >> Hi,
> >> 
> >> [This is an automated email]
> >> 
> >> This commit has been processed because it contains a -stable tag.
> >> The stable tag indicates that it's relevant for the following trees: 4.12+
> >> 
> >> The bot has tested the following trees: v5.2.14, v4.19.72, v4.14.143.
> >> 
> >> v5.2.14: Build OK!
> >> v4.19.72: Failed to apply! Possible dependencies:
> >>     75d9fc7fd94e ("powerpc/powernv: move OPAL call wrapper tracing and interrupt handling to C")
> >
> > This is the only dependency indeed.
> 
> But it's a large and intrusive change, so we don't want to backport it
> just for this.
> 
> >> v4.14.143: Failed to apply! Possible dependencies:
> >>     104daea149c4 ("kconfig: reference environment variables directly and remove 'option env='")
> >>     21c54b774744 ("kconfig: show compiler version text in the top comment")
> >>     315bab4e972d ("kbuild: fix endless syncconfig in case arch Makefile sets CROSS_COMPILE")
> >>     3298b690b21c ("kbuild: Add a cache for generated variables")
> >>     4e56207130ed ("kbuild: Cache a few more calls to the compiler")
> >>     75d9fc7fd94e ("powerpc/powernv: move OPAL call wrapper tracing and interrupt handling to C")
> >>     8f2133cc0e1f ("powerpc/pseries: hcall_exit tracepoint retval should be signed")
> >>     9a234a2e3843 ("kbuild: create directory for make cache only when necessary")
> >>     d677a4d60193 ("Makefile: support flag -fsanitizer-coverage=trace-cmp")
> >>     e08d6de4e532 ("kbuild: remove kbuild cache")
> >>     e17c400ae194 ("kbuild: shrink .cache.mk when it exceeds 1000 lines")
> >>     e501ce957a78 ("x86: Force asm-goto")
> >>     e9666d10a567 ("jump_label: move 'asm goto' support test to Kconfig")
> >> 
> >
> > That's quite a lot of patches to workaround a hard to hit skiboot bug.
> > As an alternative, the patch can be backported so that it applies the
> > following change:
> >
> > -OPAL_CALL(opal_xive_allocate_irq,              OPAL_XIVE_ALLOCATE_IRQ);
> > +OPAL_CALL(opal_xive_allocate_irq_raw,          OPAL_XIVE_ALLOCATE_IRQ);
> >
> > to "arch/powerpc/platforms/powernv/opal-wrappers.S"
> > instead of "arch/powerpc/platforms/powernv/opal-call.c" .
> >
> > BTW, this could also be done for 4.19.y .
> >
> >> 
> >> NOTE: The patch will not be queued to stable trees until it is upstream.
> >> 
> >> How should we proceed with this patch?
> >> 
> >
> > Michael ?
> 
> We should do a manual backport for v4.14 and v4.19. Greg do you have
> cycles to do that?

Me?  No, sorry.  If you want this fix there, I need someone to send the
backport.

thanks,

greg k-h

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

* Re: [PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL
  2019-09-17  5:06       ` Greg KH
@ 2019-09-17  6:13         ` Greg Kurz
  0 siblings, 0 replies; 10+ messages in thread
From: Greg Kurz @ 2019-09-17  6:13 UTC (permalink / raw)
  To: Greg KH; +Cc: Michael Ellerman, Sasha Levin, Paul Mackerras, stable

On Tue, 17 Sep 2019 07:06:28 +0200
Greg KH <greg@kroah.com> wrote:

> On Tue, Sep 17, 2019 at 02:09:43PM +1000, Michael Ellerman wrote:
> > Greg Kurz <groug@kaod.org> writes:
> > > On Thu, 12 Sep 2019 07:30:49 +0000
> > > Sasha Levin <sashal@kernel.org> wrote:
> > >
> > >> Hi,
> > >> 
> > >> [This is an automated email]
> > >> 
> > >> This commit has been processed because it contains a -stable tag.
> > >> The stable tag indicates that it's relevant for the following trees: 4.12+
> > >> 
> > >> The bot has tested the following trees: v5.2.14, v4.19.72, v4.14.143.
> > >> 
> > >> v5.2.14: Build OK!
> > >> v4.19.72: Failed to apply! Possible dependencies:
> > >>     75d9fc7fd94e ("powerpc/powernv: move OPAL call wrapper tracing and interrupt handling to C")
> > >
> > > This is the only dependency indeed.
> > 
> > But it's a large and intrusive change, so we don't want to backport it
> > just for this.
> > 
> > >> v4.14.143: Failed to apply! Possible dependencies:
> > >>     104daea149c4 ("kconfig: reference environment variables directly and remove 'option env='")
> > >>     21c54b774744 ("kconfig: show compiler version text in the top comment")
> > >>     315bab4e972d ("kbuild: fix endless syncconfig in case arch Makefile sets CROSS_COMPILE")
> > >>     3298b690b21c ("kbuild: Add a cache for generated variables")
> > >>     4e56207130ed ("kbuild: Cache a few more calls to the compiler")
> > >>     75d9fc7fd94e ("powerpc/powernv: move OPAL call wrapper tracing and interrupt handling to C")
> > >>     8f2133cc0e1f ("powerpc/pseries: hcall_exit tracepoint retval should be signed")
> > >>     9a234a2e3843 ("kbuild: create directory for make cache only when necessary")
> > >>     d677a4d60193 ("Makefile: support flag -fsanitizer-coverage=trace-cmp")
> > >>     e08d6de4e532 ("kbuild: remove kbuild cache")
> > >>     e17c400ae194 ("kbuild: shrink .cache.mk when it exceeds 1000 lines")
> > >>     e501ce957a78 ("x86: Force asm-goto")
> > >>     e9666d10a567 ("jump_label: move 'asm goto' support test to Kconfig")
> > >> 
> > >
> > > That's quite a lot of patches to workaround a hard to hit skiboot bug.
> > > As an alternative, the patch can be backported so that it applies the
> > > following change:
> > >
> > > -OPAL_CALL(opal_xive_allocate_irq,              OPAL_XIVE_ALLOCATE_IRQ);
> > > +OPAL_CALL(opal_xive_allocate_irq_raw,          OPAL_XIVE_ALLOCATE_IRQ);
> > >
> > > to "arch/powerpc/platforms/powernv/opal-wrappers.S"
> > > instead of "arch/powerpc/platforms/powernv/opal-call.c" .
> > >
> > > BTW, this could also be done for 4.19.y .
> > >
> > >> 
> > >> NOTE: The patch will not be queued to stable trees until it is upstream.
> > >> 
> > >> How should we proceed with this patch?
> > >> 
> > >
> > > Michael ?
> > 
> > We should do a manual backport for v4.14 and v4.19. Greg do you have
> > cycles to do that?
> 
> Me?  No, sorry.  If you want this fix there, I need someone to send the
> backport.
> 

Heh I guess Michael was asking me :) I'll send the backport.

Cheers,

--
Greg

> thanks,
> 
> greg k-h


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

* Re: [PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL
  2019-09-11 15:52 ` Greg Kurz
@ 2019-09-19 10:26   ` Michael Ellerman
  -1 siblings, 0 replies; 10+ messages in thread
From: Michael Ellerman @ 2019-09-19 10:26 UTC (permalink / raw)
  To: Greg Kurz; +Cc: David Gibson, linuxppc-dev, linux-kernel, Cédric Le Goater

On Wed, 2019-09-11 at 15:52:18 UTC, Greg Kurz wrote:
> There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call
> to return the 32-bit value 0xffffffff when OPAL has run out of IRQs.
> Unfortunatelty, OPAL return values are signed 64-bit entities and
> errors are supposed to be negative. If that happens, the linux code
> confusingly treats 0xffffffff as a valid IRQ number and panics at some
> point.
> 
> A fix was recently merged in skiboot:
> 
> e97391ae2bb5 ("xive: fix return value of opal_xive_allocate_irq()")
> 
> but we need a workaround anyway to support older skiboots already
> in the field.
> 
> Internally convert 0xffffffff to OPAL_RESOURCE which is the usual error
> returned upon resource exhaustion.
> 
> Cc: stable@vger.kernel.org # v4.12+
> Signed-off-by: Greg Kurz <groug@kaod.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/6ccb4ac2bf8a35c694ead92f8ac5530a16e8f2c8

cheers

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

* Re: [PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL
@ 2019-09-19 10:26   ` Michael Ellerman
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Ellerman @ 2019-09-19 10:26 UTC (permalink / raw)
  To: Greg Kurz; +Cc: linux-kernel, linuxppc-dev, Cédric Le Goater, David Gibson

On Wed, 2019-09-11 at 15:52:18 UTC, Greg Kurz wrote:
> There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call
> to return the 32-bit value 0xffffffff when OPAL has run out of IRQs.
> Unfortunatelty, OPAL return values are signed 64-bit entities and
> errors are supposed to be negative. If that happens, the linux code
> confusingly treats 0xffffffff as a valid IRQ number and panics at some
> point.
> 
> A fix was recently merged in skiboot:
> 
> e97391ae2bb5 ("xive: fix return value of opal_xive_allocate_irq()")
> 
> but we need a workaround anyway to support older skiboots already
> in the field.
> 
> Internally convert 0xffffffff to OPAL_RESOURCE which is the usual error
> returned upon resource exhaustion.
> 
> Cc: stable@vger.kernel.org # v4.12+
> Signed-off-by: Greg Kurz <groug@kaod.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/6ccb4ac2bf8a35c694ead92f8ac5530a16e8f2c8

cheers

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

end of thread, other threads:[~2019-09-19 11:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-11 15:52 [PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL Greg Kurz
2019-09-11 15:52 ` Greg Kurz
2019-09-11 16:02 ` Cédric Le Goater
2019-09-11 16:02   ` Cédric Le Goater
     [not found] ` <20190912073049.CF36B20830@mail.kernel.org>
2019-09-13 11:12   ` Greg Kurz
2019-09-17  4:09     ` Michael Ellerman
2019-09-17  5:06       ` Greg KH
2019-09-17  6:13         ` Greg Kurz
2019-09-19 10:26 ` Michael Ellerman
2019-09-19 10:26   ` Michael Ellerman

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.