Re: [PATCH v7 0/4] kexec: Fix kexec_file_load for llvm16 with PGO

2023-09-08 Thread Ricardo Ribalda
Hi Song On Fri, 8 Sept 2023 at 23:48, Song Liu wrote: > > Hi Ricardo, > > Thanks for your kind reply. > > On Fri, Sep 8, 2023 at 2:18 PM Ricardo Ribalda wrote: > > > > Hi Song > > > > On Fri, 8 Sept 2023 at 01:08, Song Liu wrote: > > > >

Re: [PATCH v7 0/4] kexec: Fix kexec_file_load for llvm16 with PGO

2023-09-08 Thread Ricardo Ribalda
Hi Song On Fri, 8 Sept 2023 at 01:08, Song Liu wrote: > > Hi Ricardo and folks, > > On Fri, May 19, 2023 at 7:48 AM Ricardo Ribalda wrote: > > > > When upreving llvm I realised that kexec stopped working on my test > > platform. > > > > The reason seem

[PATCH v7 0/4] kexec: Fix kexec_file_load for llvm16 with PGO

2023-05-19 Thread Ricardo Ribalda
When upreving llvm I realised that kexec stopped working on my test platform. The reason seems to be that due to PGO there are multiple .text sections on the purgatory, and kexec does not supports that. Signed-off-by: Ricardo Ribalda --- Changes in v7: - Fix $SUBJECT of riscv patch - Rename PGO

[PATCH v7 1/4] kexec: Support purgatories with .text.hot sections

2023-05-19 Thread Ricardo Ribalda
ecause of this, the system crashes immediately after: kexec_core: Starting new kernel Cc: sta...@vger.kernel.org Fixes: 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory") Reviewed-by: Ross Zwisler Reviewed-by: Steven Rostedt (Google) Reviewed-by: Philipp Rudo Signed-off-by:

[PATCH v7 4/4] riscv/purgatory: Remove PGO flags

2023-05-19 Thread Ricardo Ribalda
Signed-off-by: Ricardo Ribalda --- arch/riscv/purgatory/Makefile | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/riscv/purgatory/Makefile b/arch/riscv/purgatory/Makefile index 5730797a6b40..bd2e27f82532 100644 --- a/arch/riscv/purgatory/Makefile +++ b/arch/riscv/purgatory/Makefile @@ -3

[PATCH v7 2/4] x86/purgatory: Remove PGO flags

2023-05-19 Thread Ricardo Ribalda
If profile-guided optimization is enabled, the purgatory ends up with multiple .text sections. This is not supported by kexec and crashes the system. Cc: sta...@vger.kernel.org Fixes: 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory") Signed-off-by: Ricardo Ribalda

[PATCH v7 3/4] powerpc/purgatory: Remove PGO flags

2023-05-19 Thread Ricardo Ribalda
If profile-guided optimization is enabled, the purgatory ends up with multiple .text sections. This is not supported by kexec and crashes the system. Cc: sta...@vger.kernel.org Fixes: 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory") Signed-off-by: Ricardo Ribalda

Re: [PATCH v6 4/4] risc/purgatory: Add linker script

2023-05-01 Thread Ricardo Ribalda
Hi Conor On Mon, 1 May 2023 at 19:41, Conor Dooley wrote: > > Hey Ricardo, > > On Mon, May 01, 2023 at 02:38:22PM +0200, Ricardo Ribalda wrote: > > If PGO is enabled, the purgatory ends up with multiple .text sections. > > This is not supported by kexec and crashes the

Re: [PATCH v6 4/4] risc/purgatory: Add linker script

2023-05-01 Thread Ricardo Ribalda
at 07:18:12PM +0200, Ricardo Ribalda wrote: > > On Mon, 1 May 2023 at 18:19, Nick Desaulniers > > wrote: > > > > > > On Mon, May 1, 2023 at 5:39 AM Ricardo Ribalda > > > wrote: > > > > > > > > If PGO is enabled, the purgator

Re: [PATCH v6 4/4] risc/purgatory: Add linker script

2023-05-01 Thread Ricardo Ribalda
: > > On Mon, May 1, 2023 at 5:39 AM Ricardo Ribalda wrote: > > > > If PGO is enabled, the purgatory ends up with multiple .text sections. > > This is not supported by kexec and crashes the system. > > > > Cc: sta...@vger.kernel.org > > Fixes: 93

[PATCH v6 4/4] risc/purgatory: Add linker script

2023-05-01 Thread Ricardo Ribalda
If PGO is enabled, the purgatory ends up with multiple .text sections. This is not supported by kexec and crashes the system. Cc: sta...@vger.kernel.org Fixes: 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory") Signed-off-by: Ricardo Ribalda --- arch/riscv/purgator

[PATCH v6 0/4] kexec: Fix kexec_file_load for llvm16 with PGO

2023-05-01 Thread Ricardo Ribalda
When upreving llvm I realised that kexec stopped working on my test platform. The reason seems to be that due to PGO there are multiple .text sections on the purgatory, and kexec does not supports that. Signed-off-by: Ricardo Ribalda --- Changes in v6: - Replace linker script with Makefile rule

[PATCH v6 3/4] powerpc/purgatory: Remove profile optimization flags

2023-05-01 Thread Ricardo Ribalda
If PGO is enabled, the purgatory ends up with multiple .text sections. This is not supported by kexec and crashes the system. Cc: sta...@vger.kernel.org Fixes: 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory") Signed-off-by: Ricardo Ribalda --- arch/powerpc/purgator

[PATCH v6 2/4] x86/purgatory: Remove profile optimization flags

2023-05-01 Thread Ricardo Ribalda
If PGO is enabled, the purgatory ends up with multiple .text sections. This is not supported by kexec and crashes the system. Cc: sta...@vger.kernel.org Fixes: 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory") Signed-off-by: Ricardo Ribalda --- arch/x86/purgatory/Ma

[PATCH v6 1/4] kexec: Support purgatories with .text.hot sections

2023-05-01 Thread Ricardo Ribalda
ecause of this, the system crashes immediately after: kexec_core: Starting new kernel Cc: sta...@vger.kernel.org Fixes: 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory") Reviewed-by: Ross Zwisler Reviewed-by: Steven Rostedt (Google) Reviewed-by: Philipp Rudo Signed-off-by:

Re: [PATCH v5 2/2] x86/purgatory: Add linker script

2023-04-11 Thread Ricardo Ribalda
ct llvm quickly. If it > requires profile data, you'll need to share it, since CrOS engineers > still have not posted public documentation on AutoFDO as I have > repeatedly asked for. The simplest test is to run: $readelf -S arch/x86/purgatory/purgatory.ro | grep "] \.text"

Re: [PATCH v5 2/2] x86/purgatory: Add linker script

2023-04-03 Thread Ricardo Ribalda
Hi Ross On Fri, 31 Mar 2023 at 21:14, Ross Zwisler wrote: > > On Thu, Mar 30, 2023 at 3:45 AM Ricardo Ribalda wrote: > > Make sure that the .text section is not divided in multiple overlapping > > sections. This is not supported by kexec_file. > > How does this int

Re: [PATCH v4 1/2] kexec: Support purgatories with .text.hot sections

2023-03-30 Thread Ricardo Ribalda
Hi Simon Thanks for your review! On Thu, 30 Mar 2023 at 09:49, Simon Horman wrote: > > On Mon, Mar 27, 2023 at 05:06:53PM +0200, Ricardo Ribalda wrote: > > Clang16 links the purgatory text in two sections: > > > > [ 1] .text PROGBITS 00

[PATCH v5 2/2] x86/purgatory: Add linker script

2023-03-30 Thread Ricardo Ribalda
Make sure that the .text section is not divided in multiple overlapping sections. This is not supported by kexec_file. Signed-off-by: Ricardo Ribalda --- arch/x86/purgatory/.gitignore| 2 ++ arch/x86/purgatory/Makefile | 20 + arch/x86/purgatory/kexec-purgatory.S

[PATCH v5 0/2] kexec: Fix kexec_file_load for llvm16

2023-03-30 Thread Ricardo Ribalda
When upreving llvm I realised that kexec stopped working on my test platform. This patch fixes it. Signed-off-by: Ricardo Ribalda --- Changes in v5: - Add warning when multiple text sections are found. Thanks Simon! - Add Fixes tag. - Link to v4: https://lore.kernel.org/r/20230321-kexec_clang16

[PATCH v5 1/2] kexec: Support purgatories with .text.hot sections

2023-03-30 Thread Ricardo Ribalda
rashes immediately after: kexec_core: Starting new kernel Cc: sta...@vger.kernel.org Fixes: 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory") Reviewed-by: Ross Zwisler Signed-off-by: Ricardo Ribalda --- kernel/kexec_file.c | 14 +- 1 file changed, 13

[PATCH v4 0/2] kexec: Fix kexec_file_load for llvm16

2023-03-27 Thread Ricardo Ribalda
When upreving llvm I realised that kexec stopped working on my test platform. This patch fixes it. To: Eric Biederman Cc: Baoquan He Cc: Philipp Rudo Cc: kexec@lists.infradead.org Cc: linux-ker...@vger.kernel.org Cc: Ross Zwisler Cc: Steven Rostedt Signed-off-by: Ricardo Ribalda

[PATCH v4 2/2] x86/purgatory: Add linker script

2023-03-27 Thread Ricardo Ribalda
Make sure that the .text section is not divided in multiple overlapping sections. This is not supported by kexec_file. Signed-off-by: Ricardo Ribalda --- arch/x86/purgatory/.gitignore| 2 ++ arch/x86/purgatory/Makefile | 20 + arch/x86/purgatory/kexec-purgatory.S

[PATCH v4 1/2] kexec: Support purgatories with .text.hot sections

2023-03-27 Thread Ricardo Ribalda
rashes inmediatly after: kexec_core: Starting new kernel Cc: sta...@vger.kernel.org Reviewed-by: Ross Zwisler Signed-off-by: Ricardo Ribalda --- kernel/kexec_file.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c

Re: [PATCH v3] kexec: Support purgatories with .text.hot sections

2023-03-27 Thread Ricardo Ribalda
Hi Philipp On Fri, 24 Mar 2023 at 17:00, Philipp Rudo wrote: > > Hi Ricardo, > > On Wed, 22 Mar 2023 20:09:21 +0100 > Ricardo Ribalda wrote: > > > Clang16 links the purgatory text in two sections: > > > > [ 1] .text PROGBIT

Re: [PATCH v3] kexec: Support purgatories with .text.hot sections

2023-03-22 Thread Ricardo Ribalda
+0100, Ricardo Ribalda wrote: > > Clang16 links the purgatory text in two sections: > > > > [ 1] .text PROGBITS 0040 > >11a1 AX 0 0 16 > > [ 2] .rela.textRELA

[PATCH v3] kexec: Support purgatories with .text.hot sections

2023-03-22 Thread Ricardo Ribalda
rashes inmediatly after: kexec_core: Starting new kernel Signed-off-by: Ricardo Ribalda --- kexec: Fix kexec_file_load for llvm16 When upreving llvm I realised that kexec stopped working on my test platform. This patch fixes it. To: Eric Biederman Cc: Baoquan He Cc: Philipp Rudo Cc:

[PATCH v2] kexec: Support purgatories with .text.hot sections

2023-03-22 Thread Ricardo Ribalda
rashes inmediatly after: kexec_core: Starting new kernel Signed-off-by: Ricardo Ribalda --- kexec: Fix kexec_file_load for llvm16 When upreving llvm I realised that kexec stopped working on my test platform. This patch fixes it. To: Eric Biederman Cc: Baoquan He Cc: Philipp Rudo Cc:

Re: [PATCH] kexec: Support purgatories with .text.hot sections

2023-03-22 Thread Ricardo Ribalda
Hi Steven On Wed, 22 Mar 2023 at 15:34, Steven Rostedt wrote: > > On Tue, Mar 21, 2023 at 12:49:08PM +0100, Ricardo Ribalda wrote: > > Clang16 links the purgatory text in two sections: > > > > [ 1] .text PROGBITS 0040 >

[PATCH] kexec: Support purgatories with .text.hot sections

2023-03-21 Thread Ricardo Ribalda
rashes inmediatly after: kexec_core: Starting new kernel Signed-off-by: Ricardo Ribalda --- kexec: Support purgatories with .text.hot sections Clang16 links the purgatory text in two sections: [ 1] .text PROGBITS 0040 00

[PATCH v6 3/3] kexec: Introduce sysctl parameters kexec_load_limit_*

2023-01-04 Thread Ricardo Ribalda
, a malitious user will have small chances to replace that kernel with a different one, even if they can trigger timeouts on the disk where the panic kernel lives. Reviewed-by: Steven Rostedt (Google) Signed-off-by: Ricardo Ribalda --- Documentation/admin-guide/sysctl/kernel.rst | 18 ++ include

[PATCH v6 1/3] Documentation: sysctl: Correct kexec_load_disabled

2023-01-04 Thread Ricardo Ribalda
kexec_load_disabled affects both ``kexec_load`` and ``kexec_file_load`` syscalls. Make it explicit. Reviewed-by: Steven Rostedt (Google) Signed-off-by: Ricardo Ribalda --- Documentation/admin-guide/sysctl/kernel.rst | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git

[PATCH v6 0/3] kexec: Add new parameter to limit the access to kexec

2023-01-04 Thread Ricardo Ribalda
: kexec@lists.infradead.org Cc: Joel Fernandes (Google) Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Ross Zwisler To: Philipp Rudo To: Guilherme G. Piccoli Cc: Bagas Sanjaya Cc: Petr Tesarik Cc: Baoquan He Signed-off-by: Ricardo Ribalda --- Changes in v6: - Fix kexec type on kexec_file

[PATCH v6 2/3] kexec: Factor out kexec_load_permitted

2023-01-04 Thread Ricardo Ribalda
Both syscalls (kexec and kexec_file) do the same check, lets factor it out. Reviewed-by: Steven Rostedt (Google) Signed-off-by: Ricardo Ribalda --- include/linux/kexec.h | 3 ++- kernel/kexec.c| 2 +- kernel/kexec_core.c | 11 ++- kernel/kexec_file.c | 2 +- 4 files

[PATCH v5 1/3] Documentation: sysctl: Correct kexec_load_disabled

2022-12-21 Thread Ricardo Ribalda
kexec_load_disabled affects both ``kexec_load`` and ``kexec_file_load`` syscalls. Make it explicit. Signed-off-by: Ricardo Ribalda --- Documentation/admin-guide/sysctl/kernel.rst | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/sysctl

[PATCH v5 0/3] kexec: Add new parameter to limit the access to kexec

2022-12-21 Thread Ricardo Ribalda
: kexec@lists.infradead.org Cc: Joel Fernandes (Google) Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Ross Zwisler To: Philipp Rudo To: Guilherme G. Piccoli Signed-off-by: Ricardo Ribalda --- Changes in v5: - Remove maxlen from ctl_table. Thanks Steven! - Link to v4: https://lore.kernel.org

[PATCH v5 2/3] kexec: Factor out kexec_load_permitted

2022-12-21 Thread Ricardo Ribalda
Both syscalls (kexec and kexec_file) do the same check, lets factor it out. Signed-off-by: Ricardo Ribalda --- include/linux/kexec.h | 3 ++- kernel/kexec.c| 2 +- kernel/kexec_core.c | 11 ++- kernel/kexec_file.c | 2 +- 4 files changed, 14 insertions(+), 4 deletions

[PATCH v5 3/3] kexec: Introduce sysctl parameters kexec_load_limit_*

2022-12-21 Thread Ricardo Ribalda
Add two parameters to specify how many times a kexec kernel can be loaded. The sysadmin can set different limits for kexec panic and kexec reboot kernels. The value can be modified at runtime via sysctl, but only with a value smaller than the current one (except -1). Signed-off-by: Ricardo

[PATCH v4 0/3] kexec: Add new parameter to limit the access to kexec

2022-12-21 Thread Ricardo Ribalda
: kexec@lists.infradead.org Cc: Joel Fernandes (Google) Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Ross Zwisler To: Philipp Rudo To: Guilherme G. Piccoli Signed-off-by: Ricardo Ribalda --- Changes in v4 (Thanks Steven!): - Uses sysctl instead or module_parameters - Pass image type instead

[PATCH v4 2/3] kexec: Factor out kexec_load_permitted

2022-12-21 Thread Ricardo Ribalda
Both syscalls (kexec and kexec_file) do the same check, lets factor it out. Signed-off-by: Ricardo Ribalda --- include/linux/kexec.h | 3 ++- kernel/kexec.c| 2 +- kernel/kexec_core.c | 11 ++- kernel/kexec_file.c | 2 +- 4 files changed, 14 insertions(+), 4 deletions

[PATCH v4 1/3] Documentation: sysctl: Correct kexec_load_disabled

2022-12-21 Thread Ricardo Ribalda
kexec_load_disabled affects both ``kexec_load`` and ``kexec_file_load`` syscalls. Make it explicit. Signed-off-by: Ricardo Ribalda --- Documentation/admin-guide/sysctl/kernel.rst | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/sysctl

[PATCH v4 3/3] kexec: Introduce sysctl parameters kexec_load_limit_*

2022-12-21 Thread Ricardo Ribalda
Add two parameters to specify how many times a kexec kernel can be loaded. The sysadmin can set different limits for kexec panic and kexec reboot kernels. The value can be modified at runtime via sysctl, but only with a value smaller than the current one (except -1). Signed-off-by: Ricardo

Re: [PATCH v3 3/3] kexec: Introduce parameters load_limit_reboot and load_limit_panic

2022-12-20 Thread Ricardo Ribalda
23:05:45 +0100 > Ricardo Ribalda wrote: > > I hate to be the grammar police, but.. > > > Add two parameter to specify how many times a kexec kernel can be loaded. > >"parameters" > > > > > The sysadmin can set different limits for kexec pa

[PATCH v3 2/3] kexec: Factor out kexec_load_permitted

2022-12-20 Thread Ricardo Ribalda
Both syscalls (kexec and kexec_file) do the same check, lets factor it out. Signed-off-by: Ricardo Ribalda --- include/linux/kexec.h | 3 ++- kernel/kexec.c| 2 +- kernel/kexec_core.c | 11 ++- kernel/kexec_file.c | 2 +- 4 files changed, 14 insertions(+), 4 deletions

[PATCH v3 1/3] Documentation: sysctl: Correct kexec_load_disabled

2022-12-20 Thread Ricardo Ribalda
kexec_load_disabled affects both ``kexec_load`` and ``kexec_file_load`` syscalls. Make it explicit. Signed-off-by: Ricardo Ribalda --- Documentation/admin-guide/sysctl/kernel.rst | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/sysctl

[PATCH v3 3/3] kexec: Introduce parameters load_limit_reboot and load_limit_panic

2022-12-20 Thread Ricardo Ribalda
Add two parameter to specify how many times a kexec kernel can be loaded. The sysadmin can set different limits for kexec panic and kexec reboot kernels. The value can be modified at runtime via sysfs, but only with a value smaller than the current one (except -1). Signed-off-by: Ricardo

Re: [PATCH v2 3/3] kexec: Introduce paramters load_limit_reboot and load_limit_panic

2022-12-20 Thread Ricardo Ribalda
Hi Joel Thanks for looking into this On Thu, 15 Dec 2022 at 20:16, Joel Fernandes wrote: > > Hi Ricardo, > > On Thu, Dec 08, 2022 at 05:38:02PM +0100, Ricardo Ribalda wrote: > > Add two parameter to specify how many times a kexec kernel can be loaded. > > > >

[PATCH v3 0/3] kexec: Add new parameter to limit the access to kexec

2022-12-20 Thread Ricardo Ribalda
: kexec@lists.infradead.org Cc: Joel Fernandes (Google) Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Ross Zwisler To: Philipp Rudo To: Guilherme G. Piccoli Signed-off-by: Ricardo Ribalda --- Changes in v3: - s/paramter/parameter/ Thanks Ghilherme! - s/permited/permitted/ Thanks Joel! - Link

Re: [PATCH v1 2/2] kexec: Introduce kexec_reboot_disabled

2022-12-12 Thread Ricardo Ribalda
> I actually like this idea :-) In case you missed it. I sent an initial implementation of this at https://lore.kernel.org/lkml/20221114-disable-kexec-reset-v2-0-c498313c1...@chromium.org/ Regards! > > -- Steve -- Ricardo Ribalda ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec

[PATCH v2 2/3] kexec: Factor out kexec_load_permited

2022-12-08 Thread Ricardo Ribalda
Both syscalls (kexec and kexec_file) do the same check, lets factor it out. Signed-off-by: Ricardo Ribalda --- include/linux/kexec.h | 3 ++- kernel/kexec.c| 2 +- kernel/kexec_core.c | 11 ++- kernel/kexec_file.c | 2 +- 4 files changed, 14 insertions(+), 4 deletions

[PATCH v2 3/3] kexec: Introduce paramters load_limit_reboot and load_limit_panic

2022-12-08 Thread Ricardo Ribalda
Add two parameter to specify how many times a kexec kernel can be loaded. The sysadmin can set different limits for kexec panic and kexec reboot kernels. The value can be modified at runtime via sysfs, but only with a value smaller than the current one (except -1). Signed-off-by: Ricardo

[PATCH v2 0/3] kexec: Add new parameter to limit the access to kexec

2022-12-08 Thread Ricardo Ribalda
: kexec@lists.infradead.org Cc: Joel Fernandes (Google) Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Ross Zwisler To: Philipp Rudo Signed-off-by: Ricardo Ribalda --- Changes in v2: - Instead of kexec_reboot_disabled, add two new counters (Thanks Philipp!) - Link to v1: https

[PATCH v2 1/3] Documentation: sysctl: Correct kexec_load_disabled

2022-12-08 Thread Ricardo Ribalda
kexec_load_disabled affects both ``kexec_load`` and ``kexec_file_load`` syscalls. Make it explicit. Signed-off-by: Ricardo Ribalda --- Documentation/admin-guide/sysctl/kernel.rst | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/sysctl

Re: [PATCH v8 2/3] freezer: refactor pm_freezing into a function.

2022-12-06 Thread Ricardo Ribalda
Hi Rafael On Fri, 2 Dec 2022 at 18:48, Rafael J. Wysocki wrote: > > On Thu, Dec 1, 2022 at 12:08 PM Ricardo Ribalda wrote: > > > > Add a way to let the drivers know if the processes are frozen. > > > > This is needed by drivers that are waiting for processes to

Re: [PATCH v8 3/3] ASoC: SOF: Fix deadlock when shutdown a frozen userspace

2022-12-01 Thread Ricardo Ribalda
Hi Oliver On Thu, 1 Dec 2022 at 14:22, 'Oliver Neukum' via Chromeos Kdump wrote: > > On 01.12.22 14:03, Ricardo Ribalda wrote: > > Hi, > > > This patchset does not modify this behaviour. It simply fixes the > > stall for kexec(). > > > > The patch that

Re: [PATCH v8 3/3] ASoC: SOF: Fix deadlock when shutdown a frozen userspace

2022-12-01 Thread Ricardo Ribalda
Hi Oliver Thanks for your review On Thu, 1 Dec 2022 at 13:29, Oliver Neukum wrote: > > On 01.12.22 12:08, Ricardo Ribalda wrote: > > If we are shutting down due to kexec and the userspace is frozen, the > > system will stall forever waiting for userspace to complete. &

[PATCH v8 3/3] ASoC: SOF: Fix deadlock when shutdown a frozen userspace

2022-12-01 Thread Ricardo Ribalda
: 83bfc7e793b5 ("ASoC: SOF: core: unregister clients and machine drivers in .shutdown") Signed-off-by: Ricardo Ribalda --- sound/soc/sof/core.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c index 3e6141d03770..9587b6a85

[PATCH v8 2/3] freezer: refactor pm_freezing into a function.

2022-12-01 Thread Ricardo Ribalda
Fixes: 83bfc7e793b5 ("ASoC: SOF: core: unregister clients and machine drivers in .shutdown") Signed-off-by: Ricardo Ribalda sdad --- include/linux/freezer.h | 3 ++- kernel/freezer.c| 3 +-- kernel/power/process.c | 24 3 files changed, 23 insert

[PATCH v8 1/3] kexec: Refactor kexec_in_progress into a function

2022-12-01 Thread Ricardo Ribalda
chine drivers in .shutdown") Signed-off-by: Ricardo Ribalda --- arch/powerpc/platforms/pseries/vio.c | 2 +- arch/x86/kernel/cpu/mshyperv.c | 6 +++--- arch/x86/xen/enlighten_hvm.c | 2 +- drivers/firmware/efi/efi.c | 2 +- drivers/pci/pci-driver.c

[PATCH v8 0/3] ASoC: SOF: Fix deadlock when shutdown a frozen userspace

2022-12-01 Thread Ricardo Ribalda
: kexec@lists.infradead.org Cc: linuxppc-...@lists.ozlabs.org Cc: linux-hyp...@vger.kernel.org Cc: xen-de...@lists.xenproject.org Cc: linux-...@vger.kernel.org Cc: linux-...@vger.kernel.org Cc: linux...@vger.kernel.org Signed-off-by: Ricardo Ribalda --- Changes in v8: - Wrap pm_freezing and kex

[PATCH v7 1/2] kexec: Introduce kexec_with_frozen_processes

2022-11-30 Thread Ricardo Ribalda
("ASoC: SOF: core: unregister clients and machine drivers in .shutdown") Signed-off-by: Ricardo Ribalda --- include/linux/kexec.h | 3 +++ kernel/kexec_core.c | 5 + 2 files changed, 8 insertions(+) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 41a686996aaa..c2

[PATCH v7 0/2] ASoC: SOF: Fix deadlock when shutdown a frozen userspace

2022-11-30 Thread Ricardo Ribalda
ostedt Cc: sta...@vger.kernel.org Cc: sound-open-firmw...@alsa-project.org Cc: alsa-de...@alsa-project.org Cc: linux-ker...@vger.kernel.org Cc: kexec@lists.infradead.org Signed-off-by: Ricardo Ribalda --- Changes in v7: - Fix commit message (Thanks Pierre-Louis). - Link to v6: https://lore.ke

[PATCH v7 2/2] ASoC: SOF: Fix deadlock when shutdown a frozen userspace

2022-11-30 Thread Ricardo Ribalda
core: unregister clients and machine drivers in .shutdown") Signed-off-by: Ricardo Ribalda --- sound/soc/sof/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c index 3e6141d03770..4301f347bb90 100644 --- a/sound/soc/sof/core.c +

[PATCH v6 0/2] ASoC: SOF: Fix deadlock when shutdown a frozen userspace

2022-11-30 Thread Ricardo Ribalda
ostedt Cc: sta...@vger.kernel.org Cc: sound-open-firmw...@alsa-project.org Cc: alsa-de...@alsa-project.org Cc: linux-ker...@vger.kernel.org Cc: kexec@lists.infradead.org Signed-off-by: Ricardo Ribalda --- Changes in v6: - Check if we are in kexec with the userspace frozen. - Link to v5: https://lore.

[PATCH v6 1/2] kexec: Introduce kexec_with_frozen_processes

2022-11-30 Thread Ricardo Ribalda
Drivers running .shutdown() might want to wait for userspace to complete before exiting. If userspace is frozen and we are running kexec they will stall the computer. Add a way for them to figure out if they should just skip waiting for userspace. Signed-off-by: Ricardo Ribalda --- include

[PATCH v6 2/2] ASoC: SOF: Fix deadlock when shutdown a frozen userspace

2022-11-30 Thread Ricardo Ribalda
ients and machine drivers in .shutdown") Signed-off-by: Ricardo Ribalda --- sound/soc/sof/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c index 3e6141d03770..4301f347bb90 100644 --- a/sound/soc/sof/core.c +++ b/sou

Re: [PATCH] kexec: Enable runtime allocation of crash_image

2022-11-28 Thread Ricardo Ribalda
Hi Philipp Thanks for your review. On Mon, 28 Nov 2022 at 18:00, Philipp Rudo wrote: > > Hi Ricardo, > > On Thu, 24 Nov 2022 23:23:36 +0100 > Ricardo Ribalda wrote: > > > Usually crash_image is defined statically via the crashkernel parameter > > or DT. &

Re: [PATCH] kexec: Enable runtime allocation of crash_image

2022-11-25 Thread Ricardo Ribalda
Hi Baoquan On Fri, 25 Nov 2022 at 08:45, Baoquan He wrote: > > On 11/25/22 at 08:26am, Ricardo Ribalda wrote: > > Hi Baoquan > > > > On Fri, 25 Nov 2022 at 08:15, Baoquan He wrote: > > > > > > On 11/25/22 at 06:52am, Ricardo Ribalda wrote: > >

Re: [PATCH] kexec: Enable runtime allocation of crash_image

2022-11-24 Thread Ricardo Ribalda
Hi On Fri, 25 Nov 2022 at 08:27, Baoquan He wrote: > > On 11/25/22 at 06:52am, Ricardo Ribalda wrote: > > Hi Baoquan > > > > Thanks for your review! > > > > On Fri, 25 Nov 2022 at 03:58, Baoquan He wrote: > > > > > > On 11/24/22 at 11:23

Re: [PATCH] kexec: Enable runtime allocation of crash_image

2022-11-24 Thread Ricardo Ribalda
Hi Baoquan On Fri, 25 Nov 2022 at 08:15, Baoquan He wrote: > > On 11/25/22 at 06:52am, Ricardo Ribalda wrote: > > Hi Baoquan > > > > Thanks for your review! > > > > On Fri, 25 Nov 2022 at 03:58, Baoquan He wrote: > > > > > > On 11/24

Re: [PATCH] kexec: Enable runtime allocation of crash_image

2022-11-24 Thread Ricardo Ribalda
Hi Baoquan Thanks for your review! On Fri, 25 Nov 2022 at 03:58, Baoquan He wrote: > > On 11/24/22 at 11:23pm, Ricardo Ribalda wrote: > > Usually crash_image is defined statically via the crashkernel parameter > > or DT. > > > > But if the crash kernel i

Re: [PATCH v1 2/2] kexec: Introduce kexec_reboot_disabled

2022-11-24 Thread Ricardo Ribalda
Hi Philipp On Thu, 24 Nov 2022 at 16:01, Philipp Rudo wrote: > > On Thu, 24 Nov 2022 13:52:58 +0100 > Ricardo Ribalda wrote: > > > On Thu, 24 Nov 2022 at 12:40, Philipp Rudo wrote: > > > > > > Hi Ricardo, > > > > > > On Wed, 2

[PATCH] kexec: Enable runtime allocation of crash_image

2022-11-24 Thread Ricardo Ribalda
allocation of the crash_image if the crash_image is not defined statically. Following the same memory allocation/validation path that for the reboot kexec kernel. Signed-off-by: Ricardo Ribalda --- kexec: Enable runtime allocation of crash_image To: Eric Biederman Cc: kexec@lists.infradead.org Cc

Re: [PATCH v1 2/2] kexec: Introduce kexec_reboot_disabled

2022-11-24 Thread Ricardo Ribalda
On Thu, 24 Nov 2022 at 12:40, Philipp Rudo wrote: > > Hi Ricardo, > > On Wed, 23 Nov 2022 09:58:08 +0100 > Ricardo Ribalda wrote: > > > Hi Philipp > > > > Thanks for your review. > > > > My scenario is a trusted system, where even if you are roo

Re: [PATCH v1 2/2] kexec: Introduce kexec_reboot_disabled

2022-11-23 Thread Ricardo Ribalda
:15:07 +0100 > Ricardo Ribalda wrote: > > > Hi Philipp > > > > Thanks for your review! > > happy to help. > > > > > On Thu, 17 Nov 2022 at 16:07, Philipp Rudo wrote: > > > > > > Hi Ricardo, > > > > > > all in all I think

Re: [PATCH v1 2/2] kexec: Introduce kexec_reboot_disabled

2022-11-17 Thread Ricardo Ribalda
Hi Philipp Thanks for your review! On Thu, 17 Nov 2022 at 16:07, Philipp Rudo wrote: > > Hi Ricardo, > > all in all I think this patch makes sense. However, there is one point > I don't like... > > On Mon, 14 Nov 2022 14:18:39 +0100 > Ricardo Ribalda wrote: &

[PATCH v1 1/2] Documentation: sysctl: Correct kexec_load_disabled

2022-11-14 Thread Ricardo Ribalda
kexec_load_disabled affects both ``kexec_load`` and ``kexec_file_load`` syscalls. Make it explicit. Signed-off-by: Ricardo Ribalda diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst index 98d1b198b2b4..97394bd9d065 100644 --- a/Documentation

[PATCH v1 2/2] kexec: Introduce kexec_reboot_disabled

2022-11-14 Thread Ricardo Ribalda
Create a new toogle that disables LINUX_REBOOT_CMD_KEXEC, reducing the attack surface to a system. Without this toogle, an attacker can only reboot into a different kernel if they can create a panic(). Signed-off-by: Ricardo Ribalda diff --git a/Documentation/admin-guide/sysctl/kernel.rst b

[PATCH v1 0/2] kexec: Add new toogle to disable kexec_reboot

2022-11-14 Thread Ricardo Ribalda
Fernandes (Google) Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Ross Zwisler Signed-off-by: Ricardo Ribalda --- Ricardo Ribalda (2): Documentation: sysctl: Correct kexec_load_disabled kexec: Introduce kexec_reboot_disabled Documentation/admin-guide/sysctl/kernel.rst | 18