* [PATCH] reboot: disable nonboot CPUs
@ 2012-06-14 21:25 Per Forlin
2012-06-14 21:41 ` Kees Cook
0 siblings, 1 reply; 5+ messages in thread
From: Per Forlin @ 2012-06-14 21:25 UTC (permalink / raw)
To: linux-kernel, gorcunov, serge.hallyn, keescook, Linus Walleij,
Per Forlin
Cc: Andrew Morton, Per Forlin
Disable the nonboot CPUs to safely migrate tasks and interrupts
to the boot CPU. This will prevent the nonboot CPUs to
interfer or block the boot CPU from being able to reboot
the system successfully.
Signed-off-by: Per Forlin <per.forlin@stericsson.com>
---
Is there a reason for disable nonboot CPUs only for power_off but not reboot?
I have run into an issue on an ARM platform that prevents reboot unless
the nonboot CPUs are brought down safetly. I could make this patch ARM
specific but I thought that other ARCHs may benefit from this patch too.
kernel/sys.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/kernel/sys.c b/kernel/sys.c
index f0ec44d..0eaa8e0 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -323,6 +323,7 @@ void kernel_restart_prepare(char *cmd)
system_state = SYSTEM_RESTART;
usermodehelper_disable();
device_shutdown();
+ disable_nonboot_cpus();
syscore_shutdown();
}
--
1.7.8
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] reboot: disable nonboot CPUs
2012-06-14 21:25 [PATCH] reboot: disable nonboot CPUs Per Forlin
@ 2012-06-14 21:41 ` Kees Cook
2012-06-14 21:48 ` Cyrill Gorcunov
0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2012-06-14 21:41 UTC (permalink / raw)
To: Per Forlin
Cc: linux-kernel, gorcunov, serge.hallyn, Linus Walleij, Per Forlin,
Andrew Morton
On Thu, Jun 14, 2012 at 2:25 PM, Per Forlin <per.forlin@stericsson.com> wrote:
> Disable the nonboot CPUs to safely migrate tasks and interrupts
> to the boot CPU. This will prevent the nonboot CPUs to
> interfer or block the boot CPU from being able to reboot
> the system successfully.
Reviewed-by: Kees Cook <keescook@chromium.org>
This seems reasonable to me, though I haven't looked too deeply at the
reboot path.
-Kees
--
Kees Cook
Chrome OS Security
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] reboot: disable nonboot CPUs
2012-06-14 21:41 ` Kees Cook
@ 2012-06-14 21:48 ` Cyrill Gorcunov
2012-06-22 20:57 ` Andrew Morton
0 siblings, 1 reply; 5+ messages in thread
From: Cyrill Gorcunov @ 2012-06-14 21:48 UTC (permalink / raw)
To: Kees Cook
Cc: Per Forlin, linux-kernel, serge.hallyn, Linus Walleij, Per Forlin,
Andrew Morton, H. Peter Anvin, Thomas Gleixner, Ingo Molnar
On Thu, Jun 14, 2012 at 02:41:48PM -0700, Kees Cook wrote:
> On Thu, Jun 14, 2012 at 2:25 PM, Per Forlin <per.forlin@stericsson.com> wrote:
> > Disable the nonboot CPUs to safely migrate tasks and interrupts
> > to the boot CPU. This will prevent the nonboot CPUs to
> > interfer or block the boot CPU from being able to reboot
> > the system successfully.
>
> Reviewed-by: Kees Cook <keescook@chromium.org>
>
> This seems reasonable to me, though I haven't looked too deeply at the
> reboot path.
Looks reasonable to me as well, but better to add some more CC,
since syscore_shutdown seems to call for generic irqs to shutdown
when cpu get turned off already, not sure if this have any side
effect and/or I've missed something (Thomas CC'ed).
Cyrill
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] reboot: disable nonboot CPUs
2012-06-14 21:48 ` Cyrill Gorcunov
@ 2012-06-22 20:57 ` Andrew Morton
2012-06-22 21:13 ` Cyrill Gorcunov
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2012-06-22 20:57 UTC (permalink / raw)
To: Cyrill Gorcunov
Cc: Kees Cook, Per Forlin, linux-kernel, serge.hallyn, Linus Walleij,
Per Forlin, H. Peter Anvin, Thomas Gleixner, Ingo Molnar
On Fri, 15 Jun 2012 01:48:34 +0400
Cyrill Gorcunov <gorcunov@openvz.org> wrote:
> On Thu, Jun 14, 2012 at 02:41:48PM -0700, Kees Cook wrote:
> > On Thu, Jun 14, 2012 at 2:25 PM, Per Forlin <per.forlin@stericsson.com> wrote:
> > > Disable the nonboot CPUs to safely migrate tasks and interrupts
> > > to the boot CPU. This will prevent the nonboot CPUs to
> > > interfer or block the boot CPU from being able to reboot
> > > the system successfully.
> >
> > Reviewed-by: Kees Cook <keescook@chromium.org>
> >
> > This seems reasonable to me, though I haven't looked too deeply at the
> > reboot path.
>
> Looks reasonable to me as well, but better to add some more CC,
That worked well :(
> since syscore_shutdown seems to call for generic irqs to shutdown
> when cpu get turned off already, not sure if this have any side
> effect and/or I've missed something (Thomas CC'ed).
Let's use the scientific method: stick it in the tree and see what
happens. If it breaks, we fix or revert it.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] reboot: disable nonboot CPUs
2012-06-22 20:57 ` Andrew Morton
@ 2012-06-22 21:13 ` Cyrill Gorcunov
0 siblings, 0 replies; 5+ messages in thread
From: Cyrill Gorcunov @ 2012-06-22 21:13 UTC (permalink / raw)
To: Andrew Morton
Cc: Kees Cook, Per Forlin, linux-kernel, serge.hallyn, Linus Walleij,
Per Forlin, H. Peter Anvin, Thomas Gleixner, Ingo Molnar
On Fri, Jun 22, 2012 at 01:57:04PM -0700, Andrew Morton wrote:
> > since syscore_shutdown seems to call for generic irqs to shutdown
> > when cpu get turned off already, not sure if this have any side
> > effect and/or I've missed something (Thomas CC'ed).
>
> Let's use the scientific method: stick it in the tree and see what
> happens. If it breaks, we fix or revert it.
yeah, i'll try to find some time on weekend for deeper review.
Cyrill
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-06-22 21:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14 21:25 [PATCH] reboot: disable nonboot CPUs Per Forlin
2012-06-14 21:41 ` Kees Cook
2012-06-14 21:48 ` Cyrill Gorcunov
2012-06-22 20:57 ` Andrew Morton
2012-06-22 21:13 ` Cyrill Gorcunov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox