linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] Improve interrupt handling during machine kexec
@ 2024-11-30 20:11 Eliav Farber
  2024-11-30 20:11 ` [PATCH v5 1/2] kexec: Consolidate machine_kexec_mask_interrupts() implementation Eliav Farber
  2024-11-30 20:11 ` [PATCH v5 2/2] kexec: Prevent redundant IRQ masking by checking state before shutdown Eliav Farber
  0 siblings, 2 replies; 9+ messages in thread
From: Eliav Farber @ 2024-11-30 20:11 UTC (permalink / raw)
  To: linux, catalin.marinas, will, mpe, npiggin, christophe.leroy,
	naveen, maddy, paul.walmsley, palmer, aou, tglx, akpm, bhe,
	farbere, hbathini, sourabhjain, adityag, songshuaishuai, takakura,
	linux-arm-kernel, linux-kernel, linuxppc-dev, linux-riscv
  Cc: jonnyc

This patch series focuses on improving the machine_kexec_mask_interrupts()
function by consolidating its implementation and optimizing its behavior to
avoid redundant interrupt masking.

Patch Summary:
[PATCH v5 1/2] Move machine_kexec_mask_interrupts() to kernel/irq/kexec.c,
               removing duplicate architecture-specific implementations.
[PATCH v5 2/2] Refine machine_kexec_mask_interrupts() to avoid re-masking
               already-masked interrupts, resolving specific warnings
               triggered in GPIO IRQ flows.

Changes between v4 and v5:
 - The function machine_kexec_mask_interrupts() has been moved
   from kernel/kexec_core.c to a new file kernel/irq/kexec.c.
 - A new configuration option, GENERIC_IRQ_KEXEC_CLEAR_VM_FORWARD, has been
   added.
 - The parameters for the machine_kexec_mask_interrupts() function have
   been defined in reverse Christmas Tree style.
 - The comment explaining the call to irq_set_irqchip_state() has been
   improved for clarity.
 - The phrase 'This patch' has been removed from the commit message.
 
Changes between v3 and v4:
 - Add missing <linux/irqdesc.h> and <linux/irq.h> includes.

Eliav Farber (2):
  kexec: Consolidate machine_kexec_mask_interrupts() implementation
  kexec: Prevent redundant IRQ masking by checking state before shutdown

 arch/arm/kernel/machine_kexec.c   | 23 --------------------
 arch/arm64/Kconfig                |  1 +
 arch/arm64/kernel/machine_kexec.c | 31 --------------------------
 arch/powerpc/include/asm/kexec.h  |  1 -
 arch/powerpc/kexec/core.c         | 22 -------------------
 arch/powerpc/kexec/core_32.c      |  1 +
 arch/riscv/kernel/machine_kexec.c | 23 --------------------
 include/linux/irq.h               |  3 +++
 kernel/irq/Kconfig                |  9 ++++++++
 kernel/irq/Makefile               |  2 +-
 kernel/irq/kexec.c                | 36 +++++++++++++++++++++++++++++++
 11 files changed, 51 insertions(+), 101 deletions(-)
 create mode 100644 kernel/irq/kexec.c

-- 
2.40.1



^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: [PATCH v5 1/2] kexec: Consolidate machine_kexec_mask_interrupts() implementation
@ 2024-12-03 12:55 Farber, Eliav
  2024-12-03 16:36 ` Thomas Gleixner
  0 siblings, 1 reply; 9+ messages in thread
From: Farber, Eliav @ 2024-12-03 12:55 UTC (permalink / raw)
  To: Thomas Gleixner, linux@armlinux.org.uk, catalin.marinas@arm.com,
	will@kernel.org, mpe@ellerman.id.au, npiggin@gmail.com,
	christophe.leroy@csgroup.eu, naveen@kernel.org,
	maddy@linux.ibm.com, paul.walmsley@sifive.com, palmer@dabbelt.com,
	aou@eecs.berkeley.edu, akpm@linux-foundation.org, bhe@redhat.com,
	hbathini@linux.ibm.com, sourabhjain@linux.ibm.com,
	adityag@linux.ibm.com, songshuaishuai@tinylab.org,
	takakura@valinux.co.jp, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org
  Cc: Chocron, Jonathan

On 12/3/2024 1:04 PM, Thomas Gleixner wrote:
>> +
>> +config GENERIC_IRQ_KEXEC_CLEAR_VM_FORWARD
>> +     bool "Clear forwarded VM interrupts during kexec"
>
> This should not be user selectable. Just keep it as:
>
> config GENERIC_IRQ_KEXEC_CLEAR_VM_FORWARD
>         bool
>
> which defaults to 'n'. Just add a comment what this is about like it's
> done with the other options in that file which are only selectable.
Question: Should this new configuration option be placed inside or
outside the following section:
```
menu "IRQ subsystem"


endmenu
```
In my patch, I have added the new configuration option at the end of
the file, outside the "IRQ subsystem" section.


^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: [PATCH v5 1/2] kexec: Consolidate machine_kexec_mask_interrupts() implementation
@ 2024-12-04 11:40 Farber, Eliav
  2024-12-04 14:07 ` Thomas Gleixner
  0 siblings, 1 reply; 9+ messages in thread
From: Farber, Eliav @ 2024-12-04 11:40 UTC (permalink / raw)
  To: Jiri Slaby, linux@armlinux.org.uk, catalin.marinas@arm.com,
	will@kernel.org, mpe@ellerman.id.au, npiggin@gmail.com,
	christophe.leroy@csgroup.eu, naveen@kernel.org,
	maddy@linux.ibm.com, paul.walmsley@sifive.com, palmer@dabbelt.com,
	aou@eecs.berkeley.edu, tglx@linutronix.de,
	akpm@linux-foundation.org, bhe@redhat.com, hbathini@linux.ibm.com,
	sourabhjain@linux.ibm.com, adityag@linux.ibm.com,
	songshuaishuai@tinylab.org, takakura@valinux.co.jp,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org
  Cc: Chocron, Jonathan

On 12/4/2024 1:02 PM, Jiri Slaby wrote:
>> +
>> +config GENERIC_IRQ_KEXEC_CLEAR_VM_FORWARD
>> +     bool "Clear forwarded VM interrupts during kexec"
>> +     default n
>> +     help
>> +       When enabled, this option allows the kernel to clear the active state
>> +       of interrupts that are forwarded to virtual machines (VMs) during a
>> +       machine kexec. For interrupts that are not forwarded, if supported,
>> +       the kernel will attempt to trigger an End of Interrupt (EOI).
>
> This caught my attention. It looks like you want to allow people toggling it? I believe only arch code should turn it on as you do by "select", not users.

Thomas Gleixner has also commented about it:
"
This should not be user selectable. Just keep it as:

config GENERIC_IRQ_KEXEC_CLEAR_VM_FORWARD
        bool

which defaults to 'n'. Just add a comment what this is about like it's done with the other options in that file which are only selectable.
"

I will fix it in v6.
I'm just waiting for a reply if the new configuration option should be
placed inside or after the following section:
```
menu "IRQ subsystem"

endmenu
```

Thanks, Eliav

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

end of thread, other threads:[~2024-12-04 14:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-30 20:11 [PATCH v5 0/2] Improve interrupt handling during machine kexec Eliav Farber
2024-11-30 20:11 ` [PATCH v5 1/2] kexec: Consolidate machine_kexec_mask_interrupts() implementation Eliav Farber
2024-12-03 11:04   ` Thomas Gleixner
2024-12-04 11:02   ` Jiri Slaby
2024-11-30 20:11 ` [PATCH v5 2/2] kexec: Prevent redundant IRQ masking by checking state before shutdown Eliav Farber
  -- strict thread matches above, loose matches on Subject: below --
2024-12-03 12:55 [PATCH v5 1/2] kexec: Consolidate machine_kexec_mask_interrupts() implementation Farber, Eliav
2024-12-03 16:36 ` Thomas Gleixner
2024-12-04 11:40 Farber, Eliav
2024-12-04 14:07 ` Thomas Gleixner

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