* [PATCH] powerpc/pasemi: Defer Nemo IRQ initialization
@ 2026-10-24 7:55 chzigotzky
2026-10-28 3:53 ` Christian Zigotzky
2026-11-02 3:34 ` Ritesh Harjani
0 siblings, 2 replies; 5+ messages in thread
From: chzigotzky @ 2026-10-24 7:55 UTC (permalink / raw)
To: maddy, mpe
Cc: npiggin, linuxppc-dev, Christian Zigotzky A-EON Open Source,
Darren Stevens, Christian Zigotzky
From: Christian Zigotzky A-EON Open Source <info@xenosoft.de>
Since pas_pci_init() is now called later during boot, the i8259
initialization in pas_init_IRQ() happens too early and accesses
registers that are not yet mapped, preventing the board from booting.
Move the Nemo-specific i8259 initialization to pas_add_bridge(),
after the ISA bridge has been discovered.
Suggested-by: Darren Stevens <darren@stevens-zone.net>
Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Christian Zigotzky A-EON Open Source <info@xenosoft.de>
---
arch/powerpc/platforms/pasemi/pasemi.h | 6 ++++++
arch/powerpc/platforms/pasemi/pci.c | 5 +++++
arch/powerpc/platforms/pasemi/setup.c | 12 ++++--------
3 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/platforms/pasemi/pasemi.h b/arch/powerpc/platforms/pasemi/pasemi.h
index 6f6743b8e48d..01bcfa258625 100644
--- a/arch/powerpc/platforms/pasemi/pasemi.h
+++ b/arch/powerpc/platforms/pasemi/pasemi.h
@@ -7,6 +7,12 @@ extern void pas_pci_init(void);
struct pci_dev;
extern void pas_pci_dma_dev_setup(struct pci_dev *dev);
+#ifdef CONFIG_PPC_PASEMI_NEMO
+void __init nemo_init_IRQ(void);
+#else
+static inline void __init nemo_init_IRQ(void) { }
+#endif
+
void __iomem *__init pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset);
extern void __init pasemi_map_registers(void);
diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index 2df955274652..fb53782da7ec 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -265,6 +265,11 @@ static int __init pas_add_bridge(struct device_node *dev)
*/
isa_bridge_find_early(hose);
+ /*
+ * ISA bridge is now active, add the i8259 cascade (if needed)
+ */
+ nemo_init_IRQ();
+
return 0;
}
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index 45792ecd5dfd..7a961f2a228f 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -216,10 +216,12 @@ static void sb600_8259_cascade(struct irq_desc *desc)
chip->irq_eoi(&desc->irq_data);
}
-static void __init nemo_init_IRQ(struct mpic *mpic)
+void __init nemo_init_IRQ(void)
{
struct device_node *np;
int gpio_virq;
+ struct mpic *mpic;
+
/* Connect the SB600's legacy i8259 controller */
np = of_find_node_by_path("/pxp@0,e0000000");
i8259_init(np, 0);
@@ -230,14 +232,10 @@ static void __init nemo_init_IRQ(struct mpic *mpic)
irq_set_chained_handler(gpio_virq, sb600_8259_cascade);
mpic_unmask_irq(irq_get_irq_data(gpio_virq));
+ mpic = irq_get_chip_data(gpio_virq);
irq_set_default_domain(mpic->irqhost);
}
-#else
-
-static inline void nemo_init_IRQ(struct mpic *mpic)
-{
-}
#endif
static __init void pas_init_IRQ(void)
@@ -300,8 +298,6 @@ static __init void pas_init_IRQ(void)
mpic_unmask_irq(irq_get_irq_data(nmi_virq));
}
- nemo_init_IRQ(mpic);
-
of_node_put(mpic_node);
of_node_put(root);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH] powerpc/pasemi: Defer Nemo IRQ initialization
2026-10-24 7:55 [PATCH] powerpc/pasemi: Defer Nemo IRQ initialization chzigotzky
@ 2026-10-28 3:53 ` Christian Zigotzky
2026-11-02 3:34 ` Ritesh Harjani
1 sibling, 0 replies; 5+ messages in thread
From: Christian Zigotzky @ 2026-10-28 3:53 UTC (permalink / raw)
To: maddy, mpe, linuxppc-dev
Cc: npiggin, Christian Zigotzky A-EON Open Source, Darren Stevens,
R.T.Dickinson, mad skateman, Damien Stewart, oe-kbuild-all,
Philip Li
Hi all,
I have created a new patch. I hope it is OK. It works without any problems.
Thanks,
Christian
On 24/10/26 09:55, chzigotzky@xenosoft.de wrote:
> From: Christian Zigotzky A-EON Open Source <info@xenosoft.de>
>
> Since pas_pci_init() is now called later during boot, the i8259
> initialization in pas_init_IRQ() happens too early and accesses
> registers that are not yet mapped, preventing the board from booting.
>
> Move the Nemo-specific i8259 initialization to pas_add_bridge(),
> after the ISA bridge has been discovered.
>
> Suggested-by: Darren Stevens <darren@stevens-zone.net>
> Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
> Signed-off-by: Christian Zigotzky A-EON Open Source <info@xenosoft.de>
> ---
> arch/powerpc/platforms/pasemi/pasemi.h | 6 ++++++
> arch/powerpc/platforms/pasemi/pci.c | 5 +++++
> arch/powerpc/platforms/pasemi/setup.c | 12 ++++--------
> 3 files changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pasemi/pasemi.h b/arch/powerpc/platforms/pasemi/pasemi.h
> index 6f6743b8e48d..01bcfa258625 100644
> --- a/arch/powerpc/platforms/pasemi/pasemi.h
> +++ b/arch/powerpc/platforms/pasemi/pasemi.h
> @@ -7,6 +7,12 @@ extern void pas_pci_init(void);
> struct pci_dev;
> extern void pas_pci_dma_dev_setup(struct pci_dev *dev);
>
> +#ifdef CONFIG_PPC_PASEMI_NEMO
> +void __init nemo_init_IRQ(void);
> +#else
> +static inline void __init nemo_init_IRQ(void) { }
> +#endif
> +
> void __iomem *__init pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset);
>
> extern void __init pasemi_map_registers(void);
> diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
> index 2df955274652..fb53782da7ec 100644
> --- a/arch/powerpc/platforms/pasemi/pci.c
> +++ b/arch/powerpc/platforms/pasemi/pci.c
> @@ -265,6 +265,11 @@ static int __init pas_add_bridge(struct device_node *dev)
> */
> isa_bridge_find_early(hose);
>
> + /*
> + * ISA bridge is now active, add the i8259 cascade (if needed)
> + */
> + nemo_init_IRQ();
> +
> return 0;
> }
>
> diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
> index 45792ecd5dfd..7a961f2a228f 100644
> --- a/arch/powerpc/platforms/pasemi/setup.c
> +++ b/arch/powerpc/platforms/pasemi/setup.c
> @@ -216,10 +216,12 @@ static void sb600_8259_cascade(struct irq_desc *desc)
> chip->irq_eoi(&desc->irq_data);
> }
>
> -static void __init nemo_init_IRQ(struct mpic *mpic)
> +void __init nemo_init_IRQ(void)
> {
> struct device_node *np;
> int gpio_virq;
> + struct mpic *mpic;
> +
> /* Connect the SB600's legacy i8259 controller */
> np = of_find_node_by_path("/pxp@0,e0000000");
> i8259_init(np, 0);
> @@ -230,14 +232,10 @@ static void __init nemo_init_IRQ(struct mpic *mpic)
> irq_set_chained_handler(gpio_virq, sb600_8259_cascade);
> mpic_unmask_irq(irq_get_irq_data(gpio_virq));
>
> + mpic = irq_get_chip_data(gpio_virq);
> irq_set_default_domain(mpic->irqhost);
> }
>
> -#else
> -
> -static inline void nemo_init_IRQ(struct mpic *mpic)
> -{
> -}
> #endif
>
> static __init void pas_init_IRQ(void)
> @@ -300,8 +298,6 @@ static __init void pas_init_IRQ(void)
> mpic_unmask_irq(irq_get_irq_data(nmi_virq));
> }
>
> - nemo_init_IRQ(mpic);
> -
> of_node_put(mpic_node);
> of_node_put(root);
> }
--
Sent with BrassMonkey 35.0.2 (https://github.com/chzigotzky/Web-Browsers-and-Suites-for-Linux-PPC/releases/tag/BrassMonkey_35.0.2)
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] powerpc/pasemi: Defer Nemo IRQ initialization
2026-10-24 7:55 [PATCH] powerpc/pasemi: Defer Nemo IRQ initialization chzigotzky
2026-10-28 3:53 ` Christian Zigotzky
@ 2026-11-02 3:34 ` Ritesh Harjani
2026-11-02 5:20 ` Christian Zigotzky
1 sibling, 1 reply; 5+ messages in thread
From: Ritesh Harjani @ 2026-11-02 3:34 UTC (permalink / raw)
To: chzigotzky, maddy, mpe
Cc: npiggin, linuxppc-dev, Christian Zigotzky A-EON Open Source,
Darren Stevens, Christian Zigotzky
chzigotzky@xenosoft.de writes:
> From: Christian Zigotzky A-EON Open Source <info@xenosoft.de>
>
> Since pas_pci_init() is now called later during boot, the i8259
> initialization in pas_init_IRQ() happens too early and accesses
> registers that are not yet mapped, preventing the board from booting.
>
> Move the Nemo-specific i8259 initialization to pas_add_bridge(),
> after the ISA bridge has been discovered.
That make sense to me. The patch looks good. However, shouldn't we also
add Fixes tag and Cc: stable tag - so that this gets backported to older
stable kernels.
Fixes: c144bc719234 ("powerpc/pasemi: Move PHB discovery")
Cc: stable@vger.kernel.org
I think the fixes tag should be above - but feel free to correct that.
Otherwise looks good to me. Feel free to add:
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
>
> Suggested-by: Darren Stevens <darren@stevens-zone.net>
> Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
> Signed-off-by: Christian Zigotzky A-EON Open Source <info@xenosoft.de>
> ---
> arch/powerpc/platforms/pasemi/pasemi.h | 6 ++++++
> arch/powerpc/platforms/pasemi/pci.c | 5 +++++
> arch/powerpc/platforms/pasemi/setup.c | 12 ++++--------
> 3 files changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pasemi/pasemi.h b/arch/powerpc/platforms/pasemi/pasemi.h
> index 6f6743b8e48d..01bcfa258625 100644
> --- a/arch/powerpc/platforms/pasemi/pasemi.h
> +++ b/arch/powerpc/platforms/pasemi/pasemi.h
> @@ -7,6 +7,12 @@ extern void pas_pci_init(void);
> struct pci_dev;
> extern void pas_pci_dma_dev_setup(struct pci_dev *dev);
>
> +#ifdef CONFIG_PPC_PASEMI_NEMO
> +void __init nemo_init_IRQ(void);
> +#else
> +static inline void __init nemo_init_IRQ(void) { }
> +#endif
> +
> void __iomem *__init pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset);
>
> extern void __init pasemi_map_registers(void);
> diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
> index 2df955274652..fb53782da7ec 100644
> --- a/arch/powerpc/platforms/pasemi/pci.c
> +++ b/arch/powerpc/platforms/pasemi/pci.c
> @@ -265,6 +265,11 @@ static int __init pas_add_bridge(struct device_node *dev)
> */
> isa_bridge_find_early(hose);
>
> + /*
> + * ISA bridge is now active, add the i8259 cascade (if needed)
> + */
> + nemo_init_IRQ();
> +
> return 0;
> }
>
> diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
> index 45792ecd5dfd..7a961f2a228f 100644
> --- a/arch/powerpc/platforms/pasemi/setup.c
> +++ b/arch/powerpc/platforms/pasemi/setup.c
> @@ -216,10 +216,12 @@ static void sb600_8259_cascade(struct irq_desc *desc)
> chip->irq_eoi(&desc->irq_data);
> }
>
> -static void __init nemo_init_IRQ(struct mpic *mpic)
> +void __init nemo_init_IRQ(void)
> {
> struct device_node *np;
> int gpio_virq;
> + struct mpic *mpic;
> +
> /* Connect the SB600's legacy i8259 controller */
> np = of_find_node_by_path("/pxp@0,e0000000");
> i8259_init(np, 0);
> @@ -230,14 +232,10 @@ static void __init nemo_init_IRQ(struct mpic *mpic)
> irq_set_chained_handler(gpio_virq, sb600_8259_cascade);
> mpic_unmask_irq(irq_get_irq_data(gpio_virq));
>
> + mpic = irq_get_chip_data(gpio_virq);
> irq_set_default_domain(mpic->irqhost);
> }
>
> -#else
> -
> -static inline void nemo_init_IRQ(struct mpic *mpic)
> -{
> -}
> #endif
>
> static __init void pas_init_IRQ(void)
> @@ -300,8 +298,6 @@ static __init void pas_init_IRQ(void)
> mpic_unmask_irq(irq_get_irq_data(nmi_virq));
> }
>
> - nemo_init_IRQ(mpic);
> -
> of_node_put(mpic_node);
> of_node_put(root);
> }
> --
> 2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] powerpc/pasemi: Defer Nemo IRQ initialization
2026-11-02 3:34 ` Ritesh Harjani
@ 2026-11-02 5:20 ` Christian Zigotzky
0 siblings, 0 replies; 5+ messages in thread
From: Christian Zigotzky @ 2026-11-02 5:20 UTC (permalink / raw)
To: Ritesh Harjani (IBM), maddy, mpe
Cc: npiggin, linuxppc-dev, Christian Zigotzky A-EON Open Source,
Darren Stevens, R.T.Dickinson, Damien Stewart, mad skateman
On 11/02/2026 04:34 AM, Ritesh Harjani (IBM) wrote:
> chzigotzky@xenosoft.de writes:
>
>> From: Christian Zigotzky A-EON Open Source <info@xenosoft.de>
>>
>> Since pas_pci_init() is now called later during boot, the i8259
>> initialization in pas_init_IRQ() happens too early and accesses
>> registers that are not yet mapped, preventing the board from booting.
>>
>> Move the Nemo-specific i8259 initialization to pas_add_bridge(),
>> after the ISA bridge has been discovered.
>
> That make sense to me. The patch looks good. However, shouldn't we also
> add Fixes tag and Cc: stable tag - so that this gets backported to older
> stable kernels.
>
>
> Fixes: c144bc719234 ("powerpc/pasemi: Move PHB discovery")
> Cc: stable@vger.kernel.org
>
> I think the fixes tag should be above - but feel free to correct that.
>
> Otherwise looks good to me. Feel free to add:
> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
>
Great! Just for info. I don't need this patch for the stable long-term
kernel 5.10 but it is at least necessary for the stable long-term
kernels 6.12 [1] and 6.18.
- Christian
[1]
https://raw.githubusercontent.com/chzigotzky/kernels/refs/heads/6_12/patches/X1000/pas_pci_init_v6.patch
>> Suggested-by: Darren Stevens <darren@stevens-zone.net>
>> Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
>> Signed-off-by: Christian Zigotzky A-EON Open Source <info@xenosoft.de>
>> ---
>> arch/powerpc/platforms/pasemi/pasemi.h | 6 ++++++
>> arch/powerpc/platforms/pasemi/pci.c | 5 +++++
>> arch/powerpc/platforms/pasemi/setup.c | 12 ++++--------
>> 3 files changed, 15 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/pasemi/pasemi.h b/arch/powerpc/platforms/pasemi/pasemi.h
>> index 6f6743b8e48d..01bcfa258625 100644
>> --- a/arch/powerpc/platforms/pasemi/pasemi.h
>> +++ b/arch/powerpc/platforms/pasemi/pasemi.h
>> @@ -7,6 +7,12 @@ extern void pas_pci_init(void);
>> struct pci_dev;
>> extern void pas_pci_dma_dev_setup(struct pci_dev *dev);
>>
>> +#ifdef CONFIG_PPC_PASEMI_NEMO
>> +void __init nemo_init_IRQ(void);
>> +#else
>> +static inline void __init nemo_init_IRQ(void) { }
>> +#endif
>> +
>> void __iomem *__init pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset);
>>
>> extern void __init pasemi_map_registers(void);
>> diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
>> index 2df955274652..fb53782da7ec 100644
>> --- a/arch/powerpc/platforms/pasemi/pci.c
>> +++ b/arch/powerpc/platforms/pasemi/pci.c
>> @@ -265,6 +265,11 @@ static int __init pas_add_bridge(struct device_node *dev)
>> */
>> isa_bridge_find_early(hose);
>>
>> + /*
>> + * ISA bridge is now active, add the i8259 cascade (if needed)
>> + */
>> + nemo_init_IRQ();
>> +
>> return 0;
>> }
>>
>> diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
>> index 45792ecd5dfd..7a961f2a228f 100644
>> --- a/arch/powerpc/platforms/pasemi/setup.c
>> +++ b/arch/powerpc/platforms/pasemi/setup.c
>> @@ -216,10 +216,12 @@ static void sb600_8259_cascade(struct irq_desc *desc)
>> chip->irq_eoi(&desc->irq_data);
>> }
>>
>> -static void __init nemo_init_IRQ(struct mpic *mpic)
>> +void __init nemo_init_IRQ(void)
>> {
>> struct device_node *np;
>> int gpio_virq;
>> + struct mpic *mpic;
>> +
>> /* Connect the SB600's legacy i8259 controller */
>> np = of_find_node_by_path("/pxp@0,e0000000");
>> i8259_init(np, 0);
>> @@ -230,14 +232,10 @@ static void __init nemo_init_IRQ(struct mpic *mpic)
>> irq_set_chained_handler(gpio_virq, sb600_8259_cascade);
>> mpic_unmask_irq(irq_get_irq_data(gpio_virq));
>>
>> + mpic = irq_get_chip_data(gpio_virq);
>> irq_set_default_domain(mpic->irqhost);
>> }
>>
>> -#else
>> -
>> -static inline void nemo_init_IRQ(struct mpic *mpic)
>> -{
>> -}
>> #endif
>>
>> static __init void pas_init_IRQ(void)
>> @@ -300,8 +298,6 @@ static __init void pas_init_IRQ(void)
>> mpic_unmask_irq(irq_get_irq_data(nmi_virq));
>> }
>>
>> - nemo_init_IRQ(mpic);
>> -
>> of_node_put(mpic_node);
>> of_node_put(root);
>> }
>> --
>> 2.43.0
--
Sent with BrassMonkey 35.0.2 (https://github.com/chzigotzky/Web-Browsers-and-Suites-for-Linux-PPC/releases/tag/BrassMonkey_35.0.2)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 0/2] KVM: PPC: BookE: Fix boot hang on preemptible kernels
@ 2026-09-28 11:04 Shrikanth Hegde
2026-09-28 11:04 ` [PATCH 1/2] KVM: PPC: BookE: Disable preemption before loading guest FP and Altivec Shrikanth Hegde
0 siblings, 1 reply; 5+ messages in thread
From: Shrikanth Hegde @ 2026-09-28 11:04 UTC (permalink / raw)
To: maddy, linuxppc-dev, chzigotzky
Cc: sshegde, mpe, npiggin, christophe.leroy, linux-kernel, msuchanek,
ritesh.list, harshpb, gautam, amachhiw, venkat88, nnmlinux
Christian Zigotzky had reported that preemptible kernels don't boot on
his FSL Cyrus+ board. The board freezes on running either full/lazy
preemption and has been an issue for a while now.
https://lore.kernel.org/all/b897b0fd-90f2-4215-bcd4-3714e497d773@xenosoft.de/#t
After 7.0, there is only preempt=full/lazy which removed the
preempt=none/voluntary workaround used to mask the issue. There was
challenge is getting the console logs which made the fixes difficult since
one couldn't know where the issue is.
Thanks to Michal for helping in getting the logs. That pointed at few
places where the issue could be. This series is an attempt at fixing
those.
Christian, KVM team,
Please *test* the patches.
Shrikanth Hegde (2):
KVM: PPC: BookE: Disable preemption before loading guest FP and
Altivec
KVM: PPC: Replay pending interrupts before entering the guest
arch/powerpc/kvm/booke.c | 9 ++++++++-
arch/powerpc/kvm/powerpc.c | 13 +++++++++++++
2 files changed, 21 insertions(+), 1 deletion(-)
--
2.52.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/2] KVM: PPC: BookE: Disable preemption before loading guest FP and Altivec
2026-09-28 11:04 [PATCH 0/2] KVM: PPC: BookE: Fix boot hang on preemptible kernels Shrikanth Hegde
@ 2026-09-28 11:04 ` Shrikanth Hegde
2026-10-01 11:26 ` Narayana Murty N
0 siblings, 1 reply; 5+ messages in thread
From: Shrikanth Hegde @ 2026-09-28 11:04 UTC (permalink / raw)
To: maddy, linuxppc-dev, chzigotzky
Cc: sshegde, mpe, npiggin, christophe.leroy, linux-kernel, msuchanek,
ritesh.list, harshpb, gautam, amachhiw, venkat88, nnmlinux
Christian reported that booting preemptible kernel on FSL Cyrus+ board
causes boot hang.
The logs pointed that system was busy in printing below warning.
WARNING: at .enable_kernel_fp+0x30/0x78, CPU#3: qemu-system-ppc/4884
Modules linked in:
CPU: 3 UID: 1000 PID: 4884 Comm: qemu-system-ppc Not tainted 7.3.0-rc1-powerpc64-smp-preempt #1 PREEMPT
NIP [c000000000003338] .enable_kernel_fp+0x30/0x78
LR [c00000000005de84] .kvmppc_load_guest_fp+0x30/0x80
Call Trace:
[c000000085ca7700] [c00000000005de84] .kvmppc_load_guest_fp+0x30/0x80
[c000000085ca7780] [c00000000005f2a0] .kvmppc_handle_exit+0x5bc/0x5cc
[c000000085ca7830] [c00000000006204c] .kvmppc_resume_host+0xb8/0x10c
Which is...
void enable_kernel_fp(void)
{
unsigned long cpumsr;
WARN_ON(preemptible());
And...
Though irq's are hard disabled after kvmppc_prepare_to_enter, but
kvmppc_fix_ee_before_entry enables the softmask's IRQ state.
That causes the irqs_disabled to return false.
Hence leading to the warnings.
Fix it by disabling the preemption using the preempt disable.
Note, it is calling noresched variant of preempt enable, since hard
irq are disabled. It is likely not a good idea to call schedule.
Fixes: 3efc7da61f6c ("KVM: PPC: Book3E: Increase FPU laziness")
Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Closes: https://lore.kernel.org/all/33342fbf-eb7b-bde6-2c8c-254fe8bfb993@xenosoft.de/
Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
---
arch/powerpc/kvm/booke.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 13ad4cf5fa71..5b9118eefe1d 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -1404,10 +1404,17 @@ int kvmppc_handle_exit(struct kvm_vcpu *vcpu, unsigned int exit_nr)
if (s <= 0)
r = (s << 2) | RESUME_HOST | (r & RESUME_FLAG_NV);
else {
- /* interrupts now hard-disabled */
+ /*
+ * kvmppc_fix_ee_before_entry() marks the software
+ * IRQ state enabled while interrupts are still
+ * hard-disabled. So disable preemption while loading
+ * guest FP and Altivec.
+ */
kvmppc_fix_ee_before_entry();
+ preempt_disable();
kvmppc_load_guest_fp(vcpu);
kvmppc_load_guest_altivec(vcpu);
+ preempt_enable_no_resched();
}
}
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/2] KVM: PPC: BookE: Disable preemption before loading guest FP and Altivec
2026-09-28 11:04 ` [PATCH 1/2] KVM: PPC: BookE: Disable preemption before loading guest FP and Altivec Shrikanth Hegde
@ 2026-10-01 11:26 ` Narayana Murty N
2026-10-01 11:53 ` Shrikanth Hegde
0 siblings, 1 reply; 5+ messages in thread
From: Narayana Murty N @ 2026-10-01 11:26 UTC (permalink / raw)
To: Shrikanth Hegde, maddy, linuxppc-dev, chzigotzky
Cc: mpe, npiggin, christophe.leroy, linux-kernel, msuchanek,
ritesh.list, harshpb, gautam, amachhiw, venkat88
Hi Shrikanth,
Thanks for the fixes. I had one question on patch 1.
On 28/09/26 4:34 PM, Shrikanth Hegde wrote:
> Christian reported that booting preemptible kernel on FSL Cyrus+ board
> causes boot hang.
>
> The logs pointed that system was busy in printing below warning.
>
> WARNING: at .enable_kernel_fp+0x30/0x78, CPU#3: qemu-system-ppc/4884
> Modules linked in:
> CPU: 3 UID: 1000 PID: 4884 Comm: qemu-system-ppc Not tainted 7.3.0-rc1-powerpc64-smp-preempt #1 PREEMPT
> NIP [c000000000003338] .enable_kernel_fp+0x30/0x78
> LR [c00000000005de84] .kvmppc_load_guest_fp+0x30/0x80
> Call Trace:
> [c000000085ca7700] [c00000000005de84] .kvmppc_load_guest_fp+0x30/0x80
> [c000000085ca7780] [c00000000005f2a0] .kvmppc_handle_exit+0x5bc/0x5cc
> [c000000085ca7830] [c00000000006204c] .kvmppc_resume_host+0xb8/0x10c
>
> Which is...
>
> void enable_kernel_fp(void)
> {
> unsigned long cpumsr;
> WARN_ON(preemptible());
>
> And...
>
> Though irq's are hard disabled after kvmppc_prepare_to_enter, but
> kvmppc_fix_ee_before_entry enables the softmask's IRQ state.
> That causes the irqs_disabled to return false.
> Hence leading to the warnings.
>
> Fix it by disabling the preemption using the preempt disable.
> Note, it is calling noresched variant of preempt enable, since hard
> irq are disabled. It is likely not a good idea to call schedule.
>
> Fixes: 3efc7da61f6c ("KVM: PPC: Book3E: Increase FPU laziness")
> Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
> Closes: https://lore.kernel.org/all/33342fbf-eb7b-bde6-2c8c-254fe8bfb993@xenosoft.de/
> Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
> ---
> arch/powerpc/kvm/booke.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
> index 13ad4cf5fa71..5b9118eefe1d 100644
> --- a/arch/powerpc/kvm/booke.c
> +++ b/arch/powerpc/kvm/booke.c
> @@ -1404,10 +1404,17 @@ int kvmppc_handle_exit(struct kvm_vcpu *vcpu, unsigned int exit_nr)
> if (s <= 0)
> r = (s << 2) | RESUME_HOST | (r & RESUME_FLAG_NV);
> else {
> - /* interrupts now hard-disabled */
> + /*
> + * kvmppc_fix_ee_before_entry() marks the software
> + * IRQ state enabled while interrupts are still
> + * hard-disabled. So disable preemption while loading
> + * guest FP and Altivec.
> + */
> kvmppc_fix_ee_before_entry();
> + preempt_disable();
> kvmppc_load_guest_fp(vcpu);
> kvmppc_load_guest_altivec(vcpu);
> + preempt_enable_no_resched();
Would it be simpler to move kvmppc_fix_ee_before_entry() after the
FP/Altivec loads instead?
The normal kvmppc_vcpu_run() entry path already loads the guest
FP/Altivec state while interrupts are still disabled and calls
kvmppc_fix_ee_before_entry() immediately before entering the guest.
So could this path follow the same ordering:
kvmppc_load_guest_fp(vcpu);
kvmppc_load_guest_altivec(vcpu);
kvmppc_fix_ee_before_entry();
That would avoid making the software IRQ state enabled before loading
the guest FP/Altivec state, and also avoid the additional
preempt_disable()/preempt_enable_no_resched() pair.
Thanks,
Narayana Murty.
> }
> }
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 1/2] KVM: PPC: BookE: Disable preemption before loading guest FP and Altivec
2026-10-01 11:26 ` Narayana Murty N
@ 2026-10-01 11:53 ` Shrikanth Hegde
2026-10-30 16:21 ` Ritesh Harjani
0 siblings, 1 reply; 5+ messages in thread
From: Shrikanth Hegde @ 2026-10-01 11:53 UTC (permalink / raw)
To: Narayana Murty N, maddy, linuxppc-dev, chzigotzky
Cc: mpe, npiggin, christophe.leroy, linux-kernel, msuchanek,
ritesh.list, harshpb, gautam, amachhiw, venkat88
Hi Narayana.
On 10/1/26 4:56 PM, Narayana Murty N wrote:
> Hi Shrikanth,
> Thanks for the fixes. I had one question on patch 1.
See response below.
>
>> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
>> index 13ad4cf5fa71..5b9118eefe1d 100644
>> --- a/arch/powerpc/kvm/booke.c
>> +++ b/arch/powerpc/kvm/booke.c
>> @@ -1404,10 +1404,17 @@ int kvmppc_handle_exit(struct kvm_vcpu *vcpu, unsigned int exit_nr)
>> if (s <= 0)
>> r = (s << 2) | RESUME_HOST | (r & RESUME_FLAG_NV);
>> else {
>> - /* interrupts now hard-disabled */
>> + /*
>> + * kvmppc_fix_ee_before_entry() marks the software
>> + * IRQ state enabled while interrupts are still
>> + * hard-disabled. So disable preemption while loading
>> + * guest FP and Altivec.
>> + */
>> kvmppc_fix_ee_before_entry();
>> + preempt_disable();
>> kvmppc_load_guest_fp(vcpu);
>> kvmppc_load_guest_altivec(vcpu);
>> + preempt_enable_no_resched();
> Would it be simpler to move kvmppc_fix_ee_before_entry() after the
> FP/Altivec loads instead?
>
> The normal kvmppc_vcpu_run() entry path already loads the guest
> FP/Altivec state while interrupts are still disabled and calls
> kvmppc_fix_ee_before_entry() immediately before entering the guest.
>
> So could this path follow the same ordering:
>
> kvmppc_load_guest_fp(vcpu);
> kvmppc_load_guest_altivec(vcpu);
> kvmppc_fix_ee_before_entry();
>
> That would avoid making the software IRQ state enabled before loading
> the guest FP/Altivec state, and also avoid the additional
> preempt_disable()/preempt_enable_no_resched() pair.
>
> Thanks,
> Narayana Murty.
>> }
>> }
>
I thought I had put that for discussion after ---, but looks like I forgot.
I don't mind the above too. but I didn't have a way to test it.
So kept it as is based on what Christian said works for him.
If you have a way to test the patches, please let me know.
We can try that too.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 1/2] KVM: PPC: BookE: Disable preemption before loading guest FP and Altivec
2026-10-01 11:53 ` Shrikanth Hegde
@ 2026-10-30 16:21 ` Ritesh Harjani
2026-11-01 11:35 ` [PATCH] powerpc/pasemi: Defer Nemo IRQ initialization Christian Zigotzky
0 siblings, 1 reply; 5+ messages in thread
From: Ritesh Harjani @ 2026-10-30 16:21 UTC (permalink / raw)
To: Shrikanth Hegde, Narayana Murty N, maddy, linuxppc-dev,
chzigotzky
Cc: mpe, npiggin, christophe.leroy, linux-kernel, msuchanek, harshpb,
gautam, amachhiw, venkat88
Shrikanth Hegde <sshegde@linux.ibm.com> writes:
> Hi Narayana.
>
> On 10/1/26 4:56 PM, Narayana Murty N wrote:
>> Hi Shrikanth,
>> Thanks for the fixes. I had one question on patch 1.
>
> See response below.
>
>>
>>> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
>>> index 13ad4cf5fa71..5b9118eefe1d 100644
>>> --- a/arch/powerpc/kvm/booke.c
>>> +++ b/arch/powerpc/kvm/booke.c
>>> @@ -1404,10 +1404,17 @@ int kvmppc_handle_exit(struct kvm_vcpu *vcpu, unsigned int exit_nr)
>>> if (s <= 0)
>>> r = (s << 2) | RESUME_HOST | (r & RESUME_FLAG_NV);
>>> else {
>>> - /* interrupts now hard-disabled */
>>> + /*
>>> + * kvmppc_fix_ee_before_entry() marks the software
>>> + * IRQ state enabled while interrupts are still
>>> + * hard-disabled. So disable preemption while loading
>>> + * guest FP and Altivec.
>>> + */
>>> kvmppc_fix_ee_before_entry();
>>> + preempt_disable();
>>> kvmppc_load_guest_fp(vcpu);
>>> kvmppc_load_guest_altivec(vcpu);
>>> + preempt_enable_no_resched();
>> Would it be simpler to move kvmppc_fix_ee_before_entry() after the
>> FP/Altivec loads instead?
>>
>> The normal kvmppc_vcpu_run() entry path already loads the guest
>> FP/Altivec state while interrupts are still disabled and calls
>> kvmppc_fix_ee_before_entry() immediately before entering the guest.
>>
>> So could this path follow the same ordering:
>>
>> kvmppc_load_guest_fp(vcpu);
>> kvmppc_load_guest_altivec(vcpu);
>> kvmppc_fix_ee_before_entry();
>>
Thanks Narayana, that actually make more sense to me.
>> That would avoid making the software IRQ state enabled before loading
>> the guest FP/Altivec state, and also avoid the additional
>> preempt_disable()/preempt_enable_no_resched() pair.
>>
>> Thanks,
>> Narayana Murty.
>>> }
>>> }
>>
>
> I thought I had put that for discussion after ---, but looks like I forgot.
>
> I don't mind the above too. but I didn't have a way to test it.
Actually I agree with Narayan's reasoning here.
Sorry for being so late to the game. As you know we have been occupied
with other things internally.
> So kept it as is based on what Christian said works for him.
> If you have a way to test the patches, please let me know.
> We can try that too.
Let's ask Christian directly :)
@Christian - Once we have v2, would you kindly help us test that
please?
We think the other approach which Narayana suggested might be a better
fix for this and it can avoid preempt_enable/disable() dance. However,
looks like we may not have the board where we can reproduce this.
-ritesh
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH] powerpc/pasemi: Defer Nemo IRQ initialization
2026-10-30 16:21 ` Ritesh Harjani
@ 2026-11-01 11:35 ` Christian Zigotzky
0 siblings, 0 replies; 5+ messages in thread
From: Christian Zigotzky @ 2026-11-01 11:35 UTC (permalink / raw)
To: Ritesh Harjani (IBM), Shrikanth Hegde, Narayana Murty N, maddy,
linuxppc-dev
Cc: mpe, npiggin, christophe.leroy, linux-kernel, msuchanek, harshpb,
gautam, amachhiw, venkat88, R.T.Dickinson, mad skateman,
Damien Stewart, Christian Zigotzky, Darren Stevens
On 10/30/2026 05:21 PM, Ritesh Harjani (IBM) wrote:
> Let's ask Christian directly :)
> @Christian - Once we have v2, would you kindly help us test that
> please?
>
> We think the other approach which Narayana suggested might be a better
> fix for this and it can avoid preempt_enable/disable() dance. However,
> looks like we may not have the board where we can reproduce this.
>
>
> -ritesh
>
Hi all,
Is it possible to add the following patch to the kernel?
Link:
https://lists.ozlabs.org/pipermail/linuxppc-dev/2026-October/305189.html
It is more important for us because the Nemo board can't boot without
this patch.
Thanks,
Christian
--
Sent with BrassMonkey 35.0.2 (https://github.com/chzigotzky/Web-Browsers-and-Suites-for-Linux-PPC/releases/tag/BrassMonkey_35.0.2)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-02 5:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-24 7:55 [PATCH] powerpc/pasemi: Defer Nemo IRQ initialization chzigotzky
2026-10-28 3:53 ` Christian Zigotzky
2026-11-02 3:34 ` Ritesh Harjani
2026-11-02 5:20 ` Christian Zigotzky
-- strict thread matches above, loose matches on Subject: below --
2026-09-28 11:04 [PATCH 0/2] KVM: PPC: BookE: Fix boot hang on preemptible kernels Shrikanth Hegde
2026-09-28 11:04 ` [PATCH 1/2] KVM: PPC: BookE: Disable preemption before loading guest FP and Altivec Shrikanth Hegde
2026-10-01 11:26 ` Narayana Murty N
2026-10-01 11:53 ` Shrikanth Hegde
2026-10-30 16:21 ` Ritesh Harjani
2026-11-01 11:35 ` [PATCH] powerpc/pasemi: Defer Nemo IRQ initialization Christian Zigotzky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox